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 | |
// nofollow all external links in posts and pages | |
add_filter('the_content', 'vc_nofollow'); | |
add_filter('the_excerpt', 'vc_nofollow'); | |
function vc_nofollow($content) { | |
return preg_replace_callback('/<a[^>]+/', 'vc_nofollow_callback', $content); | |
} | |
function vc_nofollow_callback($matches) { |
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 | |
defined( 'ABSPATH' ) || exit; | |
class Coupon { | |
private $amount; | |
private $discount_type; | |
private $coupon_code = 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 | |
add_filter( 'plupload_init', function( $plupload_init ) { | |
if ( isset($_GET['page']) && $_GET['page'] == 'vod-videos-add') { | |
$plupload_init['filters']['mime_types'] = [ | |
array( | |
'title' => 'Videos', | |
'extensions' => 'mp4,mov,m4v', | |
'mime_types' => 'video/mp4,video/quicktime,video/x-m4v', |
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 | |
if( !defined('DISALLOW_FILE_EDIT') ){ | |
define( 'DISALLOW_FILE_EDIT', true ); | |
} |
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 | |
/** | |
* Dequeue recaptcha from not needed pages | |
*/ | |
add_action('wp_enqueue_scripts', function () { | |
global $post; | |
if ( is_a( $post, 'WP_Post' ) && !has_shortcode( $post->post_content, 'contact-form-7') ) { | |
wp_dequeue_script('google-recaptcha'); | |
add_filter( 'wpcf7_load_js', '__return_false' ); |
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
SELECT | |
t.term_id AS 'Attribute Value ID', | |
tt.taxonomy AS 'Attribute Name', | |
wat.attribute_label AS 'Attribute Label', | |
t.name AS 'Attribute Value', | |
COUNT(t.name) as 'num' | |
FROM | |
wp_posts AS p | |
INNER JOIN wp_term_relationships AS tr | |
ON |
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 | |
// Remove cart button from mini-cart | |
remove_action( 'woocommerce_widget_shopping_cart_buttons', 'woocommerce_widget_shopping_cart_button_view_cart', 10 ); | |
// Add checks and notices | |
add_action( 'admin_notices', function() { | |
if ( ! is_plugin_active( 'woocommerce/woocommerce.php' ) ) { | |
?><div class="notice notice-error"><p><?php _e( 'Warning! To use Disable cart page for WooCommerce it need WooCommerce is installed and active.', 'disable-cart-page-for-woocommerce' ); ?></p></div><?php | |
} |
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
UPDATE wp_postmeta SET meta_value = meta_value*.1 WHERE meta_key = '_regular_price' AND meta_value != '' | |
UPDATE wp_postmeta SET meta_value = meta_value*.1 WHERE meta_key = '_sale_price' AND meta_value != '' | |
UPDATE wp_postmeta SET meta_value = meta_value*.1 WHERE meta_key = '_price' AND meta_value != '' | |
UPDATE wp_postmeta SET meta_value = meta_value*.1 WHERE meta_key = '_regular_price_tmp' AND meta_value != '' | |
UPDATE wp_postmeta SET meta_value = meta_value*.1 WHERE meta_key = '_sale_price_tmp' AND meta_value != '' | |
UPDATE wp_postmeta SET meta_value = meta_value*.1 WHERE meta_key = '_price_tmp' AND meta_value != '' | |
UPDATE wp_postmeta SET meta_value = meta_value*.1 WHERE meta_key = '_min_variation_price' AND meta_value != '' | |
UPDATE wp_postmeta SET meta_value = meta_value*.1 WHERE meta_key = '_max_variation_price' AND meta_value != '' |