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 | |
/** | |
* Plugin Name: WP CLI Term Importer | |
* | |
* Description: Import terms from the parent site to the current site. | |
* Author: Omar | |
* Version: 1.0.0 | |
*/ | |
/** |
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 | |
declare(strict_types=1); | |
/** | |
* Class JsonToGutenbergTable | |
* | |
* Converts JSON data to a Gutenberg table. | |
* | |
* @package MetricPoster |
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 | |
// Find the name of a cron job from the md5 hash of the name. | |
// prerequisites | |
// 1. jobs.txt - a list of cron job names, one per line | |
// 2. needles.txt (optional) - a list of md5 hashes of cron job names, one per line | |
// get the list of names from jobs.txt | |
$hook_names = file_get_contents('jobs.txt'); | |
$hook_names = explode("\n", $hook_names); |
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 | |
/* | |
Plugin Name: Omars Test | |
Description: for testing | |
Author: Automattic | |
*/ | |
// return if accessed directly | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; |
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 | |
// IG: @i_am_techgnosis | |
// render block hook example to modify specific blocks... | |
function gutenberg_block_wrapper( $block_content, $block ) { | |
if ( isset( $block['attrs']['align'] ) && in_array( $block['attrs']['align'], array( 'wide', 'full' ) ) ) { | |
$block_content = sprintf( | |
'<div class="%1$s">%2$s</div>', | |
'align-wrap align-wrap-' . esc_attr( $block['attrs']['align'] ), |
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 | |
add_action( 'add_meta_boxes', 'add_featured_checkbox_function' ); | |
function add_featured_checkbox_function() { | |
// view WP Docs: https://developer.wordpress.org/reference/functions/add_meta_box/ | |
add_meta_box( | |
'full_content_checkbox_id', | |
'Show Full Content?', | |
'full_content_checkbox_callback_function', | |
'post', |
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
# Generated using Google Bard with prompt: | |
# generate a dockerfile that does the following: | |
# uses composer image to execute composer install on a given directory | |
# uses a nodejs image to execute npm install && npm run build on a given directory | |
# copies the composer and nodejs output to a PHP image that runs WordPress | |
# composer task | |
FROM composer:latest AS composer | |
WORKDIR /app | |
COPY composer.json composer.lock ./ |
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
<!--Pen by Margus Lillemägi | codepen.io/VisualAngle/--> | |
<div id="container"> | |
<svg xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMin slice"> | |
<filter id="F"> | |
<feColorMatrix type="reference" values="0" /> | |
</filter> | |
<filter id="colorMeMatrix"> |