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
/* | |
Simple Taxonomy */ | |
add_action( 'init', function() { | |
register_extended_taxonomy( 'customtax', 'product' ); // This relies on https://github.com/johnbillion/extended-cpts/ | |
} ); | |
//Register taxonomy API for WC | |
add_action( 'rest_api_init', function() { | |
register_rest_field('product', 'customtax', array( |
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
DELETE FROM wp_terms WHERE term_id IN (SELECT term_id FROM wp_term_taxonomy WHERE count = 0 ); | |
DELETE FROM wp_term_taxonomy WHERE term_id not IN (SELECT term_id FROM wp_terms); | |
DELETE FROM wp_term_relationships WHERE term_taxonomy_id not IN (SELECT term_taxonomy_id FROM wp_term_taxonomy); |
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 | |
/** | |
* Hide Post Editor Tip about permalinks | |
*/ | |
add_action( 'admin_head', 's9_hide_permalink_tip' ); | |
function s9_hide_permalink_tip() { | |
echo '<style>'; | |
echo '#editor .edit-post-sidebar .editor-post-link .components-base-control + p { display: none; }'; | |
echo '</style>'; | |
} |
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 | |
$data_dir = 'c:/server/www/dev/data/'; | |
$releases = [ ]; | |
foreach ( range( 3.2, 4.0, 0.1 ) as $version ) { | |
$version = number_format( $version, 1 ); | |
$data = json_decode( file_get_contents( $data_dir . $version . '.json' ), true ); | |
$groups = wp_list_pluck( $data['groups'], 'data' ); |
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
<script type="172f63caa3046c8bb4d61ad7-text/javascript"> | |
jQuery(function($) { | |
jQuery('input[name="EMAIL"]').typeWatch({ callback: function (value) { if ( JiltStorefront.Helpers.isValidEmail( value ) ) { jilt.setCustomer({email: value }); } }, wait: 1250, highlight: false, allowSubmit: false, captureLength: 6 }); | |
}); | |
</script> |
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 | |
/** | |
* Adds listener to Email popup form and send email to Jilt for Cart Recovery | |
* | |
* @return void | |
*/ | |
if ( !is_admin() ) { | |
add_action( | |
'init', function() { |
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
SELECT 'sum size in KiB', ROUND(SUM(length(option_value))/1024,0) FROM wp_options WHERE autoload='yes' |
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
UPDATE wp_options SET autoload='No' WHERE `option_name` LIKE "_transient_%" |
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
SELECT 'autoloaded data in KiB' as name, ROUND(SUM(LENGTH(option_value))/ 1024) as value FROM wp_options WHERE autoload='yes' | |
UNION | |
SELECT 'autoloaded data count', count(*) FROM wp_options WHERE autoload='yes' | |
UNION | |
(SELECT option_name, length(option_value) FROM wp_options WHERE autoload='yes' ORDER BY length(option_value) DESC LIMIT 25) |
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 | |
/** | |
* Strip Visual Composer Shortcode Vomit | |
* | |
* Main footer file for the theme. | |
* | |
* @package DevTools | |
* @author Jon Brown <[email protected]> | |
* @license https://www.gnu.org/licenses/gpl-2.0.txt GNU/GPLv2 | |
* @link https://9seeds.com |