• Resolved daymobrew

    (@daymobrew)


    I have a CPT that I do not want to be translated.

    I have a page with a custom shortcode that does a WP_Query of the CPT.
    I have 3 languages and get the following warning 3 times:

    Warning: call_user_func() expects parameter 1 to be a valid callback, class 'PLL_Model' does not have a method 'get__language' in /home/f564334/public_html/wp-content/plugins/polylang/include/model.php on line 401

    My code: https://pastebin.com/UsmFLi6h
    I am using Advanced Custom Fields plugin for meta data.

    I tried using the pll_get_post_types but don’t know what it should be doing:

    add_filter('pll_get_post_types', 'ff_add_cpt_to_pll', 10, 2);
    function ff_add_cpt_to_pll($post_types, $hide) {
        if ($hide)
            // hides 'my_cpt' from the list of custom post types in Polylang settings
            unset($post_types['fastforests_status']);
        else
            // enables language and translation management for 'my_cpt'
            $post_types['fastforests_status'] = 'fastforests_status';
        return $post_types;
    }

    https://www.ads-software.com/plugins/polylang/

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘PLL_Model does not have method get__language warning’ is closed to new replies.