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 | |
| namespace SayHello\Theme\Controller; | |
| /** | |
| * Extends synced pattern overrides to additional blocks. | |
| * | |
| * core/media-text: allows the media (image or video) and the focal point | |
| * to be overridden in each instance of a synced pattern. Enable overrides | |
| * on the Media & Text block in the pattern editor (Advanced › Enable overrides). |
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
| /** | |
| * Inner padding and block gap for the core/media-text block. | |
| * | |
| * An additional "Inner dimensions" panel is added to the Styles tab. It mirrors the | |
| * padding and block spacing controls in the core Dimensions panel. | |
| * | |
| * - Inner padding: shown if spacing.padding is enabled for core/media-text in theme.json. | |
| * Stored in the shtInnerPadding attribute and applied to .wp-block-media-text__content. | |
| * - Block gap: shown if spacing.blockGap is enabled for core/media-text in theme.json. | |
| * Stored in the shtBlockGap attribute and applied as gap to the block element. Core's |
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
| /** | |
| * Run this in the browser's developer console. | |
| * Provided with no guarantees! Worked perfectly when published. | |
| * | |
| * mark-at-sayhello.ch / 30.1.2025 | |
| */ | |
| (()=> { | |
| let galleryCounters = {}; // Stores counters for each gallery legend |
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 | |
| register_block_bindings_source('my-custom-prefix/current-year', [ | |
| 'label' => __('Current year', 'my-custom-prefix'), | |
| 'get_value_callback' => 'my_custom_prefix_current_year', | |
| ]); | |
| function my_custom_prefix_current_year() | |
| { |
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 | |
| namespace PT\MustUse\Blocks\CoreEmbed; | |
| class Block | |
| { | |
| public function run() | |
| { | |
| add_filter('render_block_core/embed', [$this, 'render'], 10, 2); | |
| } |
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 | |
| $args = [ | |
| 'post_type' => 'post', | |
| 'posts_per_page' => -1, | |
| 'post_status' => 'any', | |
| 'meta_query' => [ | |
| [ | |
| 'key' => 'hide_thumbnail', | |
| 'compare' => 'EXISTS' |
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
| // get the current site's REST API base url | |
| const restApiBaseUrl = wpApiSettings.root; | |
| // get the element with the class name '.posts-container' from the document | |
| const postsContainer = document.querySelector('.posts-container'); | |
| // use restApiBaseUrl to get all of the posts from the rest api in a recursive async function. wrap the function in an IIFE. | |
| // append the posts to the posts container as objects. add a class name to each element using the classNameBase 'shp-my-posts' and the post id. | |
| (async function getPosts() { | |
| // stop processing if there is no posts container |
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
| #!/bin/bash | |
| function cecho(){ | |
| RED="\033[0;31m" | |
| GREEN="\033[0;32m" | |
| YELLOW="\033[0;33m" | |
| NC="\033[0m" # No Color | |
| printf "${!1}\n${2} ${NC}" | |
| } |
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 | |
| namespace SayHello\Theme\Block; | |
| use WP_Block; | |
| /** | |
| * Core Post Featured Image block | |
| * From plugin | |
| * |
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 | |
| namespace SayHello\Theme\Block; | |
| use WP_Term; | |
| /** | |
| * More posts from same category as current post | |
| * | |
| * @author Say Hello GmbH <hello@sayhello.ch> |
NewerOlder