Apple MacBook Pro M1, 32 GB, Ventura 13.2
Documentation based on comments in this Github Elasticsearch issue.
Install Homebrew
<?php | |
function get_page_by_title( $page_title, $output = OBJECT, $post_type = 'page' ) { | |
$query = new WP_Query( | |
array( | |
'post_type' => $post_type, | |
'title' => $page_title, | |
'post_status' => 'all', | |
'posts_per_page' => 1, | |
'no_found_rows' => true, | |
'ignore_sticky_posts' => true, |
#!/usr/bin/php | |
<?php | |
declare(strict_types = 1); | |
// require_once ('hhb_.inc.php'); | |
hhb_init (); | |
if ($argc !== 3) { | |
fprintf ( STDERR, "usage: %s timestamp url\n", $argv [0] ); | |
fprintf ( STDERR, "example: %s 20091012061648 http://www.p4w.se\n", $argv [0] ); | |
die ( 1 ); | |
} |
<?php | |
/** | |
* Optimize Loading Separate Core Block Assets in Classic Themes Plugin. | |
* | |
* @package OptimizeLoadingSeparateCoreBlockAssetsInClassicThemes | |
* @author Weston Ruter | |
* @link https://gist.github.com/westonruter/25187db63a7666f08b151ca53497ffb5 | |
* @license GPL-2.0-or-later | |
* @copyright 2023 Google Inc. | |
* |
<?php | |
$hook = "render_block_someBlock"; | |
add_filter( $hook, function($block_content, $block, $instance) { | |
$selector = explode(',', $blockInfo['selector'] ?? ''); | |
$content = new WP_HTML_Tag_Processor( $block_content ); | |
$content->next_tag( $selector ); | |
$content->add_class( 'g-rich-text' ); |
Apple MacBook Pro M1, 32 GB, Ventura 13.2
Documentation based on comments in this Github Elasticsearch issue.
createObserver() { | |
let intersectionObserver = new IntersectionObserver((entries) => { | |
if (entries[0].intersectionRatio <= 0) { | |
//do something when hidden | |
console.log('hidden'); | |
} else { | |
//do something when visible | |
console.log('visible'); | |
} |
/** | |
* Retrieves the translation of text. | |
* | |
* @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-i18n/ | |
*/ | |
import { __ } from '@wordpress/i18n'; | |
/** | |
* React hook that is used to mark the block wrapper element. | |
* It provides all the necessary props like the class name. |
<?php | |
/** | |
* Snippet Action: Trigger Elementor DB Update. | |
* Snippet Type: Return info from Child Sites. ( IMPORTANT! This will make it run one time ) | |
* Snippet Author: Keith Crain ( Kronoslabs.io ) | |
*/ | |
add_action( 'plugins_loaded', 'klbs2345_trigger_elementor_db_update' ); | |
function klbs2345_trigger_elementor_db_update() { |
<?php | |
/** | |
* Title: Content-only Test | |
* Slug: prefix/content-only-test | |
*/ | |
?> | |
<!-- wp:group {"templateLock": "contentOnly", "align":"wide","layout":{"type":"constrained","wideSize":"2000px"}} --> | |
<div class="wp-block-group alignwide"><!-- wp:columns --> | |
<div class="wp-block-columns"><!-- wp:column --> | |
<div class="wp-block-column"><!-- wp:image {"id":231,"sizeSlug":"large","linkDestination":"none"} --> |