search Archives - Justin Silver https://www.justinsilver.com/tag/search/ Technology, Travel, and Pictures Tue, 19 Apr 2016 18:29:30 +0000 en-US hourly 1 https://wordpress.org/?v=6.0.1 https://www.justinsilver.com/wp-content/uploads/2013/06/cropped-apple-touch-icon-160x160.png search Archives - Justin Silver https://www.justinsilver.com/tag/search/ 32 32 Buddypress + WordPress Search https://www.justinsilver.com/technology/wordpress/buddypress-wordpress-search/?utm_source=rss&utm_medium=rss&utm_campaign=buddypress-wordpress-search https://www.justinsilver.com/technology/wordpress/buddypress-wordpress-search/#respond Tue, 24 Jul 2012 21:22:55 +0000 http://justin.ag/?p=2521 Buddypress steals the WordPress /search slug which means you are limited to ugly permalinks for search. Going to /search would just redirect to the home page with Buddypress installed. After searching the Buddypress code...

The post Buddypress + WordPress Search appeared first on Justin Silver.

]]>
AmpedSense.OptimizeAdSpot('AP'); AmpedSense.OptimizeAdSpot('IL'); AmpedSense.OptimizeAdSpot('IR');

Buddypress steals the WordPress /search slug which means you are limited to ugly permalinks for search. Going to /search would just redirect to the home page with Buddypress installed. After searching the Buddypress code I found this in bp-core-catchuri.php:

// Search doesn't have an associated page, so we check for it separately
if ( !empty( $bp_uri[0] ) && ( bp_get_search_slug() == $bp_uri[0] ) ) {
	$matches[]   = 1;
	$match       = new stdClass;
	$match->key  = 'search';
	$match->slug = bp_get_search_slug();
}

Since this only executes when the page matches the slug, let’s see how it gets the bp_get_search_slug() in bp-core-template.php:

function bp_get_search_slug() {
	return apply_filters( 'bp_get_search_slug', BP_SEARCH_SLUG );
}

Show how is the BP_SEARCH_SLUG defined in bp-loader.php:

// The search slug has to be defined nice and early because of the way search requests are loaded
if ( !defined( 'BP_SEARCH_SLUG' ) )
	define( 'BP_SEARCH_SLUG', 'search' );

The post Buddypress + WordPress Search appeared first on Justin Silver.

]]>
https://www.justinsilver.com/technology/wordpress/buddypress-wordpress-search/feed/ 0