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
blueprint: | |
name: Controller - EnOcean PTM 215Z (Friends of Hue) switch | |
description: 'Controller automation for executing press/hold/release actions triggered by | |
EnOcean PTM 215Z (Friends of Hue) switch.' | |
domain: automation | |
input: | |
controller_entity: | |
name: (Zigbee2MQTT) Controller Entity | |
description: The action sensor of the controller to use for the automation. |
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 | |
/** | |
* Returns an array of image IDs stored in gllery meta field | |
* | |
* @param string $field_key Gallery field meta key | |
* @param int $post_id Post ID to get field from. If not set - will try to use current post. | |
* @return array | |
*/ | |
function my_get_jet_engine_gallery( $field_key = '', $post_id = null ) { |
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
Eliminate All Blocks from Editor | |
wp.data.dispatch( 'core/block-editor' ).resetBlocks([]); | |
Filtering Blocks When allowed_block_types_all is a boolean | |
https://tomjn.com/2024/02/29/filtering-blocks-when-allowed_block_types_all-is-a-boolean/ | |
Gutenberg / Block editor: Dynamically populate SelectControl, RadioControl or CheckboxControl options | |
https://bdwm.be/gutenberg-block-editor-dynamically-populate-selectcontrol-radiocontrol-or-checkboxcontrol-options/ | |
Gutenberg: custom validation / how to prevent post from being saved |
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 | |
function custom_body_classes($classes) | |
{ | |
// the list of WordPress global browser checks | |
// https://codex.wordpress.org/Global_Variables#Browser_Detection_Booleans | |
$browsers = ['is_iphone', 'is_chrome', 'is_safari', 'is_NS4', 'is_opera', 'is_macIE', 'is_winIE', 'is_gecko', 'is_lynx', 'is_IE', 'is_edge']; | |
// check the globals to see if the browser is in there and return a string with the match | |
$classes[] = join(' ', array_filter($browsers, function ($browser) { |
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
@mixin for-phone-only { | |
@media (max-width: 599px) { @content; } | |
} | |
@mixin for-tablet-portrait-up { | |
@media (min-width: 600px) { @content; } | |
} | |
@mixin for-tablet-landscape-up { | |
@media (min-width: 900px) { @content; } | |
} | |
@mixin for-desktop-up { |
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
.pre-wrapper{ | |
position:relative; | |
} | |
.pre-wrapper pre{ | |
padding-top: 25px; | |
} | |
.pre-wrapper .copy-snippet { | |
border-radius: 0; | |
min-width:55px; | |
background: none repeat scroll 0 0 transparent; |
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 | |
//* Do NOT include the opening php tag shown above. Copy the code shown below into functions.php | |
/** | |
* Manage WooCommerce styles and scripts. | |
*/ | |
function grd_woocommerce_script_cleaner() { | |
// Remove the generator tag | |
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) ); |