Changeset 6765
- Timestamp:
- 02/26/2018 06:38:23 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-forms-to-drafts/wordcamp-forms-to-drafts.php
r3878 r6765 1 1 <?php 2 2 3 /* 3 4 Plugin Name: WordCamp Forms to Drafts … … 8 9 */ 9 10 10 if ( ! defined( 'ABSPATH' ) ) {11 die( 'Access denied.' );12 }13 14 11 /* 15 12 * @todo 16 13 * - Refactor the update_post_meta() loop in each method into a DRY function. 17 14 */ 15 16 if ( ! defined( 'ABSPATH' ) ) { 17 die( 'Access denied.' ); 18 } 18 19 19 20 class WordCamp_Forms_To_Drafts { … … 88 89 ); 89 90 90 // Prevent wpautop() from converting tabs into empty paragraphs in #wcorg-login-message 91 // Prevent wpautop() from converting tabs into empty paragraphs in #wcorg-login-message. 91 92 $please_login_message = trim( str_replace( "\t", '', $please_login_message ) ); 92 93 … … 141 142 142 143 $current_user = wp_get_current_user(); 143 $form_id = get_post_meta( $post->ID, 'wcfd-key', true );144 $form_id = get_post_meta( $post->ID, 'wcfd-key', true ); 144 145 145 146 switch ( $form_id ) { … … 170 171 * @todo submit Jetpack PR to modularize that logic so we can just call it directly instead of duplicating it 171 172 * 172 * @param int $page_id173 * @param int $page_id 173 174 * @param string $label 174 175 * … … 248 249 * Yes, this is an ugly hack. 249 250 * 250 * @param $post_type251 * @param string $post_type 251 252 */ 252 253 protected function simulate_post_type( $post_type ) { … … 286 287 $this->simulate_post_type( 'wordcamp' ); 287 288 288 // Create the post 289 // Create the post. 289 290 $draft_id = wp_insert_post( array( 290 291 'post_type' => 'wcb_sponsor', … … 295 296 ) ); 296 297 297 // Create the post meta 298 // Create the post meta. 298 299 if ( $draft_id ) { 299 300 foreach ( $sponsor_to_form_key_map as $sponsor_key => $form_key ) { … … 356 357 'post_type' => 'wcb_speaker', 357 358 'posts_per_page' => 1, 358 'post_status' => array( 'publish', 'pending', 'draft', 'future', 'private' ), // Trashed speakers are ignored because they'll likely be deleted 359 'post_status' => array( 'publish', 'pending', 'draft', 'future', 'private' ), // Trashed speakers are ignored because they'll likely be deleted. 359 360 360 361 'meta_query' => array( … … 390 391 391 392 if ( $speaker_id ) { 392 update_post_meta( $speaker_id, '_wcb_speaker_email', $speaker[ 'Email Address'] );393 update_post_meta( $speaker_id, '_wcb_speaker_email', $speaker['Email Address'] ); 393 394 update_post_meta( $speaker_id, '_wcpt_user_id', $this->get_user_id_from_username( $speaker['WordPress.org Username'] ) ); 394 395 }
Note: See TracChangeset
for help on using the changeset viewer.