• Resolved JP3

    (@jp3)


    With the plugin activated, the following messages are showing up in my debug log.

    PHP Deprecated: Hook block_categories is deprecated since version 5.8.0! Use block_categories_all instead. in /path/to/wp-includes/functions.php on line 5754
    PHP Deprecated: Hook block_categories is deprecated since version 5.8.0! Use block_categories_all instead. in /path/to/wp-includes/functions.php on line 5754

    Fixed it with this:
    /path/to/wp-content/plugins/block-for-font-awesome/block-for-font-awesome.php
    line 103
    add_filter( 'block_categories', 'getbutterfly_block_categories', 10, 2 );

    change to:

    if ( version_compare( get_bloginfo( 'version' ), '5.8', '>=' ) ) {
        add_filter(
            'block_categories_all',
            'getbutterfly_block_categories',
            10,
            2
        );
    } else {
        add_filter(
            'block_categories',
            'getbutterfly_block_categories',
            10,
            2
        );
    }

    Hope to see an update soon ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter JP3

    (@jp3)

    Looked at my code for a few minutes and wasn’t happy with it. Too long. I turned your 1-liner into a 15-liner ??

    Here’s a 1-liner instead:
    add_filter( 'block_categories'.( ( version_compare( get_bloginfo( 'version' ), '5.8', '>=' ) ) ? '_all' : '' ), 'getbutterfly_block_categories', 10, 2 );

    Marking as solved.

    Plugin Author Ciprian

    (@butterflymedia)

    Thanks for the code. I have updated the plugin and made the block_categories_all default. I have also increased the WordPress version requirement to 5.8+.

    The block editor is making some huge jumps, and it’s not worth maintaining 2 versions. The next release of this plugin will include some WordPress 5.9 changes to the colour picker, so it will make version below 5.8 irrelevant anyway.

    Thanks again!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP Deprecated : Hook block_categories’ is closed to new replies.