From 19153ff50a0fb992fc11d6b04a551c98c2ff1360 Mon Sep 17 00:00:00 2001 From: JoryHogeveen Date: Tue, 14 Jul 2020 17:11:48 +0200 Subject: [PATCH 1/2] Add `first_name` & `last_name` to user object fields --- classes/PodsAPI.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/classes/PodsAPI.php b/classes/PodsAPI.php index d160ad18b8..0d8d34a481 100644 --- a/classes/PodsAPI.php +++ b/classes/PodsAPI.php @@ -1203,6 +1203,18 @@ public function get_wp_object_fields( $object = 'post_type', $pod = null, $refre 'type' => 'slug', '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', From 2b840845719940da52bf26c9bdd2ce5b1f354ed9 Mon Sep 17 00:00:00 2001 From: JoryHogeveen Date: Tue, 14 Jul 2020 17:24:16 +0200 Subject: [PATCH 2/2] Codestyle --- classes/PodsAPI.php | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/classes/PodsAPI.php b/classes/PodsAPI.php index 0d8d34a481..313f57ea07 100644 --- a/classes/PodsAPI.php +++ b/classes/PodsAPI.php @@ -1185,8 +1185,8 @@ 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', @@ -1194,32 +1194,32 @@ public function get_wp_object_fields( $object = 'post_type', $pod = null, $refre '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( + 'first_name' => array( 'name' => 'first_name', 'label' => 'First Name', 'type' => 'text', - 'alias' => array( 'firstname' ) + 'alias' => array( 'firstname' ), ), - 'last_name' => array( + 'last_name' => array( 'name' => 'last_name', 'label' => 'Last Name', 'type' => 'text', - 'alias' => array( 'lastname' ) + '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', @@ -1228,8 +1228,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', @@ -1238,8 +1238,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', @@ -1249,8 +1249,8 @@ 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', @@ -1258,9 +1258,9 @@ public function get_wp_object_fields( $object = 'post_type', $pod = null, $refre 'type' => 'date', 'alias' => array( 'created', 'date', 'registered' ), 'options' => array( - 'date_format_type' => 'datetime' - ) - ) + 'date_format_type' => 'datetime', + ), + ), ); } elseif ( 'comment' === $object ) { $fields = array(