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 | |
/* | |
Plugin Name: Conditionally send WooCommerce emails | |
Plugin URI: https://www.damiencarbery.com/2018/12/conditionally-disable-woocommerce-emails/ | |
Description: Dynamically determine whether to send a WooCommerce email. | |
Author: Damien Carbery | |
Version: 0.2 | |
*/ | |
// The filter name is 'woocommerce_email_enabled_'.WC_Email::id e.g. 'new_order', 'cancelled_order' etc |
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 | |
add_action( 'wp_print_styles', 'dequeue_font_awesome_style' ); | |
function dequeue_font_awesome_style() { | |
wp_dequeue_style( 'font-awesome' ); | |
wp_deregister_style( 'font-awesome' ); | |
} | |
?> |
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 | |
/** | |
* Simple logging for WordPress. | |
* | |
* @package BJ\Log | |
* @author bjornjohansen | |
* @version 0.1.0 | |
* @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License version 2 (GPLv2) | |
*/ |
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 | |
add_filter( 'woocommerce_payment_complete_order_status', 'wmg_auto_complete_virtual_orders', 10, 3 ); | |
/** | |
* Automatically complete orders with only virtual products | |
* | |
* @param string $payment_complete_status Order status used after an order payment is received | |
* @param int $order_id ID of the order being processed | |
* @param WC_Order $order Order object being processed |
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 | |
/** | |
* Plugin name: WP Trac #42573: Fix for theme template file caching. | |
* Description: Flush the theme file cache each time the admin screens are loaded which uses the file list. | |
* Plugin URI: https://core.trac.wordpress.org/ticket/42573 | |
* Author: Weston Ruter, XWP. | |
* Author URI: https://weston.ruter.net | |
*/ | |
function wp_42573_fix_template_caching( WP_Screen $current_screen ) { |
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 | |
/** | |
* Connect a Gravity Form File Upload Field to an ACF Image Field. | |
* @see https://joshuadnelson.com/connect-gravity-forms-file-upload-to-acf-gallery-field/ | |
*/ | |
$gravity_form_id = 1; // gravity form id, or replace {$gravity_form_id} below with this number | |
add_filter( "gform_after_submission_{$gravity_form_id}", 'jdn_set_acf_gallery_field', 10, 2 ); | |
function jdn_set_acf_gallery_field( $entry, $form ) { | |
$gf_images_field_id = 7; // the upload field id |
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
function fsc_figure( $image, $size, $imageclass, $captionclass ){ | |
/** | |
* Let plugins pre-filter the image meta to be able to fix inconsistencies in the stored data. | |
* | |
* @param string $image The ACF field name (i.e. 'your_photo_name'). | |
* @param string $size Thumbnail size (i.e. 'Thumbnail', 'Medium', 'Large') | |
* @param string $imageclass The Figure class you want to use (ex: 'my-figure') | |
* @param string $captionclass The Figcaption class you want to use (ex: 'caption-blue') | |
*/ |
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 // only copy if needed | |
/** | |
* Example: Add order meta to the REST API | |
* WC 2.6+ | |
* | |
* @param \WP_REST_Response $response The response object. | |
* @param \WP_Post $post Post object. | |
* @param \WP_REST_Request $request Request object. | |
* @return object updated response object |
NewerOlder