Making WordPress.org


Ignore:
Timestamp:
05/15/2015 11:36:41 PM (11 years ago)
Author:
iandunn
Message:

WordCamp Post Type: Return early when saving other post types.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-admin.php

    r1587 r1588  
    567567     */
    568568    public function require_complete_meta_to_publish_wordcamp( $post_data, $post_data_raw ) {
     569        if ( WCPT_POST_TYPE_ID != $post_data['post_type'] ) {
     570            return $post_data;
     571        }
     572
    569573        // The ID of the last site that was created before this rule went into effect, so that we don't apply the rule retroactively.
    570574        $min_site_id = apply_filters( 'wcpt_require_complete_meta_min_site_id', '2416297' );
     
    594598
    595599        // Check pending posts
    596         // todo return early if not wordcamp post type instead of checking in both of these conditions
    597         if ( WCPT_POST_TYPE_ID == $post_data['post_type'] && 'pending' == $post_data['post_status'] && absint( $_POST['post_ID'] ) > $min_site_id ) {
     600        if ( 'pending' == $post_data['post_status'] && absint( $_POST['post_ID'] ) > $min_site_id ) {
    598601            foreach( $required_pending_fields as $field ) {
    599602                $value = $_POST[ wcpt_key_to_str( $field, 'wcpt_' ) ];
     
    608611
    609612        // Check published posts
    610         if ( WCPT_POST_TYPE_ID == $post_data['post_type'] && 'publish' == $post_data['post_status'] && isset( $_POST['post_ID'] ) && absint( $_POST['post_ID'] ) > $min_site_id ) {
     613        if ( 'publish' == $post_data['post_status'] && isset( $_POST['post_ID'] ) && absint( $_POST['post_ID'] ) > $min_site_id ) {
    611614            foreach( $required_publish_fields as $field ) {
    612615                $value = $_POST[ wcpt_key_to_str( $field, 'wcpt_' ) ];
Note: See TracChangeset for help on using the changeset viewer.