imath / wp-idea-stream

Share ideas, great ones will rise to the top!
GNU General Public License v2.0
27 stars 5 forks source link

Filters load before themes functions.php making it imposible to change template dir #60

Closed jakobholmelund closed 7 years ago

jakobholmelund commented 8 years ago

In the source the following line

    // Default templates location (can be overridden from theme or child theme)
        $this->templates_dir = apply_filters( 'wp_idea_stream_templates_dir_path', trailingslashit( $this->plugin_dir . 'templates'  ) );

States that you can overwrite the template dir.. But this is not true since this line is loaded on plugin init and thus long before functions.php in the theme folder..

function test($example){
  return get_stylesheet_directory() . '/wp-idea-stream/templates/';
}
add_filter( 'wp_idea_stream_templates_dir_path', 'test' , 10, 1 );
imath commented 7 years ago

Actually, the theme directory is always checked without filtering this.

You just need to make sure your templates are in a wp-idea-stream folder of your theme.