cftp / facetious

Facetious lets you add a faceted - often called an 'advanced' - search form to your WordPress website.
23 stars 9 forks source link

Enabling Buddy Press breaks Facetious Search #23

Open digitalchild opened 10 years ago

digitalchild commented 10 years ago

Hello,

After enabling buddy press on one of my sites the facetious search stops working.

WP 3.9.1 BuddyPRess 2.0.1 Facetious Search 1.1.4

Using the widgets or short codes and hit search, I see the URL changes to the facetious parameters for a second then its redirected back to the home page.

I also posted this to the WP support forum for the plugin.

digitalchild commented 10 years ago

On top of this, disabling Facetious search with buddy press enabled and search starts working again.

digitalchild commented 10 years ago

After some digging I've found it is because buddy press overrides the search slug so the code in facetious to make nice URLs gets overridden by BuddyPress.

If you override the buddypress search slug with the following at the top of your functions.php facetious starts working again.



Line 273 of facetious.php is where it breaks. 
$this->search_base = apply_filters( 'facetious_search_base', $wp_rewrite->search_base ); 

I hope this helps. 
digitalchild commented 10 years ago

It appears that apply filter is not firing at the right time.

Putting the following into your wp-config file works.

define( 'BP_SEARCH_SLUG', 'someotherslug' );

simonwheatley commented 10 years ago

Nice writeup by @digitalchild with more detail: https://digitalchild.info/buddypress-wordpress-search/

@digitalchild We're not working with BuddyPress right now, so it's unlikely we'll look into this issue soon, but thank you for chasing down the issue, and posting your thoughts and a workaround.