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 | |
| /** | |
| * Shortcode to output Review Structured Data ld+json | |
| * | |
| * Example: to use in Tesminonial CPT | |
| * Usage: [review_json] | |
| */ | |
| function review_structured_data_shortcode() { | |
| $post_id = get_the_ID(); |
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_filter( 'joinchat_format_replacements', function($replaces) { | |
| $replaces['/(http:\/\/)/u'] = 'https://'; | |
| return $replaces; | |
| }, 999); |
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 | |
| // Join.chat CTA allow links in format [link text](https://example.com) | |
| add_filter( 'joinchat_format_replacements', function($replacements) { | |
| $replacements['/\[([^\[\]]+)\]\(([^)]+)\)/u'] = '<a href="$2">$1</a>'; | |
| return $replacements; | |
| }); | |
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 | |
| // Array filter items that field contains $value | |
| function array_filter_field_contains( $array, $field, $values ) { | |
| return array_filter( | |
| $array, | |
| function( $item ) use ( $field, $values ) { | |
| foreach ( (array) $values as $value ) { | |
| if ( false !== stripos( $item[ $field ], $value ) ) { | |
| return true; |
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
| /** | |
| * Contact Form 7 only enqueue scripts when there is a form in the page | |
| */ | |
| // Disable contact-form-7 recaptcha enqueue action | |
| remove_action( 'wp_enqueue_scripts', 'wpcf7_recaptcha_enqueue_scripts', 20 ); | |
| // Dequeue contact-form-7 scripts | |
| function contact_form_7_dequeue_scripts() { | |
| wp_dequeue_script( 'contact-form-7' ); |
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: .mo file cache | |
| Version: 0.0.1 | |
| Description: Store translations in external object cache for faster loading. | |
| Author: Pacotole | |
| Author URI: https://crea.me | |
| Plugin URI: https://gist.github.com/pacotole/85e422a27bb1635d98e1334cd2d5a634 | |
| License: GPL |
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: Environment Plugin Disabler | |
| * Description: Disables plugins based on environment settings. | |
| * Version: 1.1.0 | |
| * Author: Creame | |
| * Author URI: https://crea.me/ | |
| * | |
| * Usage: define and DISABLED_PLUGINS constant with a serialized array | |
| * of plugins to disable (e.g.): |
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
| try { | |
| localStorage.setItem('test', 1); | |
| localStorage.removeItem('test'); | |
| } catch(e) { | |
| window.localStorage = { | |
| _data : JSON.parse(document.cookie.replace(/(?:(?:^|.*;\s*)localStorage\s*\=\s*([^;]*).*$)|^.*$/, "$1") || '{}'), | |
| _save : function() { document.cookie = "localStorage=" + JSON.stringify(this._data) + "; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"; }, | |
| setItem : function(id, val) { this._data[id] = String(val); this._save(); }, | |
| getItem : function(id) { return this._data.hasOwnProperty(id) ? this._data[id] : null; }, | |
| removeItem : function(id) { delete this._data[id]; this._save(); }, |
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 | |
| /** | |
| * ============================================================================ | |
| * Analytics fixes between GADWP and WooCommerce Google Analytics Integration | |
| * ============================================================================ | |
| */ | |
| function fix_double_google_analytics () { | |
| if ( ! is_admin() && class_exists( 'WC_Google_Analytics_JS' ) ) { |
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
| {% extends "admin/base_site.html" %} | |
| {% load i18n admin_static admin_modify suit_tags admin_urls %} | |
| {% load url from suit_compat %} | |
| {% block extrahead %}{{ block.super }} | |
| {% url 'admin:jsi18n' as jsi18nurl %} | |
| <script type="text/javascript" src="{{ jsi18nurl|default:"../../../jsi18n/" }}"></script> | |
| {{ media }} |