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 | |
namespace JW\CLI; | |
use WP_CLI; | |
use WP_CLI_Command; | |
/** | |
* A shortcode scraper class. | |
*/ |
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
# This sets up a resource pool for the user. | |
# By setting up a resource pool you are basically separating server reources between users. | |
# Author: Jay Wood | |
# http://github.com/JayWood | |
[%USER%] | |
prefix = /home/$pool | |
user = %USER% |
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 | |
/** | |
* WooCommerce Order Generator Admin Options Page | |
* | |
* @since NEXT | |
* @package WooCommerce Order Generator | |
*/ | |
/** | |
* WooCommerce Order Generator Admin. |
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 my_registered_type( $post_type ) { | |
if ( 'shop_order' !== $post_type ) { | |
return; | |
} | |
$backtrace = debug_backtrace(); | |
$iterator = count( $backtrace ) - 1; | |
if ( $iterator <= 0 ) { | |
return; |
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 | |
/** | |
* Jays Fix Serialization | |
* | |
* Fixes serialization in SQL files after replacements are done. | |
* License: GPL version 3 or later - http://www.gnu.org/licenses/gpl.txt | |
* By: Jay Wood ( [email protected] ) | |
* http://plugish.com | |
* | |
* Usage: |
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 | |
function fb_lp_to_local_delivery( $translated_text ) { | |
if ( 'Local Pickup' == $translated_text ) { | |
$translated_text = 'Local Delivery'; | |
} | |
} | |
add_filter( 'gettext', 'fb_lp_to_local_delivery' ); |
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: Widget to CPT | |
* Plugin URI: http://plugish.com | |
* Description: A simple how-to for migrating widgets to a CPT | |
* Author: JayWood | |
* Author URI: http://plugish.com | |
* Version: 0.1.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 | |
/** | |
* Plugin Name: Widget to CPT | |
* Plugin URI: http://webdevstudios.com | |
* Description: A simple how-to for migrating widgets to a CPT | |
* Author: JayWood | |
* Author URI: http://webdevstudios.com | |
* Version: 0.1.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
function add_custom_classes( $classes, $class, $post_id ) { | |
if ( 'product' == get_post_type( $post_id ) ) { | |
$classes[] = "sm-pid-" . $post_id; | |
// Post Class on Single Product | |
if ( is_singular( 'product' ) ) { | |
$classes[] = "sm-product-view"; | |
// Post Clas Product Archives Listing | |
} else { |
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 | |
function fb_1398591523488596( $classes, $class, $post_id ) { | |
if ( 'product' == get_post_type( $post_id ) ) { | |
if ( is_singular( 'product' ) ) { | |
$classes[] = "post-class-when-viewing-single-product"; | |
} else { | |
$classes[] = "non-single-product-page-class" | |
} | |
} |