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
add_action( 'woocommerce_after_add_to_cart_button', 'wc_ninja_add_extra_button', 20 ); | |
function wc_ninja_add_extra_button() { | |
echo "<a href='#' class='button'>Return to shop</a>"; | |
} |
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 get_cron_events_to_ignore() { | |
return [ | |
'a8c_cron_control_force_publish_missed_schedules', | |
'a8c_cron_control_confirm_scheduled_posts', | |
]; | |
} | |
// If an ignorable cron event runs, let's unschedule it so it runs no more. |
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
add_filter( 'woocommerce_product_single_add_to_cart_text', 'wc_ninja_change_backorder_button', 10, 2 ); | |
function wc_ninja_change_backorder_button( $text, $product ){ | |
if ( $product->is_on_backorder( 1 ) ) { | |
$text = __( 'Pre-Order', 'woocommerce' ); | |
} | |
return $text; | |
} |
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 wc_ninja_remove_password_strength() { | |
if ( wp_script_is( 'wc-password-strength-meter', 'enqueued' ) ) { | |
wp_dequeue_script( 'wc-password-strength-meter' ); | |
} | |
} | |
add_action( 'wp_print_scripts', 'wc_ninja_remove_password_strength', 100 ); |
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 | |
// We don't need this query to run if it's asking for all comments (post_id = 0). | |
add_filter( 'wp_count_comments', function ( $count, $post_id ) { | |
if ( 0 === $post_id ) { | |
$stats = array( | |
'approved' => 0, | |
'moderated' => 0, | |
'spam' => 0, | |
'trash' => 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
#!/bin/bash | |
# Usage: wp-create sitename | |
if [ $# -eq 0 ]; then | |
echo "Need to provide the directory name to be created." | |
exit 1 | |
fi | |
# set up new folder to house the WP install |
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: Damn Vulnerable WordPress Plugin | |
* Description: Intentionally vulnerable plugin for plugin author education | |
* Version: 0.1 | |
* Plugin URI: http://make.wordpress.org/plugins/2013/04/09/intentionally-vulnerable-plugin/ | |
* Author: Jon Cave | |
* Author URI: http://joncave.co.uk | |
* Text Domain: damn-vulnerable-wordpress-plugin | |
* License: GPLv2+ | |
* |
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 | |
/* | |
* Dynamic Queue adjustments for autoscaling Action Scheduler. | |
* | |
* Every few minutes, this checks to see if the AS queue has exceeded a certain | |
* threshold of "due now" actions. And if so, will schedule additional queues to run | |
* concurrently in cron until the queue is caught up. | |
* | |
* Scales directly off of cron control's JOB_CONCURRENCY_LIMIT. |
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( 'manage_shop_order_posts_columns', 'wc_define_columns', 15 ); | |
function wc_define_columns( $columns ) { | |
$columns['customer_notes'] = __( 'Customer Notes', 'woocommerce' ); | |
return $columns; | |
} | |
add_action( 'manage_shop_order_posts_custom_column', 'wc_render_customer_notes_column', 10, 2 ); | |
function wc_render_customer_notes_column( $column, $post_id ) { |
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: Conditional WooCommerce Checkout Fields | |
* Description: Adds the abilitiy to conditionally show / hide checkout fields. | |
* Version: 1.0 | |
* Author: Caleb Burks | |
* Author URI: http://calebburks.com | |
*/ | |
NewerOlder