Changeset 2962
- Timestamp:
- 04/15/2016 01:50:06 PM (9 years ago)
- Location:
- sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-admin.php
r2898 r2962 59 59 function metabox () { 60 60 do_action( 'wcpt_metabox' ); 61 }62 63 /**64 * metabox_save ()65 *66 * Pass the metabox values before saving67 *68 * @param int $post_id69 * @return int70 */71 function metabox_save ( $post_id ) {72 if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )73 return $post_id;74 75 if ( !current_user_can( 'edit_post', $post_id ) )76 return $post_id;77 78 do_action( 'wcpt_metabox_save' );79 61 } 80 62 … … 189 171 } 190 172 endif; // class_exists check 191 192 ?> -
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-admin.php
r2912 r2962 206 206 } 207 207 } 208 209 do_action( 'wcpt_metabox_save_done', $post_id ); 208 210 209 211 $this->validate_and_add_note( $post_id ); -
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-new-site.php
r2898 r2962 12 12 add_action( 'wcpt_metabox_value', array( $this, 'render_site_url_field' ), 10, 3 ); 13 13 add_action( 'wcpt_metabox_save', array( $this, 'save_site_url_field' ), 10, 3 ); 14 add_action( 'wcpt_metabox_save_done', array( $this, 'maybe_create_new_site' ), 10, 1 ); 14 15 } 15 16 … … 72 73 73 74 if ( 'URL' == $key && 'wc-url' == $field_type && isset( $_POST[ $field_name ] ) ) { 74 // todo use https instead of http75 75 $url = strtolower( substr( $_POST[ $field_name ], 0, 4 ) ) == 'http' ? $_POST[ $field_name ] : 'http://' . $_POST[ $field_name ]; 76 76 $url = set_url_scheme( esc_url_raw( $url ), 'https' ); 77 77 update_post_meta( $wordcamp_id, $key, esc_url( $url ) ); 78 79 if ( isset( $_POST[ wcpt_key_to_str( 'create-site-in-network', 'wcpt_' ) ] ) && ! empty( $url ) ) { 80 $this->create_new_site( $wordcamp_id, $url ); 81 } 82 } 83 } 84 85 86 /** 87 * Create a new site in the network 78 } 79 } 80 81 82 /** 83 * Maybe create a new site in the network 88 84 * 89 85 * @param int $wordcamp_id 90 * @param string $url 91 */ 92 protected function create_new_site( $wordcamp_id, $url ) { 86 */ 87 protected function maybe_create_new_site( $wordcamp_id ) { 93 88 if ( ! current_user_can( 'manage_sites' ) ) { 94 89 return; … … 97 92 // The sponsor region is required so we can import the relevant sponsors and levels 98 93 if ( ! get_post_meta( $wordcamp_id, 'Multi-Event Sponsor Region', true ) ) { 94 return; 95 } 96 97 $url = get_post_meta( $wordcamp_id, 'URL', true ); 98 if ( ! isset( $_POST[ wcpt_key_to_str( 'create-site-in-network', 'wcpt_' ) ] ) || empty( $url ) ) { 99 99 return; 100 100 } … … 372 372 'content' => 373 373 '<p>' . __( "<em>Organizers note:</em> Upload photos to this page and they'll automagically appear in a slideshow!", 'wordcamporg' ) . '</p> ' . 374 374 '<p>[slideshow]</p>', 375 375 'status' => 'draft', 376 376 'type' => 'page', … … 459 459 array( 460 460 'title' => __( 'Call for Sponsors', 'wordcamporg' ), 461 'content' => 461 'content' => 462 462 '<p>' . __( '<em>Organizers note:</em> Make sure you update the "to" address and other fields before publishing this page!', 'wordcamporg' ) . '</p> ' . 463 463 '<p>' . __( 'Blurb with information for potential sponsors.', 'wordcamporg' ) . '</p> ' . … … 489 489 array( 490 490 'title' => __( 'Call for Speakers', 'wordcamporg' ), 491 'content' => 491 'content' => 492 492 '<p>' . __( '<em>Organizers note:</em> Submissions to this form will automatically create draft posts for the Speaker and Session post types. Feel free to customize the form, but deleting or renaming the following fields will break the automation: Name, Email, WordPress.org Username, Your Bio, Session Title, Session Description.', 'wordcamporg' ) . '</p>' . 493 493 '<p>' . __( "If you'd like to propose multiple topics, please submit the form multiple times, once for each topic. [Other speaker instructions/info goes here.]", 'wordcamporg' ) . '</p>' . … … 524 524 array( 525 525 'title' => __( 'Call for Volunteers', 'wordcamporg' ), 526 'content' => 526 'content' => 527 527 '<p>' . __( '<em>Organizers note:</em> Make sure you update the "to" address and other fields before publishing this page!', 'wordcamporg' ) . '</p> ' . 528 528 '<p>' . __( 'Blurb with information for potential volunteers.', 'wordcamporg' ) . '</p> ' .
Note: See TracChangeset
for help on using the changeset viewer.