WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: The Events Calendar] posts_where filter in wp-admin conflicts w/ other plugins (1 post)

  1. kevinB
    Member
    Posted 3 years ago #

    Based on inline comments, the posts_where filtering applied by The_Events_Calendar::events_search_where is "for standard wordpress templates." However, it is also applied to the "Edit Posts" listing in wp-admin, and breaks at least one plugin (Role Scoper) there.

    In my trial, I achieved a workaround by changing code as follows in the-events-calendar.class.php:

    add_filter( 'posts_join', array( $this, 'events_search_join' ) );
    add_filter( 'posts_where', array( $this, 'events_search_where' ) );
    add_filter( 'posts_orderby',array( $this, 'events_search_orderby' ) );
    add_filter( 'posts_fields',	array( $this, 'events_search_fields' ) );
    add_filter( 'post_limits', array( $this, 'events_search_limits' ) );

    to:

    if( ! is_admin() ) {
      add_filter( 'posts_join',	array( $this, 'events_search_join' ) );
      add_filter( 'posts_where', array( $this, 'events_search_where' ) );
      add_filter( 'posts_orderby',array( $this, 'events_search_orderby' ) );
      add_filter( 'posts_fields', array( $this, 'events_search_fields' ) );
      add_filter( 'post_limits', array( $this, 'events_search_limits' ) );
    }

    Can you confirm that's a harmless change, and if so roll it into your trunk?

Topic Closed

This topic has been closed to new replies.

About this Topic