mercredi 8 juin 2016

WordPress plugin document title parts not working

I have a wordpress plugin that uses add_filter to change the title of the page. In an empty wordpress website it just works fine. But I have two other websites where I want to use my plugin, but for some reason there it will not work at all.

function hooks() {
    if(get_query_var('car_id') != "") {
        add_action('wp_head', 'fillHead');
        add_filter('document_title_parts', 'addTitle', PHP_INT_MAX);
    }
    add_shortcode('auto', 'showCar');
}

I tried to deactivate some plugins and the theme etc. But nothing seems to work. I don't know where the title is changed. Is there a way to see what is happening in wp_head() or why this code is not executed at the right time?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire