Changeset 8384 for sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-forms-to-drafts/wordcamp-forms-to-drafts.php
- Timestamp:
- 03/01/2019 07:26:16 PM (6 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
r6765 r8384 270 270 * insert custom fields programmatically. 271 271 * - Sideload the logo from submitted URL and set it as the featured image. 272 * - Add a Company Description field to the Call For Sponsors form stub, or populate content from something else? 273 * - Also ensure content is formatted for the block editor. 272 274 * 273 275 * @param int $submission_id … … 379 381 */ 380 382 protected function create_draft_speaker( $speaker ) { 383 $content = $speaker['Your Bio'] ?? ''; 384 385 if ( $content ) { 386 $content = wpautop( $content ); 387 $content = str_replace( '<p>', "<!-- wp:paragraph -->\n<p>", $content ); 388 $content = str_replace( '</p>', "</p>\n<!-- /wp:paragraph -->", $content ); 389 } 390 381 391 $speaker_id = wp_insert_post( 382 392 array( 383 393 'post_type' => 'wcb_speaker', 384 394 'post_title' => $speaker['Name'], 385 'post_content' => $ speaker['Your Bio'],395 'post_content' => $content, 386 396 'post_status' => 'draft', 387 397 'post_author' => $this->get_user_id_from_username( 'wordcamp' ), … … 407 417 */ 408 418 protected function create_draft_session( $session, $speaker ) { 419 $content = $session['Topic Description'] ?? ''; 420 421 if ( $content ) { 422 $content = wpautop( $content ); 423 $content = str_replace( '<p>', "<!-- wp:paragraph -->\n<p>", $content ); 424 $content = str_replace( '</p>', "</p>\n<!-- /wp:paragraph -->", $content ); 425 } 426 409 427 $session_id = wp_insert_post( 410 428 array( 411 429 'post_type' => 'wcb_session', 412 430 'post_title' => $session['Topic Title'], 413 'post_content' => $ session['Topic Description'],431 'post_content' => $content, 414 432 'post_status' => 'draft', 415 433 'post_author' => $this->get_user_id_from_username( $session['WordPress.org Username'] ),
Note: See TracChangeset
for help on using the changeset viewer.