• Resolved nimmolo

    (@nimmolo)


    Hi Tobias,

    I was getting an error disabling default css with the recommended function. It was not causing me any problems, just thought you might like to check it out.

    The reason was that I had disabled default css for tablepress in my theme’s functions.php like this:
    add_filter( 'tablepress_use_default_css', false );

    When I changed to:

    add_filter( 'tablepress_use_default_css', 'mytheme_filter_tablepress_css' );
    function mytheme_filter_tablepress_css() {
      return false;
    }
    

    the error disappeared.

    reported by john blackbourn’s debugging plugin Query Monitor:

    PHP Error
    Warning: call_user_func_array() expects parameter 1 to be a valid callback, no array or string given
    
    Location
    wp-includes/class-wp-hook.php:298
    
    Call Stack
    apply_filters('tablepress_use_default_css')
    wp-content/plugins/tablepress/controllers/controller-frontend.php:46
    TablePress_Frontend_Controller->__construct()
    wp-content/plugins/tablepress/classes/class-tablepress.php:208
    TablePress::load_class()
    wp-content/plugins/tablepress/classes/class-tablepress.php:261
    TablePress::load_controller()
    wp-content/plugins/tablepress/classes/class-tablepress.php:156
    TablePress::run()
    wp-includes/class-wp-hook.php:298
    do_action('init')
    wp-settings.php:449
    
    Plugin: tablepress
    • This topic was modified 9 years, 1 month ago by nimmolo.
    • This topic was modified 9 years, 1 month ago by nimmolo. Reason: solved
    • This topic was modified 9 years, 1 month ago by nimmolo. Reason: clarity
Viewing 1 replies (of 1 total)
  • Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    This is actually an error in your line of code. The second parameter of the add_filter function requires a string/callback function.
    The proper line would be

    add_filter( 'tablepress_use_default_css', '__return_false' );
    

    (__return_false() is a WordPress function that is basically the same as your function.)

    Regards,
    Tobias

Viewing 1 replies (of 1 total)

The topic ‘preferred method of removing default css’ is closed to new replies.