Skip to:
Content

BuddyPress.org

Ticket #8528: 8528.patch

File 8528.patch, 902 bytes (added by imath, 5 years ago)
  • src/bp-templates/bp-nouveau/includes/functions.php

    diff --git src/bp-templates/bp-nouveau/includes/functions.php src/bp-templates/bp-nouveau/includes/functions.php
    index a06b20187..3d85eace9 100644
    add_filter( 'bp_core_block_globals', 'bp_nouveau_register_core_block_globals', 1 
    15521552 * @since 9.0.0
    15531553 */
    15541554function bp_nouveau_unregister_blocks_for_post_context() {
    1555         unregister_block_type( 'bp/primary-nav' );
     1555        if ( ! function_exists( 'unregister_block_type' ) ) {
     1556                return;
     1557        }
     1558
     1559        $is_registered = WP_Block_Type_Registry::get_instance()->is_registered( 'bp/primary-nav' );
     1560
     1561        if ( $is_registered ) {
     1562                unregister_block_type( 'bp/primary-nav' );
     1563        }
    15561564}
    15571565add_action( 'load-post.php', 'bp_nouveau_unregister_blocks_for_post_context' );
    15581566add_action( 'load-post-new.php', 'bp_nouveau_unregister_blocks_for_post_context' );