mattweber / solr-for-wordpress

A WordPress plugin that replaces the default WordPress search with Solr
85 stars 36 forks source link

updated template loading #33

Closed nullvariable closed 12 years ago

nullvariable commented 12 years ago

I adjusted the template loading feature located on line 1253 to use the WordPress locate_template function instead of the TEMPLATEPATH constant as locate_template supports child themes, where the TEMPLATE path constant does not. This allows for a BuddyPress site to use the normal theme structure of a child theme instead of needing to place a template file in the BuddyPress plugin directory. This would also affect anyone building a child theme of the standard WordPress themes and certain frameworks etc.

Example: output of TEMPLATEPATH in a BuddyPress site would be similar to:

/var/www/wp-content/plugins/buddypress/bp-themes/bp-default

Where in most cases a theme developer would be building a theme sourced from

/var/www/wp-content/themes/my-cool-theme

Thanks! Updated with proper true/false value in second call to "locate_template"

nullvariable commented 12 years ago

in my eagerness to push this I also left off .php from s4w_search.

shaksi commented 12 years ago

Nice, catch... we might need to do some code refactoring to make good use WP 3.3 goodness Thanks