Making WordPress.org

Ticket #1084: 1084.diff

File 1084.diff, 2.5 KB (added by kovshenin, 10 years ago)
  • inc/back-compat.php

     
    2222                // Initialize only if theme requires.
    2323                if ( in_array( $this->stylesheet, $compat_themes ) || in_array( $this->template, $compat_themes ) ) {
    2424                        $old_site_id         = get_current_blog_id() <= apply_filters( 'wcb_back_compat_max_site_id', 528 );
    25                         $old_site_exceptions = array( 465, 496, 514, 518 ); // denver.wordcamp.org/2015, seattle.wordcamp.org/2015-experienced, montreal.wordcamp.org/2015, montreal.wordcamp.org/2015-fr
     25                        $old_site_exceptions = array( 465, 496, 514, 518, 504 ); // denver.wordcamp.org/2015, seattle.wordcamp.org/2015-experienced, montreal.wordcamp.org/2015, montreal.wordcamp.org/2015-fr, europe.wordcamp.org/2015
    2626                        $old_site_excepted   = in_array( get_current_blog_id(), apply_filters( 'wcb_back_compat_site_id_exceptions', $old_site_exceptions ) );
    2727
    2828                        // Substitute back-compat shortcodes on older sites, but let new sites use the real ones
  • wc-post-types.php

     
    5454                add_filter( 'the_content', array( $this, 'add_session_info_to_speaker_posts' ) );
    5555
    5656                add_filter( 'dashboard_glance_items', array( $this, 'glance_items' ) );
     57                add_filter( 'option_default_comment_status', array( $this, 'default_comment_ping_status' ) );
     58                add_filter( 'option_default_ping_status', array( $this, 'default_comment_ping_status' ) );
    5759        }
    5860
    5961        function init() {
     
    17121714                register_post_type( 'wcb_speaker', array(
    17131715                        'labels'            => $labels,
    17141716                        'rewrite'           => array( 'slug' => 'speaker', 'with_front' => true ),
    1715                         'supports'          => array( 'title', 'editor', 'revisions' ),
     1717                        'supports'          => array( 'title', 'editor', 'revisions', 'comments' ),
    17161718                        'menu_position'     => 20,
    17171719                        'public'            => true,
    17181720                        'show_ui'           => true,
     
    20332035
    20342036                return $items;
    20352037        }
     2038
     2039        /**
     2040         * Comments and pings on speakers closed by default.
     2041         *
     2042         * @param string $status Default comment status.
     2043         * @return string Resulting status.
     2044         */
     2045        public function default_comment_ping_status( $status ) {
     2046                $screen = get_current_screen();
     2047                if ( ! empty( $screen->post_type ) && $screen->post_type == 'wcb_speaker' )
     2048                        $status = 'closed';
     2049
     2050                return $status;
     2051        }
    20362052}
    20372053
    20382054// Load the plugin class.