This file contains hidden or 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
# make directory. | |
mkdir XXX | |
# go in to directory. | |
cd XXX | |
# Initialise NPM. | |
npm init | |
# Install wp-env. |
This file contains hidden or 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
# Disable theme editing in WordPress. | |
define( 'DISALLOW_FILE_EDIT', true ); |
This file contains hidden or 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
npx @wordpress/create-block --namespace "lf" --title "Name" --short-description "Description" --wp-scripts --category "design" name-slug |
This file contains hidden or 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
# npx create-block | |
# go to root of plugins folder | |
# run the following to create a directory with scripts in it | |
npx @wordpress/create-block --namespace "ttp" --title "Block Name" --short-description "Something" --category "common" --wp-scripts some-directory-name | |
# --namespace <value> internal namespace for the block name | |
# --title <value> display title for the block and the WordPress plugin | |
# --short-description <value> short description for the block and the WordPress plugin | |
# --category <name> category name for the block - common, formatting, layout, widgets, embed |
This file contains hidden or 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
// Add "nocookie" To WordPress oEmbeded Youtube Videos | |
function make_youtube_nocookie_oembed( $html ) { | |
return str_replace( 'youtube.com', 'youtube-nocookie.com', $html ); | |
} | |
add_filter( 'embed_oembed_html', 'make_youtube_nocookie_oembed' ); | |
// Note - previously embedded youtube videos store embed information in transients, so for best results when testing, use a new video URL each time. |
This file contains hidden or 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 7.4 cPanel PHP Extension Settings | |
dom | |
fileinfo | |
gd | |
imagick | |
intl | |
json | |
mbstring | |
mysqli |
This file contains hidden or 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 | |
// Disable Block Directory | |
add_action( | |
'plugins_loaded', | |
function() { | |
remove_action( 'enqueue_block_editor_assets', 'wp_enqueue_editor_block_directory_assets' ); | |
remove_action( 'enqueue_block_editor_assets', 'gutenberg_enqueue_block_editor_assets_block_directory' ); | |
} | |
); |
This file contains hidden or 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 | |
// Disable Sitemap - WordPress (5.5+) | |
add_filter('wp_sitemaps_enabled', '__return_false'); |
This file contains hidden or 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
add_action( | |
'plugins_loaded', | |
function() { | |
remove_action( 'enqueue_block_editor_assets', 'wp_enqueue_editor_block_directory_assets' ); | |
remove_action( 'enqueue_block_editor_assets', 'gutenberg_enqueue_block_editor_assets_block_directory' ); | |
} | |
); |