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 | |
// Brings WooCommerce order notes back in the comments list | |
remove_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' ) ); |
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 woocommerce_custom_subscription_product_single_add_to_cart_text( $text = '' , $post = '' ) { | |
global $product; | |
if ( $product->is_type( 'subscription' ) ) { | |
$text = get_option( WC_Subscriptions_Admin::$option_prefix . '_add_to_cart_button_text', __( 'Sign Up Now', 'woocommerce-subscriptions' ) ); | |
} else { | |
$text = $product->add_to_cart_text(); // translated "Read 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 your own function to add the fields | |
add_filter( 'wpdonations_donation_data_fields', 'admin_add_fields' ); | |
// Add new fields to the edit donation screen in the administration | |
function admin_add_fields( $fields ) { | |
$fields['_donor_phone'] = array( | |
'label' => __( 'Phone', 'wpdonations' ), | |
'type' => 'text', | |
'placeholder' => '', | |
'description' => '' |
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( 'wp_footer' , 'add_wpdonations_scripts' ); | |
/** | |
* add_wpdonations_scripts | |
* | |
* @access public | |
* @since 1.0 | |
* @return void |
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 | |
// In functions.php | |
$customer_role = get_role( 'customer' ); | |
$customer_role->add_cap( 'read_private_posts' ); | |
$customer_role->add_cap( 'read_private_pages' ); |
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 your own function to filter the fields | |
add_filter( 'submit_donation_form_fields', 'custom_submit_donation_form_fields' ); | |
// This is your function which takes the fields, modifies them, and returns them | |
// You can see the fields which can be changed in: includes/forms/class-wpdonations-form-submit-donation.php | |
function custom_submit_donation_form_fields( $fields ) { | |
// Here we target one of the donation fields (donation_message) and change it's "required" value to true | |
$fields['donation']['donation_message']['required'] = true; |
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
/** | |
* Don't transfer Shipment Tracking meta when creating a renewal order. | |
* | |
* @access public | |
* @param array $order_meta_query MySQL query for pulling the metadata | |
* @param int $original_order_id Post ID of the order being used to purchased the subscription being renewed | |
* @param int $renewal_order_id Post ID of the order created for renewing the subscription | |
* @param string $new_order_role The role the renewal order is taking, one of 'parent' or 'child' | |
* @return void | |
*/ |
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: WC Tools - Custom Button | |
Plugin URI: http://remicorson.com | |
Description: A simple plugin to add a custom button to WooCommerce tools | |
Author: Remi Corson | |
Contributors: corsonr | |
Author URI: http://remicorson.com | |
Version: 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 | |
add_action( 'woocommerce_system_status_report', 'render_debug_section' ); | |
/** | |
* Renders the debug section | |
*/ | |
function render_debug_section() { | |
?> | |
<table class="wc_status_table widefat" cellspacing="0" id="status"> |
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( 'woocommerce_api_default_response_handler' , 'set_woocommerce_api_default_response_handler_to_xml' ); | |
/** | |
* set_woocommerce_api_default_response_handler_to_xml | |
* | |
* @access public | |
* @since 1.0 | |
* @return void |