Skip to content

Instantly share code, notes, and snippets.

Chris Van Patten chrisvanpatten

View GitHub Profile
View panel.js
import { PluginPrePublishPanel } from '@wordpress/edit-post';
import { registerPlugin } from '@wordpress/plugins';
import Required from './required';
const Test = () => {
<PluginPrePublishPanel>
<Required.Fill>
{ ( fills ) => fills.length > 0 ? fills : null ) }
</Required.Fill>
View gist:7aa9fb17501bc154b71f8aa6ce15d089
{"skywordId":281474979915458,"type":"gallery","title":"Brendan Test 9\/17","author":"Author Byline Field","trackingTag":"true","publishAsDraft":false,"fields":[{"name":"seo_title","value":"Testing Revised Gallery - Feb 25th - Title Field","type":"META"},{"name":"toutImage","value":"84982","type":"IMAGE"},{"name":"toutImageCropOrientation","value":"Horizontal","type":"TAXONOMY"},{"name":"toutImageTitle","value":"Tout Image Title Field","type":"TEXT"},{"name":"toutImageCaption","value":"Tout Caption Field","type":"TEXT"},{"name":"toutImageAlt","value":"Tout Alternative Text Field","type":"TEXT"},{"name":"toutImageCredit","value":"Tout Credit Field","type":"TEXT"},{"name":"toutImageFocalPoint","value":"Tout Focal Point Field","type":"TEXT"},{"name":"toutImageRights","value":"restricted","type":"TAXONOMY"},{"name":"toutImageUsage","value":"Tout Image Rights Usage Field","type":"TEXT"},{"name":"socialTitle","value":"Social Title Field","type":"TEXT"},{"name":"socialDescription","value":"Social Description Field","
View 47684.php
<?php
// Filter search endpoint responses.
add_filter( 'rest_post_dispatch', 'wp_47684_filter_response', 10, 3 );
/**
* Resolves the behavior reported in WP Core Trac 47684.
*
* @see https://core.trac.wordpress.org/ticket/47684
*
View redirects.sh
#!/bin/bash
# Usage:
#
# ./redirects.sh dev marthastewart < sample.csv
while IFS=, read -r from to
do
wpcli @$1 onecms-srm add $from $to 301 --url=$2.$1.onecms.io
done
View gist:da7e3c72e2a008ed8a1a4ddc2f0a8c4a
/**
* Save term meta data.
*
* @param int $cat_id Category ID.
* @return void
*/
public static function create_category_page_data( $cat_id ) {
// Setup the values for the category page.
$author_id = get_current_user_id();
$post_type = 'category-page';
View gist:9840d1b854fd9e2dc4d7d445ff2500a1
<?php
/**
* This file is for loading all mu-plugins within subfolders
* where the PHP file name is exactly like the directory name + .php.
*
* Example: /mu-tools/mu-tools.php
*/
$dirs = glob( dirname( __FILE__ ) . '/*' , GLOB_ONLYDIR );
View errors
326674
326673
326671
326670
326669
326668
326666
326665
326664
326663
View errors.txt
276249
276259
260717
260718
257278
271458
259033
253331
253332
265212
View skyword-gallery.json
View gist:7b214304e70acd6a6644237e3340dce1
{
"author": "247",
"fields": [
{
"name": "seo_title",
"type": "META",
"value": "MTQA_Test0404_SkywordGallery"
},
{
"name": "toutImage",
You can’t perform that action at this time.