Skip to content

Instantly share code, notes, and snippets.

View krugazul's full-sized avatar
🏠
Working from home

Warwick Booth krugazul

🏠
Working from home
View GitHub Profile
@krugazul
krugazul / class-attachement-fix.php
Created December 9, 2022 07:48
WordPress - BugFix - Image custom fields returning as arrays
<?php
namespace {your_namespace}\classes;
/**
* A class to fix the error with file attachements returning as an array.
*
* @package lsx
* @author Krugazul
* @license GPL3
* @link
@krugazul
krugazul / wp-print-filters.php
Created July 23, 2019 10:19
Print out the functions added to a specified filter
<?php
if ( isset($_GET['debug']) ) {
$filter = 'the_title';
$hooks = array();
if ( ! empty($GLOBALS['wp_filter'][$filter]) ) {
foreach ( $GLOBALS['wp_filter'][$filter] as $priority => $tag_hooks ) {
foreach ( $tag_hooks as $hook ) {
if ( is_array($hook['function']) ) {
if ( is_object($hook['function'][0]) ) {
$func = get_class($hook['function'][0]) . '->' . $hook['function'][1];
@krugazul
krugazul / b-jquery-refresh-iframe-src.js
Last active April 18, 2019 04:01
jQuery - Load an iframe on Bootstrap Modal Shown
jQuery(document).ready(function() {
jQuery("#videoModal").on('shown.bs.modal', function(){
jQuery('#videoModal iframe').attr('src', jQuery('#videoModal iframe').attr('data-src') );
});
});
@krugazul
krugazul / lighthouse-reports.php
Created April 12, 2019 04:36
Terminal Commands - Generate Lighthouse Reports
<?php
/**
* Terminal Commands
*
* Template Name: Terminal Commands
*
* @package lsx
* @subpackage template
*/
@krugazul
krugazul / lsx-search-enable-taxonomy.php
Created March 1, 2019 12:46
LSX Search - Enable filters and theme options for a custom taxonomy
<?php
/**
* Custom Taxonomy
*/
class Custom_Taxonomy {
/**
* Holds class instance
*
* @since 1.0.0
@krugazul
krugazul / b-jquery-width-test.js
Created October 11, 2018 06:24
jQuery Element width Test
var lsx_width_test = function ( selector ) {
selector.children().each( function() {
console.log(jQuery(this).prop('nodeName') + ' - ' + jQuery(this).attr( 'class' ) + ' - ' + jQuery(this).width());
if ( 0 < jQuery( this ).children.length ) {
lsx_width_test( jQuery( this ) );
}
} );
};
@krugazul
krugazul / a-bulk-delete-wc-integration.md
Last active July 9, 2018 14:37
Bulk Delete WooCommerce and WooCommerce Subscriptions Integration
We couldn’t find that file to show.
@krugazul
krugazul / a-readme.md
Last active October 27, 2019 20:50
Disable the WooCommerce My Account logout confirmation endpoint
@krugazul
krugazul / a-wp-all-export-readme.md
Last active August 3, 2022 06:29
WP All Export Functions and FIlters

WP All Export

WooCommerce

  • Billing and Shipping fields

General

  • Return only surname