Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return early if edit post screen #2831

Merged
merged 4 commits into from
Jun 20, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Return early if edit post screen
  • Loading branch information
oscarssanchez committed Jun 7, 2022
commit f684033ab8a1fd719ddafa3905fa85bf8b25fae5
7 changes: 7 additions & 0 deletions includes/classes/Feature/Facets/Facets.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ public function __construct() {
* @since 2.5
*/
public function setup() {
global $pagenow;

// This feature should not run while in the editor.
if ( 'post-new.php' === $pagenow || 'post.php' === $pagenow ) {
return;
}

add_action( 'widgets_init', [ $this, 'register_widgets' ] );
add_action( 'ep_valid_response', [ $this, 'get_aggs' ], 10, 4 );
add_filter( 'ep_post_formatted_args', [ $this, 'set_agg_filters' ], 10, 3 );
Expand Down