From a0340df0c5cd7cc4528f2dc0c4b0679ddc15544c Mon Sep 17 00:00:00 2001 From: Chris Abraham Date: Thu, 18 Jul 2024 08:56:10 +0700 Subject: [PATCH] Added new speaker fields Signed-off-by: Chris Abraham --- .../lfevents/admin/partials/sidebars.php | 32 ++++++++++++++++--- .../speakers-block-2/block-speakers-block.php | 12 ++++--- 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/web/wp-content/mu-plugins/custom/lfevents/admin/partials/sidebars.php b/web/wp-content/mu-plugins/custom/lfevents/admin/partials/sidebars.php index 84dfe363..7c40c2f3 100644 --- a/web/wp-content/mu-plugins/custom/lfevents/admin/partials/sidebars.php +++ b/web/wp-content/mu-plugins/custom/lfevents/admin/partials/sidebars.php @@ -824,14 +824,25 @@ 'settings' => array( array( 'type' => 'text', - 'id' => 'title', + 'id' => 'job_title', 'data_type' => 'meta', - 'data_key' => 'title', - 'label' => __( 'Title, Company' ), + 'data_key' => 'job_title', + 'label' => __( 'Job Title' ), + 'register_meta' => true, + 'ui_border_top' => false, + 'default_value' => '', + 'placeholder' => __( 'Senior Software Engineer' ), + ), + array( + 'type' => 'text', + 'id' => 'company', + 'data_type' => 'meta', + 'data_key' => 'company', + 'label' => __( 'Company' ), 'register_meta' => true, 'ui_border_top' => false, 'default_value' => '', - 'placeholder' => __( 'Title, Company' ), + 'placeholder' => __( 'Microsoft' ), ), array( 'type' => 'image', @@ -849,7 +860,7 @@ 'data_key' => 'linkedin', 'label' => __( 'LinkedIn URL' ), 'register_meta' => true, - 'ui_border_top' => false, + 'ui_border_top' => true, 'default_value' => '', 'placeholder' => __( 'https://www.linkedin.com/in/username/' ), ), @@ -886,6 +897,17 @@ 'default_value' => '', 'placeholder' => __( 'https://cncf.io' ), ), + array( + 'type' => 'text', + 'id' => 'title', + 'data_type' => 'meta', + 'data_key' => 'title', + 'label' => __( 'OLD!!! Title, Company' ), + 'register_meta' => true, + 'ui_border_top' => true, + 'default_value' => '', + 'placeholder' => __( 'For old speakers block' ), + ), ), ), ), diff --git a/web/wp-content/plugins/speakers-block-2/block-speakers-block.php b/web/wp-content/plugins/speakers-block-2/block-speakers-block.php index 5ee78bbd..e942f7d3 100644 --- a/web/wp-content/plugins/speakers-block-2/block-speakers-block.php +++ b/web/wp-content/plugins/speakers-block-2/block-speakers-block.php @@ -82,11 +82,13 @@ function ( $speaker ) { have_posts() ) { $query->the_post(); - $id = get_the_ID(); - $linkedin = get_post_meta( $id, 'lfes_speaker_linkedin', true ); - $twitter = get_post_meta( $id, 'lfes_speaker_twitter', true ); - $github = get_post_meta( $id, 'lfes_speaker_github', true ); - $website = get_post_meta( $id, 'lfes_speaker_website', true ); + $id = get_the_ID(); + $linkedin = get_post_meta( $id, 'lfes_speaker_linkedin', true ); + $twitter = get_post_meta( $id, 'lfes_speaker_twitter', true ); + $github = get_post_meta( $id, 'lfes_speaker_github', true ); + $website = get_post_meta( $id, 'lfes_speaker_website', true ); + $job_title = get_post_meta( $id, 'lfes_speaker_job_title', true ); + $company = get_post_meta( $id, 'lfes_speaker_company', true ); $company_logo = get_post_meta( $id, 'lfes_speaker_company_logo', true ); ?>