diff --git a/themes/10up-theme/functions.php b/themes/10up-theme/functions.php index 72cb6b4..718669a 100755 --- a/themes/10up-theme/functions.php +++ b/themes/10up-theme/functions.php @@ -39,13 +39,3 @@ if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) { require_once __DIR__ . '/vendor/autoload.php'; } - -if ( ! function_exists( 'wp_body_open' ) ) { - - /** - * Shim for the new wp_body_open() function that was added in 5.2 - */ - function wp_body_open() { - do_action( 'wp_body_open' ); - } -} diff --git a/themes/10up-theme/includes/blocks.php b/themes/10up-theme/includes/blocks.php index 699d8b9..2d16ec4 100644 --- a/themes/10up-theme/includes/blocks.php +++ b/themes/10up-theme/includes/blocks.php @@ -20,22 +20,8 @@ function setup() { }; add_action( 'enqueue_block_editor_assets', $n( 'blocks_editor_styles' ) ); - add_action( 'init', $n( 'register_theme_blocks' ) ); - add_action( 'init', $n( 'register_block_pattern_categories' ) ); - - /* - If you are using the block library, remove the blocks you don't need. - - add_filter( 'tenup_available_blocks', function ( $blocks ) { - if ( ! empty( $blocks['integrated-hero'] ) ) { - unset( $blocks['integrated-hero'] ); - } - - return $blocks; - } ); - */ } /** @@ -44,15 +30,6 @@ function setup() { * @return void */ function register_theme_blocks() { - global $wp_version; - - $is_pre_wp_6 = version_compare( $wp_version, '6.0', '<' ); - - if ( $is_pre_wp_6 ) { - // Filter the plugins URL to allow us to have blocks in themes with linked assets. i.e editorScripts - add_filter( 'plugins_url', __NAMESPACE__ . '\filter_plugins_url', 10, 2 ); - } - // Register all the blocks in the theme if ( file_exists( TENUP_THEME_BLOCK_DIST_DIR ) ) { $block_json_files = glob( TENUP_THEME_BLOCK_DIST_DIR . '*/block.json' ); @@ -83,27 +60,8 @@ function register_theme_blocks() { register_block_type_from_metadata( $block_folder, $block_options ); } } - - if ( $is_pre_wp_6 ) { - // Remove the filter after we register the blocks - remove_filter( 'plugins_url', __NAMESPACE__ . '\filter_plugins_url', 10, 2 ); - } } -/** - * Filter the plugins_url to allow us to use assets from theme. - * - * @param string $url The plugins url - * @param string $path The path to the asset. - * - * @return string The overridden url to the block asset. - */ -function filter_plugins_url( $url, $path ) { - $file = preg_replace( '/\.\.\//', '', $path ); - return trailingslashit( get_stylesheet_directory_uri() ) . $file; -} - - /** * Enqueue editor-only JavaScript/CSS for blocks. *