This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* WordPress dependencies | |
*/ | |
import { __ } from '@wordpress/i18n'; | |
import { TextControl } from '@wordpress/components'; | |
import { useEntityProp } from '@wordpress/core-data'; | |
import { useSelect } from '@wordpress/data'; | |
import { useBlockProps } from '@wordpress/block-editor'; | |
import { useEffect } from '@wordpress/element'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* WordPress Dependencies | |
*/ | |
import { | |
useBlockProps, | |
useBlockEditingMode, | |
RichText, | |
store as blockEditorStore, | |
} from '@wordpress/block-editor'; | |
import { useSelect } from '@wordpress/data'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* WordPress dependencies | |
*/ | |
import { __ } from '@wordpress/i18n'; | |
import { useBlockProps, InspectorControls } from '@wordpress/block-editor'; | |
import { PanelBody, ComboboxControl } from '@wordpress/components'; | |
import { useEntityRecords } from '@wordpress/core-data'; | |
export default function Edit( { | |
attributes: { blockTaxonomyTerm }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://schemas.wp.org/trunk/block.json", | |
"apiVersion": 2, | |
"name": "create-block/mol-custom-blocks", | |
"version": "0.1.0", | |
"title": "Monte Logic's Custom Blocks", | |
"category": "text", | |
"icon": "flag", | |
"description": "A Gutenberg block to show your pride! This block enables you to type text and style it with the color font Gilbert from Type with Pride.", | |
"attributes": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://schemas.wp.org/trunk/block.json", | |
"apiVersion": 2, | |
"name": "create-block/block-supports-test", | |
"version": "0.1.0", | |
"title": "Block Supports Test", | |
"category": "widgets", | |
"icon": "smiley", | |
"description": "Example block written with ESNext standard and JSX support – build step required.", | |
"attributes":{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"fontFamilies": [ | |
{ | |
"fontFamily": "-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Oxygen-Sans,Ubuntu,Cantarell,\"Helvetica Neue\",sans-serif", | |
"name": "System Font", | |
"slug": "system-font" | |
}, | |
{ | |
"fontFamily": "\"Source Serif Pero\", serif", | |
"name": "Source Serif Pero", | |
"slug": "source-serif-pero", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Title: Example Block Pattern ( required field ) | |
* Slug: block-pattern-example (required field) | |
* Description: This is an example of how to use the new /patterns directory to register a block pattern. | |
* Categories: featured, text | |
* Viewport Width: 800 | |
* Keywords: example, block-theme, block-pattern | |
* Block Types: core/template-part/footer, core/post-content | |
* Inserter: yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Example showing how to allow a block pattern to be shown as a suggested pattern for new Pages. | |
*/ | |
add_action( | |
'init', | |
function() { | |
register_block_pattern( | |
'block-pattern-suggestion-example', | |
array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Examples on restricting when blocks can be locked using the UI. | |
* Based on the example provided by @mamaduka in https://github.com/WordPress/gutenberg/pull/39566 | |
* | |
* @see https://developer.wordpress.org/reference/hooks/block_editor_settings_all/ | |
*/ | |
add_filter( | |
'block_editor_settings_all', | |
function( $settings, $context ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "http://schemas.wp.org/trunk/theme.json", | |
"version": 2, | |
"settings": { | |
"layout": { | |
"contentSize": "750px" | |
}, | |
"color": { | |
"background": false, | |
"custom": false, |
NewerOlder