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
// register a new post title variation. | |
// In a production environment I would register a new attribute called "isLiPostTitle" and use that instead of checking the className. | |
window.wp.blocks.registerBlockVariation( | |
'core/post-title', | |
{ | |
name: 'core/post-title-li', | |
title: 'Post title (li)', | |
attributes: { | |
className: 'is-li-title' | |
}, |
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
/** | |
* External dependencies | |
*/ | |
const { promisify } = require( 'util' ); | |
const path = require( 'path' ); | |
const makeDir = require( 'make-dir' ); | |
const fs = require("fs"); | |
const sass = require( 'sass' ); | |
const postcss = require( 'postcss' ); |
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
#!/bin/bash | |
#get the textdomain from the package.json file. | |
#export TEXTDOMAIN | |
TEXTDOMAIN=$(node -pe "require('./package.json').textdomain") | |
# if there is a textdomain, apply to the vendor folder. | |
if [ "$TEXTDOMAIN" != "undefined" ]; then | |
find "vendor" -type f -name "**.php" -exec sed -i "s/, 'textdomain' )/, '$TEXTDOMAIN' )/g" {} + | |
fi; |
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 disable_jquerymigrate_warning( $scripts ) { | |
if ( ! empty( $scripts->registered['jquery'] ) ) { | |
$scripts->registered['jquery']->deps = array_diff( $scripts->registered['jquery']->deps, array( 'jquery-migrate' ) ); | |
} | |
} | |
add_action( 'wp_default_scripts', 'disable_jquerymigrate_warning' ); |
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 | |
/** | |
* This shows how the field visibility can be changed conditionally between fields values | |
**/ | |
function example_add_customify_fold_example_options( $options ) { | |
$folding_examples_section = array( | |
'folding_section' => array( | |
'title' => esc_html__( 'Folding', 'example' ), | |
'options' => array( |
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 | |
add_filter( 'gridable_row_options', function ( $options ) { | |
$options['bg_color'] = array( | |
'type' => 'color', | |
'label' => 'Row Background Color', | |
'default' => '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 | |
/** | |
* Delete all the duplicated `_featured` meta data | |
**/ | |
function clear_listings(){ | |
global $post; | |
$q_args = array( | |
'post_type' => 'job_listing', |
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 | |
/** | |
* A WordPress theme script which redirects the admin user, after the first theme activation, on a page where | |
* it forces a plugin installation, in this case, the Pixelgrade Care plugin. | |
* | |
* Inspired from | |
* WooCommerce - https://github.com/woocommerce/woocommerce | |
* Envato WordPress Theme Setup Wizard - https://github.com/dtbaker/envato-wp-theme-setup-wizard | |
* Shiny Updates V3 - https://make.wordpress.org/core/2016/07/06/shiny-updates-in-4-6/ | |
* |
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 | |
/** | |
* Let's imagine that we need the issues number from an github organization | |
* The issues API results are limited to 100 per page so we need to call this recursively | |
* $offset (int) = the number of pages to skip for the current request | |
*/ | |
function request_issues_number( $offset = 0 ) { | |
$page = 1; | |
if ( ! empty( $offset ) ) { |
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
(function () { | |
/** | |
* A TinyMCE plugin example and some events handlings. | |
*/ | |
tinymce.PluginManager.add('gridable', function ( editor, url ) { | |
// if your plugin needs a toolbar, save it for a larger scope | |
var toolbar; | |
/** |
NewerOlder