Changeset 761 for sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-admin.php
- Timestamp:
- 07/25/2014 12:24:11 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-admin.php
r759 r761 502 502 503 503 /** 504 * Prevent WordCamp posts from being published until all the required fields are completed.504 * Prevent WordCamp posts from being set to pending or published until all the required fields are completed. 505 505 * 506 506 * @param array $post_data … … 512 512 $min_site_id = apply_filters( 'wcpt_require_complete_meta_min_site_id', '2416297' ); 513 513 514 $required_fields = array( 514 $required_pending_fields = array( 'E-mail Address' ); 515 516 $required_publish_fields = array( 515 517 // WordCamp 516 518 'Start Date (YYYY-mm-dd)', … … 539 541 ); 540 542 543 // Check pending posts 544 if ( WCPT_POST_TYPE_ID == $post_data['post_type'] && 'pending' == $post_data['post_status'] && absint( $_POST['post_ID'] ) > $min_site_id ) { 545 foreach( $required_pending_fields as $field ) { 546 $value = $_POST[ wcpt_key_to_str( $field, 'wcpt_' ) ]; 547 548 if ( empty( $value ) || 'null' == $value ) { 549 $post_data['post_status'] = 'draft'; 550 $this->active_admin_notices[] = 3; 551 break; 552 } 553 } 554 } 555 556 // Check published posts 541 557 if ( WCPT_POST_TYPE_ID == $post_data['post_type'] && 'publish' == $post_data['post_status'] && absint( $_POST['post_ID'] ) > $min_site_id ) { 542 foreach( $required_ fields as $field ) {558 foreach( $required_publish_fields as $field ) { 543 559 $value = $_POST[ wcpt_key_to_str( $field, 'wcpt_' ) ]; 544 560 … … 609 625 $post->post_status 610 626 ) 627 ), 628 629 3 => array( 630 'type' => 'error', 631 'notice' => __( 'This WordCamp cannot be set to pending until all of its required metadata is filled in.', 'wordcamporg' ), 611 632 ), 612 633 );
Note: See TracChangeset
for help on using the changeset viewer.