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
add_filter( 'do_shortcode_tag', function ( $output, $tag, $attr ) { | |
if ( 'jet_engine' !== $tag ) { | |
return $output; | |
} | |
if ( empty( $attr['component'] ) || 'meta_field' !== $attr['component'] ) { | |
return $output; | |
} |
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 | |
# Setup ACF Pro to use a license key in wp-config | |
# | |
# 1. Place your license key in a file called .acf-license-key somewhere your ssh user has access to it. | |
# Default is in your home directory: ~/.acf-license-key | |
# Change the setting below if you need to put it somewhere else | |
# 2. install this file in /usr/local/bin or someplace in your PATH | |
# 3. make sure you have WP CLI installed | |
# 4. run acf-install-license from the root of your wordpress install |
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
/* Copy compiled Oxygen page content to post_content for search */ | |
function sg_save_rendered_page_content( $meta_id, $object_id, $meta_key, $meta_value ) { | |
// Debugging | |
// $debug .= preg_replace( '#(\[/[^\]]+?\])#', "$1\n", $meta_value ); | |
// file_put_contents( plugin_dir_path( __FILE__ ) . 'debug.html', $debug ); | |
if ( 'ct_builder_shortcodes' != $meta_key ) return; | |
// Don't try to render anything with inner content | |
if ( false !== strpos( $meta_value, '[ct_inner_content' ) ) return; |
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 | |
/** Do NOT include the opening php tag */ | |
if ( ! function_exists( 'ddw_cf_maybe_add_post_state_blocks' ) ) : | |
add_filter( 'display_post_states', 'ddw_cf_maybe_add_post_state_blocks', 10, 2 ); | |
/** | |
* Adds optional new post states if a Post has Blocks, has the "Classic" Block or no Blocks at all. | |
* |
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 | |
/** | |
* Returns an array of image IDs stored in gllery meta field | |
* | |
* @param string $field_key Gallery field meta key | |
* @param int $post_id Post ID to get field from. If not set - will try to use current post. | |
* @return array | |
*/ | |
function my_get_jet_engine_gallery( $field_key = '', $post_id = null ) { |
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 | |
/** | |
* Make Elementor the default editor, not the WordPress Editor (Gutenberg or Classic) | |
* Clicking the page title will take you to the Elementor editor directly | |
* Even non-Elementor-edited pages will become Elementor-edited pages now | |
* You can revert by clicking the "Back to WordPress Editor" button | |
* | |
* Author: Joe Fletcher, https://fletcherdigital.com | |
* URL: https://gist.github.com/heyfletch/7c59d1c0c9c56cbad51ef80290d86df7 |
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( 'render_block', 'custom_wrap_html_block_output', 10, 2 ); | |
/** | |
* Wrap output of HTML blocks. | |
* | |
* @param string $block_content Original block content. | |
* @param array $block Block info. | |
* @return string The block content with a wrapper. | |
*/ |
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
{ | |
"name": "wpsmith/hide-user", | |
"description": "Hides user in WordPress Admin.", | |
"type": "project", | |
"license": "GPLv2+", | |
"authors": [ | |
{ | |
"name": "Travis Smith", | |
"email": "[email protected]" | |
} |
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 | |
/** | |
* Restore CSV upload functionality for WordPress 4.9.9 and up | |
*/ | |
add_filter('wp_check_filetype_and_ext', function($values, $file, $filename, $mimes) { | |
if ( extension_loaded( 'fileinfo' ) ) { | |
// with the php-extension, a CSV file is issues type text/plain so we fix that back to | |
// text/csv by trusting the file extension. | |
$finfo = finfo_open( FILEINFO_MIME_TYPE ); | |
$real_mime = finfo_file( $finfo, $file ); |
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 my_filter_acf_pro_license_option( $pre ) { | |
if ( ! defined( 'ACF_PRO_LICENSE' ) || empty( ACF_PRO_LICENSE ) ) { | |
return $pre; | |
} | |
$data = array( | |
'key' => ACF_PRO_LICENSE, | |
'url' => home_url(), |