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 | |
// IMPORTANT UPDATE 20190307: | |
// Since WordPress 5.0.0 we can actually use much simpler solution: | |
/** | |
* Applies wrapper div around aligned blocks. | |
* | |
* Copy this function into your WordPress theme's `functions.php` file | |
* and change the `themeprefix` accordingly. |
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
if (!CodeMirror.prototype.destroy) (function(){ | |
// A destroy extension. Absolutely positively beyond a shadow of a doubt obliterate a CodeMirror instance from memory. | |
function hasExclusion(stringArr, regexpArr){ | |
return function(exclusion){ | |
var iSA = stringArr.length, cur = null, iEL = 0, iC = 0, iRA = regexpArr.length; | |
if (isRegExp(exclusion)){ | |
while (iRA--) | |
if (regexpArr[iRA].source === exclusion.source && regexpArr[iRA].flags === exclusion.flags) | |
return iRA; | |
} else { |
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_page_scripts' ); | |
/** | |
* Register the metabox | |
*/ | |
function add_page_scripts() { | |
add_meta_box( 'page-scripts', __( 'Page Scripts & Styles', 'textdomain' ), 'add_page_metabox_scripts_html', 'page', 'advanced' ); | |
} |
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
"use strict"; | |
// Load plugins | |
const autoprefixer = require("autoprefixer"); | |
const browsersync = require("browser-sync").create(); | |
const cp = require("child_process"); | |
const cssnano = require("cssnano"); | |
const del = require("del"); | |
const eslint = require("gulp-eslint"); | |
const gulp = require("gulp"); |
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 height field to ACF WYSIWYG | |
*/ | |
function wysiwyg_render_field_settings( $field ) { | |
acf_render_field_setting( $field, array( | |
'label' => __('Height of Editor'), | |
'instructions' => __('Height of Editor after Init'), | |
'name' => 'wysiwyg_height', | |
'type' => 'number', |
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: Your Shipping plugin | |
Plugin URI: https://woocommerce.com/ | |
Description: Your shipping method plugin | |
Version: 1.0.0 | |
Author: WooThemes | |
Author URI: https://woocommerce.com/ | |
*/ |
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 helper functions from global scope | |
const { registerBlockType } = window.wp.blocks; | |
const { __ } = window.wp.i18n; | |
// Use registerBlockType to create a custom block | |
registerBlockType( | |
'example-plugin/example-custom-block', | |
{ | |
// Localize title using wp.i18n.__() | |
title: __( 'Block Title' ), |
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
// Import __ from i18n internationalization library | |
const { __ } = wp.i18n; | |
// Import registerBlockType() from block building libary | |
const { registerBlockType } = wp.blocks; | |
// Import the element creator function (React abstraction layer) | |
const el = wp.element.createElement; | |
/** | |
* Example of a custom SVG path taken from fontastic | |
*/ |
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
# This is a list of plugins installed in your project | |
# You can delete or add new plugins | |
# | |
# Format is following: | |
# id.of.plugin=url_of_repository | |
# | |
# Corresponding "id.of.plugin" can be found in the plugin's plugin.xml file: | |
# <plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" id="foo.bar.plugin" version="0.0.1"> | |
# | |
# This list contains all core cordova plugins. |
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 | |
if( | |
strpos( $_SERVER['HTTP_REFERER'], 'wp-admin' ) === false && | |
strpos( $_SERVER['REQUEST_URI'], 'admin-ajax.php' ) !== false | |
) { | |
header( 'Cache-Control: max-age=30000, must-revalidate' ); | |
header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', strtotime( '+5000 minutes' ) ) . ' GMT' ); | |
header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s', strtotime( '-5000 minutes' ) ) . ' GMT' ); | |
header( $_SERVER["SERVER_PROTOCOL"]." 404 Not Found" ); | |
die; |