diff --git a/public_html/wp-content/plugins/wc-post-types/css/admin.css b/public_html/wp-content/plugins/wc-post-types/css/admin.css index c30b21971..704d9a5c3 100644 --- a/public_html/wp-content/plugins/wc-post-types/css/admin.css +++ b/public_html/wp-content/plugins/wc-post-types/css/admin.css @@ -43,6 +43,7 @@ li.wcpt-form-header { display: table-caption; + width: max-content; font-weight: 700; } diff --git a/public_html/wp-content/plugins/wc-post-types/css/editor.css b/public_html/wp-content/plugins/wc-post-types/css/editor.css index 21842d3e7..2b147c995 100644 --- a/public_html/wp-content/plugins/wc-post-types/css/editor.css +++ b/public_html/wp-content/plugins/wc-post-types/css/editor.css @@ -44,10 +44,14 @@ margin-right: 0; } +.wc-panel-speaker-info .components-base-control, +.wc-panel-organizer-info .components-base-control, .wc-panel-volunteer-info .components-base-control { margin-bottom: 2em; } +.wc-panel-speaker-info .components-base-control:last-child, +.wc-panel-organizer-info .components-base-control:last-child, .wc-panel-volunteer-info .components-base-control:last-child { margin-bottom: 0; } diff --git a/public_html/wp-content/plugins/wc-post-types/inc/privacy.php b/public_html/wp-content/plugins/wc-post-types/inc/privacy.php index 0894343de..2a2acb34a 100644 --- a/public_html/wp-content/plugins/wc-post-types/inc/privacy.php +++ b/public_html/wp-content/plugins/wc-post-types/inc/privacy.php @@ -59,6 +59,7 @@ function speaker_personal_data_exporter( $email_address, $page ) { 'post_content' => __( 'Speaker Bio', 'wordcamporg' ), '_wcb_speaker_email' => __( 'Gravatar Email', 'wordcamporg' ), '_wcpt_user_id' => __( 'WordPress.org Username', 'wordcamporg' ), + '_wcb_speaker_first_time' => __( 'First Time Speaker', 'wordcamporg' ), ); return _personal_data_exporter( 'wcb_speaker', $props_to_export, $email_address, $page ); @@ -79,6 +80,7 @@ function sponsor_personal_data_exporter( $email_address, $page ) { '_wcpt_sponsor_last_name' => __( 'Last Name', 'wordcamporg' ), '_wcpt_sponsor_email_address' => __( 'Email Address', 'wordcamporg' ), '_wcpt_sponsor_phone_number' => __( 'Phone Number', 'wordcamporg' ), + '_wcb_sponsor_first_time' => __( 'First Time Sponsor', 'wordcamporg' ), ); return _personal_data_exporter( 'wcb_sponsor', $props_to_export, $email_address, $page ); @@ -96,6 +98,7 @@ function organizer_personal_data_exporter( $email_address, $page ) { $props_to_export = array( 'post_title' => __( 'Organizer Name', 'wordcamporg' ), '_wcpt_user_id' => __( 'WordPress.org Username', 'wordcamporg' ), + '_wcb_organizer_first_time' => __( 'First Time Organizer', 'wordcamporg' ), ); return _personal_data_exporter( 'wcb_organizer', $props_to_export, $email_address, $page ); diff --git a/public_html/wp-content/plugins/wc-post-types/inc/rest-api.php b/public_html/wp-content/plugins/wc-post-types/inc/rest-api.php index d0a61b342..5c1bcf686 100644 --- a/public_html/wp-content/plugins/wc-post-types/inc/rest-api.php +++ b/public_html/wp-content/plugins/wc-post-types/inc/rest-api.php @@ -44,6 +44,21 @@ function register_sponsor_post_meta() { 'auth_callback' => __NAMESPACE__ . '\meta_auth_callback', ) ); + register_post_meta( + 'wcb_sponsor', + '_wcb_sponsor_first_time', + array( + 'type' => 'string', + 'show_in_rest' => array( + 'schema' => array( + 'context' => array( 'edit' ), + ), + ), + 'single' => true, + 'auth_callback' => __NAMESPACE__ . '\meta_auth_callback', + 'sanitize_callback' => __NAMESPACE__ . '\sanitize_first_time_value', + ) + ); } /** @@ -106,6 +121,21 @@ function register_speaker_post_meta() { 'auth_callback' => __NAMESPACE__ . '\meta_auth_callback', ) ); + register_post_meta( + 'wcb_speaker', + '_wcb_speaker_first_time', + array( + 'type' => 'string', + 'show_in_rest' => array( + 'schema' => array( + 'context' => array( 'edit' ), + ), + ), + 'single' => true, + 'auth_callback' => __NAMESPACE__ . '\meta_auth_callback', + 'sanitize_callback' => __NAMESPACE__ . '\sanitize_first_time_value', + ) + ); } /** @@ -240,6 +270,21 @@ function register_organizer_post_meta() { 'auth_callback' => __NAMESPACE__ . '\meta_auth_callback', ) ); + register_post_meta( + 'wcb_organizer', + '_wcb_organizer_first_time', + array( + 'type' => 'string', + 'show_in_rest' => array( + 'schema' => array( + 'context' => array( 'edit' ), + ), + ), + 'single' => true, + 'auth_callback' => __NAMESPACE__ . '\meta_auth_callback', + 'sanitize_callback' => __NAMESPACE__ . '\sanitize_first_time_value', + ) + ); } /** @@ -770,3 +815,20 @@ function add_larger_avatar_sizes( $sizes ) { return $sizes; } + +/** + * Sanitize the 'first_time' meta value before storing it. + * + * @param string $value The unsanitized meta value. + * + * @return string The sanitized meta value. + */ +function sanitize_first_time_value( $value ) { + $allowed_values = array( 'yes', 'no', 'unsure' ); + + if ( in_array( $value, $allowed_values, true ) ) { + return $value; + } else { + return 'unsure'; + } +} diff --git a/public_html/wp-content/plugins/wc-post-types/js/src/organizer/panel-info.js b/public_html/wp-content/plugins/wc-post-types/js/src/organizer/panel-info.js index c6a1acc6d..069d67130 100644 --- a/public_html/wp-content/plugins/wc-post-types/js/src/organizer/panel-info.js +++ b/public_html/wp-content/plugins/wc-post-types/js/src/organizer/panel-info.js @@ -3,6 +3,7 @@ */ import { __ } from '@wordpress/i18n'; import { PluginDocumentSettingPanel } from '@wordpress/edit-post'; +import { RadioControl } from '@wordpress/components'; /** * Internal dependencies @@ -12,6 +13,7 @@ import UsernameControl from '../components/username-control'; export default function OrganizerInfoPanel() { const [ username, setUsername ] = usePostMeta( '_wcpt_user_name', '' ); + const [ firstTime, setFirstTime ] = usePostMeta( '_wcb_organizer_first_time', false ); return ( + setFirstTime( value ) } + options={ [ + { label: 'Yes', value: 'yes' }, + { label: 'No', value: 'no' }, + { label: 'Unsure', value: 'unsure' }, + ] } + /> ); } diff --git a/public_html/wp-content/plugins/wc-post-types/js/src/speaker/panel-info.js b/public_html/wp-content/plugins/wc-post-types/js/src/speaker/panel-info.js index 663b00f6d..20519c1cf 100644 --- a/public_html/wp-content/plugins/wc-post-types/js/src/speaker/panel-info.js +++ b/public_html/wp-content/plugins/wc-post-types/js/src/speaker/panel-info.js @@ -3,7 +3,7 @@ */ import { __ } from '@wordpress/i18n'; import { PluginDocumentSettingPanel } from '@wordpress/edit-post'; -import { TextControl } from '@wordpress/components'; +import { RadioControl, TextControl } from '@wordpress/components'; /** * Internal dependencies @@ -14,6 +14,7 @@ import UsernameControl from '../components/username-control'; export default function SpeakerInfoPanel() { const [ email, setEmail ] = usePostMeta( '_wcb_speaker_email', '' ); const [ username, setUsername ] = usePostMeta( '_wcpt_user_name', '' ); + const [ firstTime, setFirstTime ] = usePostMeta( '_wcb_speaker_first_time', false ); return ( + setFirstTime( value ) } + options={ [ + { label: 'Yes', value: 'yes' }, + { label: 'No', value: 'no' }, + { label: 'Unsure', value: 'unsure' }, + ] } + /> ); } diff --git a/public_html/wp-content/plugins/wc-post-types/views/sponsors/metabox-sponsor-info.php b/public_html/wp-content/plugins/wc-post-types/views/sponsors/metabox-sponsor-info.php index dcaf678b6..d891f2c91 100644 --- a/public_html/wp-content/plugins/wc-post-types/views/sponsors/metabox-sponsor-info.php +++ b/public_html/wp-content/plugins/wc-post-types/views/sponsors/metabox-sponsor-info.php @@ -13,6 +13,7 @@ /** @var string $state */ /** @var string $zip_code */ /** @var string $country */ +/** @var string $first_time */ /** @var array $available_countries */ ?> + + diff --git a/public_html/wp-content/plugins/wc-post-types/wc-post-types.php b/public_html/wp-content/plugins/wc-post-types/wc-post-types.php index 7592cac0a..e868264db 100644 --- a/public_html/wp-content/plugins/wc-post-types/wc-post-types.php +++ b/public_html/wp-content/plugins/wc-post-types/wc-post-types.php @@ -1235,6 +1235,7 @@ public function metabox_sponsor_info( $sponsor ) { $state = get_post_meta( $sponsor->ID, '_wcpt_sponsor_state', true ); $zip_code = get_post_meta( $sponsor->ID, '_wcpt_sponsor_zip_code', true ); $country = get_post_meta( $sponsor->ID, '_wcpt_sponsor_country', true ); + $first_time = get_post_meta( $sponsor->ID, '_wcb_sponsor_first_time', true ); if ( $state === $this->get_sponsor_info_state_default_value() ) { $state = ''; @@ -1358,7 +1359,7 @@ public function save_post_sponsor( $post_id, $post ) { } if ( wp_verify_nonce( filter_input( INPUT_POST, 'wcpt-meta-sponsor-info' ), 'edit-sponsor-info' ) ) { - $text_values = array( + $text_values_wcpt = array( 'company_name', 'first_name', 'last_name', @@ -1374,10 +1375,18 @@ public function save_post_sponsor( $post_id, $post ) { 'country', ); - foreach ( $text_values as $id ) { + $text_values_wcb = array( + 'first_time', + ); + + foreach ( $text_values_wcpt as $id ) { $values[ $id ] = sanitize_text_field( filter_input( INPUT_POST, '_wcpt_sponsor_' . $id ) ); } + foreach ( $text_values_wcb as $id ) { + $values[ $id ] = sanitize_text_field( filter_input( INPUT_POST, '_wcb_sponsor_' . $id ) ); + } + if ( empty( $values['state'] ) ) { $values['state'] = $this->get_sponsor_info_state_default_value(); } @@ -1389,7 +1398,9 @@ public function save_post_sponsor( $post_id, $post ) { $values['agreement'] = filter_input( INPUT_POST, '_wcpt_sponsor_agreement', FILTER_SANITIZE_NUMBER_INT ); foreach ( $values as $id => $value ) { - $meta_key = '_wcpt_sponsor_' . $id; + $meta_key = in_array($id, $text_values_wcb, true) + ? '_wcb_sponsor_' . $id + : '_wcpt_sponsor_' . $id; if ( empty( $value ) ) { delete_post_meta( $post_id, $meta_key ); diff --git a/public_html/wp-content/plugins/wcpt/stubs/post/call-for-speakers.php b/public_html/wp-content/plugins/wcpt/stubs/post/call-for-speakers.php index b7e386dcf..2b4962d4b 100644 --- a/public_html/wp-content/plugins/wcpt/stubs/post/call-for-speakers.php +++ b/public_html/wp-content/plugins/wcpt/stubs/post/call-for-speakers.php @@ -9,9 +9,9 @@ - + - + @@ -21,5 +21,7 @@ + + diff --git a/public_html/wp-content/plugins/wcpt/stubs/post/call-for-sponsors.php b/public_html/wp-content/plugins/wcpt/stubs/post/call-for-sponsors.php index 0f45d38e7..10fca42d2 100644 --- a/public_html/wp-content/plugins/wcpt/stubs/post/call-for-sponsors.php +++ b/public_html/wp-content/plugins/wcpt/stubs/post/call-for-sponsors.php @@ -1,3 +1,12 @@ + +

Organizers Note: + Submissions to this form will automatically create draft + Sponsor posts. + You can use those to manage your sponsors, by publishing the ones that you accept, and deleting the ones that you don't. + Changing the name, email, username, or first time sponsoring questions can break the automation, though. +

+ +

Blurb with information for potential sponsors.

@@ -9,7 +18,7 @@ - + @@ -17,5 +26,7 @@ + + diff --git a/public_html/wp-content/plugins/wcpt/stubs/post/call-for-volunteers.php b/public_html/wp-content/plugins/wcpt/stubs/post/call-for-volunteers.php index 94755b102..bb939603b 100644 --- a/public_html/wp-content/plugins/wcpt/stubs/post/call-for-volunteers.php +++ b/public_html/wp-content/plugins/wcpt/stubs/post/call-for-volunteers.php @@ -21,7 +21,7 @@ - + diff --git a/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-new-site.php b/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-new-site.php index f231ee3dd..bc764264d 100644 --- a/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-new-site.php +++ b/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-new-site.php @@ -735,6 +735,9 @@ protected function get_stub_posts( $wordcamp, $meta ) { 'content' => $this->get_stub_content( 'post', 'call-for-sponsors' ), 'status' => 'draft', 'type' => 'post', + 'meta' => array( + 'wcfd-key' => 'call-for-sponsors', + ), ), array( @@ -851,6 +854,9 @@ public static function get_stub_me_sponsors_meta( $assigned_sponsor ) { $sponsor_meta[ "_wcpt_sponsor_$key" ] = get_post_meta( $assigned_sponsor->ID, "mes_$key", true ); } + // Always set the first-time sponsor value to 'no' for Multi Event (ME) Sponsors. + $sponsor_meta['_wcb_sponsor_first_time'] = 'no'; + restore_current_blog(); return $sponsor_meta; diff --git a/public_html/wp-content/plugins/wordcamp-forms-to-drafts/wordcamp-forms-to-drafts.php b/public_html/wp-content/plugins/wordcamp-forms-to-drafts/wordcamp-forms-to-drafts.php index 54e24bf53..50260f96a 100644 --- a/public_html/wp-content/plugins/wordcamp-forms-to-drafts/wordcamp-forms-to-drafts.php +++ b/public_html/wp-content/plugins/wordcamp-forms-to-drafts/wordcamp-forms-to-drafts.php @@ -42,7 +42,7 @@ public function print_front_end_styles() { ?> form_requires_login( $this->get_current_form_id() ) ) { return; } - $deps_path = __DIR__ . '/build/inert.asset.php'; + $deps_path = __DIR__ . '/build/inert.asset.php'; $script_info = require $deps_path; wp_enqueue_script( @@ -472,8 +472,11 @@ protected function create_draft_speaker( $speaker ) { ); if ( $speaker_id ) { + $first_time = strtolower( $speaker['Is this your first time being a speaker at a WordPress event?'] ) ?? ''; + $first_time = in_array( $first_time, array( 'yes', 'no', 'unsure' ), true ) ? $first_time : ''; update_post_meta( $speaker_id, '_wcb_speaker_email', $speaker['Email Address'] ?? '' ); update_post_meta( $speaker_id, '_wcpt_user_id', $this->get_user_id_from_username( $speaker['WordPress.org Username'] ?? '' ) ); + update_post_meta( $speaker_id, '_wcb_speaker_first_time', $first_time ); } return $speaker_id;