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
"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_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
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 | |
// 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
/** | |
* Scrubs content for curly quotes | |
* @param string $content | |
* @return string | |
*/ | |
function prefix_scrub_smart_quotes_from_shortcodes( $content ){ | |
// Search for all smartquotes inside of shortcodes and replace them | |
$content = preg_replace('/(“|”)(?=[^\[]*\])/', '"', $content ); |
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 | |
/* | |
*Example Follw:-https://code.tutsplus.com/tutorials/build-a-custom-wordpress-user-flow-part-3-password-reset--cms-23811 | |
*/ | |
// Create the custom pages at plugin activation | |
register_activation_hook( __FILE__, 'dgm_plugin_activated' ); | |
function dgm_plugin_activated() { | |
// Information needed for creating the plugin's pages | |
$page_definitions = array( |
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 | |
/** | |
* Fragment caching function | |
* see: https://css-tricks.com/wordpress-fragment-caching-revisited/ | |
* | |
* Usage: | |
* <?php fragment_cache('frc_footer', DAY_IN_SECONDS, function() { ?> | |
* code to cache (loops etc) | |
* <?php }); // end fragment_cache ?> | |
*/ |
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
DB_PORT=9119 | |
WP_PORT=7253 | |
WP_TAG=latest |
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 // Do not include this line. | |
$post_id = get_the_ID(); // Set post ID var. | |
if ( Elementor\Plugin::instance()->db->is_built_with_elementor( $post_id ) ) { | |
echo 'fuck yeah it is!'; | |
} |