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
/** | |
* Disable Gutenberg by CPT | |
* | |
* @param Object $current_status Current status. | |
* @param string $post_type Post type. | |
* @author ElPuasDigitalCrafts | |
*/ | |
function prefix_disable_gutenberg( $current_status, $post_type ) { | |
if ( 'speakers' === $post_type ) { | |
return false; |
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 | |
/** | |
* Load icons dynamically into the `icon_picker` select field. | |
* | |
* @param array $field field options. | |
* @return array new field choices. | |
* | |
* @author JC Palmes | |
*/ | |
function acf_load_icon_picker_field_choices( $field ) { |
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: ACF Auto Sync | |
Plugin URI: | |
Description: Plugin that automatically syncs the database with local json | |
Version: 1.0 | |
Author: Noah Duncan <[email protected]> | |
Updated by: Alfredo Navas <[email protected]> | |
*/ |
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
// Turn debugging on | |
define('WP_DEBUG', true); | |
// Tell WordPress to log everything to /wp-content/debug.log | |
define('WP_DEBUG_LOG', true); | |
// Turn off the display of error messages on your site | |
define('WP_DEBUG_DISPLAY', false); | |
// For good measure, you can also add the follow code, which will hide errors from being displayed on-screen |
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
/** | |
* Change Locale Dynamically in WordPress. | |
* | |
* @author Guy Dumais. | |
* @link https://en.guydumais.digital/change-locale-dynamically-in-wordpress/ | |
*/ | |
// Filters all language attributes in the html tag. | |
add_filter( 'language_attributes', $af = function( $output, $doctype ) { |
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
/** | |
* WordPress dependencies | |
*/ | |
import { addFilter } from '@wordpress/hooks'; | |
/** | |
* Change the default setting for the core/button block | |
* | |
* @param {object} settings | |
* @param {string} name |
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
/** | |
* Extract Element Attributes when DOM node is a string. | |
* | |
* @author Alfredo Navas | |
* @param {string} elemText String to extract attrs. | |
* @return {object} The attributes from the string | |
*/ | |
export default function getElemAttributes(elemText) { | |
// Regex to pick out start tag from start of element's HTML. | |
let reStartTag = |
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
function twentytwentyone_gf_add_placeholder() { | |
$forms = GFAPI::get_forms(); | |
foreach ( $forms as $form ) { | |
if ( $form['id'] !== 1 ) { // Or Any Form ID | |
return; | |
} |
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
add_filter( 'gform_pre_render', 'twentytwentyone_gf_add_placeholder' ); | |
add_filter( 'gform_pre_validation', 'twentytwentyone_gf_add_placeholder' ); | |
add_filter( 'gform_pre_submission_filter', 'twentytwentyone_gf_add_placeholder' ); | |
function twentytwentyone_gf_add_placeholder( $form ) { | |
if ( $form['id'] !== 1 ) { | |
return; | |
} |
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 | |
/** | |
* Sort forms in Gravity Forms block in alphabetical order. | |
* | |
* @param array $forms A collection of active forms on site. | |
*/ | |
add_filter( 'gform_block_form_forms', function( $forms ) { | |
usort( $forms, function( $a, $b ) { |