• WP: 4.1.1
    SimpleMap: 2.4.7

    On line 164 of options-general.php I think the call should be:

    $themes2 = apply_filters( 'sm-general-options-themes2', $themes2 );

    i.e. the filter name should be sm-general-options-themes2, so I can filter ONLY custom css template names.
    Currently, if I add a filter like this to my functions.php file:

    add_filter('sm-general-options-themes1','look_for_custom_css_in_theme_folder');
    function look_for_custom_css_in_theme_folder($themes){
    	if ( file_exists( STYLESHEETPATH . '/simplemap-styles' ) )
    		$theme = SM_Options::read_styles( STYLESHEETPATH . '/simplemap-styles' );
    	$themes = array_merge($themes,$theme);
    	return $themes;
    }

    to look for custom templates files in my theme folder, I’m adding my custom template names to both default AND custom themes.

    suggestion: it could be more dev-friendly to call the filter something like
    sm-general-options-custom-themes

    https://wordpress.org/plugins/simplemap/

Viewing 1 replies (of 1 total)
  • Thread Starter Mad Max

    (@mad_max)

    Actually, when it comes to load the custom template file, simplemap loads it from plugins_url() folder, so the filter in my code above is useless.
    Well, I think WP_PLUGIN_DIR should be replaced with STYLESHEETPATH so users can add custom templates under their theme folder (it seems more logical to me).

Viewing 1 replies (of 1 total)
  • The topic ‘typo on apply filters for custom css files’ is closed to new replies.