Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add first_name & last_name to user object fields #5775

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 27 additions & 15 deletions classes/PodsAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -1203,29 +1203,41 @@ public function get_wp_object_fields( $object = 'post_type', $pod = null, $refre
'type' => 'number',
'alias' => array( 'id' ),
'options' => array(
'number_format' => '9999.99'
)
'number_format' => '9999.99',
),
),
'user_login' => array(
'name' => 'user_login',
'label' => 'Title',
'type' => 'text',
'alias' => array( 'login' ),
'options' => array(
'required' => 1
)
'required' => 1,
),
),
'user_nicename' => array(
'name' => 'user_nicename',
'label' => 'Permalink',
'type' => 'slug',
'alias' => array( 'nicename', 'slug', 'permalink' )
'alias' => array( 'nicename', 'slug', 'permalink' ),
),
'first_name' => array(
'name' => 'first_name',
'label' => 'First Name',
'type' => 'text',
'alias' => array( 'firstname' ),
),
'last_name' => array(
'name' => 'last_name',
'label' => 'Last Name',
'type' => 'text',
'alias' => array( 'lastname' ),
),
'display_name' => array(
'name' => 'display_name',
'label' => 'Display Name',
'type' => 'text',
'alias' => array( 'title', 'name' )
'alias' => array( 'title', 'name' ),
),
'user_pass' => array(
'name' => 'user_pass',
Expand All @@ -1234,8 +1246,8 @@ public function get_wp_object_fields( $object = 'post_type', $pod = null, $refre
'alias' => array( 'password', 'pass' ),
'options' => array(
'required' => 1,
'text_format_type' => 'password'
)
'text_format_type' => 'password',
),
),
'user_email' => array(
'name' => 'user_email',
Expand All @@ -1244,8 +1256,8 @@ public function get_wp_object_fields( $object = 'post_type', $pod = null, $refre
'alias' => array( 'email' ),
'options' => array(
'required' => 1,
'text_format_type' => 'email'
)
'text_format_type' => 'email',
),
),
'user_url' => array(
'name' => 'user_url',
Expand All @@ -1255,18 +1267,18 @@ public function get_wp_object_fields( $object = 'post_type', $pod = null, $refre
'options' => array(
'required' => 0,
'text_format_type' => 'website',
'text_format_website' => 'normal'
)
'text_format_website' => 'normal',
),
),
'user_registered' => array(
'name' => 'user_registered',
'label' => 'Registration Date',
'type' => 'date',
'alias' => array( 'created', 'date', 'registered' ),
'options' => array(
'date_format_type' => 'datetime'
)
)
'date_format_type' => 'datetime',
),
),
);
} elseif ( 'comment' === $object ) {
$fields = array(
Expand Down