Making WordPress.org

Ticket #1403: 1403.diff

File 1403.diff, 4.1 KB (added by obenland, 7 years ago)
  • wp-content/plugins/wc-post-types/inc/back-compat.php

     
    2121
    2222                // Initialize only if theme requires.
    2323                if ( in_array( $this->stylesheet, $compat_themes ) || in_array( $this->template, $compat_themes ) ) {
    24                         $old_site_id         = get_current_blog_id() <= apply_filters( 'wcb_back_compat_max_site_id', 528 );
    25                         $old_site_exceptions = array(
    26                                 450, // switzerland.wordcamp.org/2015
    27                                 465, // denver.wordcamp.org/2015
    28                                 484, // la.wordcamp.org/2015
    29                                 496, // seattle.wordcamp.org/2015-experienced
    30                                 514, // montreal.wordcamp.org/2015
    31                                 518, // montreal.wordcamp.org/2015-fr
    32                                 504, // europe.wordcamp.org/2015
    33                         );
    34                         $old_site_excepted   = in_array( get_current_blog_id(), apply_filters( 'wcb_back_compat_site_id_exceptions', $old_site_exceptions ) );
    3524
    3625                        // Substitute back-compat shortcodes on older sites, but let new sites use the real ones
    37                         if ( $old_site_id && ! $old_site_excepted ) {
     26                        if ( wcorg_skip_feature( 'back_compat' ) && ! wcorg_skip_feature( 'back_compat_exceptions' ) ) {
    3827                                add_action( 'wcpt_back_compat_init', array( $this, 'wcpt_back_compat_init' ) );
    3928                        }
    4029                }
  • wp-content/plugins/wc-post-types/wc-post-types.php

     
    12371237                        return $content;
    12381238                }
    12391239
    1240                 $site_id = get_current_blog_id();
    1241                 if ( $site_id <= apply_filters( 'wcpt_speaker_post_avatar_min_site_id', 463 ) && ! in_array( $site_id, $enabled_site_ids ) ) {
     1240                if ( wcorg_skip_feature( 'speaker_post_avatar' ) && ! in_array( get_current_blog_id(), $enabled_site_ids ) ) {
    12421241                        return $content;
    12431242                }
    12441243
     
    12651264                        return $content;
    12661265                }
    12671266
    1268                 $site_id = get_current_blog_id();
    1269                 if ( $site_id <= apply_filters( 'wcpt_session_post_speaker_info_min_site_id', 463 ) && ! in_array( $site_id, $enabled_site_ids ) ) {
     1267                if ( wcorg_skip_feature( 'session_post_speaker_info' ) && ! in_array( get_current_blog_id(), $enabled_site_ids ) ) {
    12701268                        return $content;
    12711269                }
    12721270
     
    14621460                        return $content;
    14631461                }
    14641462
    1465                 $site_id = get_current_blog_id();
    1466                 if ( $site_id <= apply_filters( 'wcpt_speaker_post_session_info_min_site_id', 463 ) && ! in_array( $site_id, $enabled_site_ids ) ) {
     1463                if ( wcorg_skip_feature( 'speaker_post_session_info' ) && ! in_array( get_current_blog_id(), $enabled_site_ids ) ) {
    14671464                        return $content;
    14681465                }
    14691466
  • wp-content/plugins/wcpt/wcpt-wordcamp/wordcamp-admin.php

     
    873873                        return $post_data;
    874874                }
    875875
    876                 // The ID of the last site that was created before this rule went into effect, so that we don't apply the rule retroactively.
    877                 $min_site_id = apply_filters( 'wcpt_require_complete_meta_min_site_id', '2416297' );
     876                $require_complete_meta = ! wcorg_skip_feature( 'require_complete_meta' );
    878877
    879878                $required_needs_site_fields = $this->get_required_fields( 'needs-site' );
    880879                $required_scheduled_fields  = $this->get_required_fields( 'scheduled' );
    881880
    882881                // Check pending posts
    883                 if ( 'wcpt-needs-site' == $post_data['post_status'] && absint( $_POST['post_ID'] ) > $min_site_id ) {
     882                if ( 'wcpt-needs-site' == $post_data['post_status'] && $require_complete_meta ) {
    884883                        foreach( $required_needs_site_fields as $field ) {
    885884                                $value = $_POST[ wcpt_key_to_str( $field, 'wcpt_' ) ];
    886885
     
    893892                }
    894893
    895894                // Check published posts
    896                 if ( 'wcpt-scheduled' == $post_data['post_status'] && isset( $_POST['post_ID'] ) && absint( $_POST['post_ID'] ) > $min_site_id ) {
     895                if ( 'wcpt-scheduled' == $post_data['post_status'] && $require_complete_meta ) {
    897896                        foreach( $required_scheduled_fields as $field ) {
    898897                                $value = $_POST[ wcpt_key_to_str( $field, 'wcpt_' ) ];
    899898