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 email_past_due() { | |
global $wpdb; | |
$mailer = WC_Emails::instance(); | |
$date = date( "Y-m-d H:i:s", current_time( 'timestamp' ) + 86400 * 7 ); | |
$due_orders = $wpdb->get_col( $wpdb->prepare( " | |
SELECT posts.ID | |
FROM {$wpdb->posts} AS posts |
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 | |
/** | |
* Only allow one payment plan purchase (Subscription) at a time | |
*/ | |
add_filter( 'woocommerce_add_to_cart_validation', 'woo_block_sub', 10, 2 ); | |
function woo_block_sub( $valid, $product_id ) { | |
// Get the current product | |
$current_product = wc_get_product( $product_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: Give - Free | |
**/ | |
/** | |
* Register our plugin so it shows up as an option in the Give gateway settings | |
*/ | |
add_filter( 'give_payment_gateways', function() { | |
// Here replace 'give_free' with a unique slug for your plugin. You will use this slug throughout this plugin. |
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 | |
/** | |
* If inserting a gif always place the full size image | |
* | |
* @param string $html | |
* @param int $send_id | |
* @param array $attachment | |
* | |
* @return string | |
*/ |
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 | |
/** | |
* Heavily borrowed from: http://xplus3.net/2010/08/08/filtering-on-a-non-standard-database-field-with-wordpress/ | |
**/ | |
class CoordinatesTable extends DB { | |
protected $db_option = "coordinates_db"; |
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 | |
class BP_SelectHome extends BP_Component { | |
function __construct() { | |
global $bp; | |
parent::start( | |
'bp-select-home', | |
__( 'Select Home', 'fp-stroke-community' ), | |
dirname( __FILE__ ) | |
); |
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 | |
class Login { | |
public function hook(){ | |
add_filter( 'determine_current_user', [ $this, 'login_via_token' ], 20 ); | |
add_action( 'rest_api_init', [ $this, 'register_routes' ], 10 ); | |
} | |
public function register_routes(){ |
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( 'rest_product_query', function( $query_args, $request ) { | |
if ( isset( $_GET['search'] ) && ! empty( $_GET['search'] ) && class_exists( '\SWP_Query' ) ) { | |
$query_args['orderby'] = 'post__in'; | |
} | |
return $query_args; | |
}, 99, 2 ); |
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( 'pre_get_posts', function( $query ) { | |
if ( ! defined( 'REST_REQUEST' ) || ! REST_REQUEST ) { | |
return | |
} | |
if ( is_admin() || ! isset( $query->query['post_type'] ) || $query->query['post_type'] !== 'product' ) { | |
return; | |
} |
NewerOlder