WordPress.org

Making WordPress.org

Ticket #3740: 3740.diff

File 3740.diff, 1.2 KB (added by sippis, 15 months ago)
  • wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-event/class-event-loader.php

    diff --git wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-event/class-event-loader.php wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-event/class-event-loader.php
    index dd6980cf5..3b8ac3faf 100644
    abstract class Event_Loader { 
    8181         * @param WP_Query $query
    8282         */
    8383        public function query_public_statuses_on_archives( $query ) {
    84                 if ( ! $query->is_post_type_archive( WCPT_POST_TYPE_ID ) ) {
     84                // Bail if dashboard.
     85                if ( is_admin() ) {
    8586                        return;
    8687                }
    8788
    88                 if ( is_admin() ) {
     89                // Bail if post type is something other than WordCamp
     90                if (
     91                        ! $query->is_post_type_archive( WCPT_POST_TYPE_ID ) &&
     92                        // for some reason $query->is_singular throws a notice, so lets do it this way
     93                        ! ( isset( $query->query_vars['post_type'] ) && WCPT_POST_TYPE_ID === $query->query_vars['post_type'] )
     94                ) {
    8995                        return;
    9096                }
    9197
    abstract class Event_Loader { 
    94100                        $query->set( 'orderby', 'menu_order date' );
    95101                }
    96102
     103                // Bail if performing a query which already has a post_status
    97104                if ( ! empty( $query->query_vars['post_status'] ) ) {
    98105                        return;
    99106                }