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 | |
/** | |
* AMP WebP Img Wrapper | |
* | |
* @package AMP_WebP_Img_Wrapper | |
* @author Weston Ruter, Google | |
* @link https://gist.github.com/westonruter/332abdb2adefc6b204ad6fcc1beecedf | |
* @license GPL-2.0-or-later | |
* @copyright 2019 Google Inc. | |
* |
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 // Don't copy this line to your functions.php file. | |
/** | |
* Create an email blacklist to prevent spam registrations during LifterLMS checkout | |
* | |
* This is hooked to llms_before_checkout_validation | |
* | |
* This filter runs prior to any built-in checkout form validations allowing custom | |
* validations to be run. | |
* |
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 | |
/** | |
* USAGE: | |
* - Search and replace the `CUSTOM_SITEMAP` string with a lowercase identifier name: e.g., "vehicles", "customer_profiles" | |
* - The `your_alternate_data_source()` function does not exist; it's simply a placeholder for your own function that returns some sort of data array. | |
* - Uses heredocs for inline XML: https://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc | |
*/ | |
/** |
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
.woocommerce div.product.elementor form.cart.variations_form .woocommerce-variation-add-to-cart, | |
.woocommerce div.product.elementor form.cart:not(.grouped_form):not(.variations_form) { | |
display: block; | |
} | |
.elementor-element ul.pewc-product-extra-groups { | |
padding: 0; | |
} |
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 | |
/** | |
* Adds a cURL version test to Site Health | |
* | |
* Info here: https://make.wordpress.org/core/2019/04/25/site-health-check-in-5-2/ | |
* NOTE: Requires version 5.2+ of WordPress | |
* | |
**/ |
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
function sp_content_analysis_content($content, $id) { | |
//$content = default WP editor | |
//$id = current post ID | |
//Example to add your custom field to content analysis | |
//Flexible content must be called like this: name_of_your_flexible_content_0_name_of_your_field | |
$cf = get_post_meta($id, 'my-custom-field', true); | |
$content = $content.$cf; | |
return $content; | |
} | |
add_filter('seopress_content_analysis_content', 'sp_content_analysis_content', 10, 2); |
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 a weekly email report that summarizes which domains that | |
* your products are being used on. | |
*/ | |
add_filter( 'cron_schedules', function( $schedules ) { | |
$schedules['weekly'] = array( | |
'interval' => 604800, | |
'display' => __('Once Weekly') | |
); |
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_action('plugins_loaded','ao_defer_inline_init'); | |
function ao_defer_inline_init() { | |
if ( get_option('autoptimize_js_include_inline') != 'on' ) { | |
add_filter('autoptimize_html_after_minify','ao_defer_inline_jquery',10,1); | |
} | |
} | |
function ao_defer_inline_jquery( $in ) { |