Consider supporting my work by purchasing the course this tutorial is a part of i.e. VSCode Power User →
- Make sure your
Local by FlyWheel
WordPress install is a custom install
port { registerBlockExtension } from '@10up/block-components'; | |
import { useSelect } from '@wordpress/data'; | |
import { store as editorStore } from '@wordpress/editor'; | |
import { InspectorControls } from '@wordpress/block-editor'; | |
import { useState, useEffect } from '@wordpress/element'; | |
import { addFilter } from '@wordpress/hooks'; | |
import { createHigherOrderComponent } from '@wordpress/compose'; | |
import classnames from 'classnames'; | |
const SUPPORTED_BLOCKS = ['core/heading']; |
import { registerPlugin } from '@wordpress/plugins'; | |
import { useDispatch, useSelect } from '@wordpress/data'; | |
import { useEffect } from '@wordpress/element'; | |
import { store as editorStore } from '@wordpress/editor'; | |
// Define post types that show the full template locked site editor by default. | |
const TEMPLATE_LOCKED_POST_TYPES = ['page', 'post']; | |
registerPlugin('namespace-set-default-template-rendering-mode', { | |
render: function Edit() { |
name: Compressed Size | |
on: [pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: |
add_filter( 'render_block', 'modify_youtube_embed_markup', 10, 2 ); | |
/** | |
* Modify block rendering to make YouTube embeds load a facade | |
* | |
* @param string|null $block_content The pre-rendered content. Default null. | |
* @param WPBlock $block The block being rendered. | |
* @return string modified Block HTML | |
*/ | |
function modify_youtube_embed_markup( $block_content, $block ) { |
Consider supporting my work by purchasing the course this tutorial is a part of i.e. VSCode Power User →
Local by FlyWheel
WordPress install is a custom install