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 | |
//Change Active Theme By Code | |
add_filter( 'template', 'mervin_change_theme' ); | |
add_filter( 'option_template', 'mervin_change_theme' ); | |
add_filter( 'option_stylesheet', 'mervin_change_theme' ); | |
function mervin_change_theme($theme) | |
{ | |
$theme = 'storefront'; |
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 | |
/** | |
* Group id shortcode | |
*/ | |
function mypmpro_groupid_shortcode() { | |
global $wpdb; | |
// Start output buffering | |
ob_start(); |
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 | |
require_once 'stripe-php/init.php'; // Path to autoload.php from the Stripe SDK | |
$sec_key = 'sk_live_xxxxxxxxxxxxxxxxxxx'; | |
$limit = 999999; | |
\Stripe\Stripe::setApiKey($sec_key); | |
$stripeclient = new \Stripe\StripeClient($sec_key); | |
$cancelled_subscriptions = \Stripe\Subscription::all(['limit' => $limit, 'status' => 'incomplete_expired']); |
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 | |
// webhook: customer.subscription.deleted | |
$sec_key = 'sk_live_xxxxxxxxxxxxxxxxxx'; | |
require_once 'stripe-php/init.php'; | |
$stripe = new \Stripe\StripeClient($sec_key); | |
$last_invoice = $stripe->invoices->all(['limit' => 1]); | |
$invoice_id = $last_invoice->data[0]->id; | |
$stripe->invoices->voidInvoice($invoice_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
<?php | |
// first, get the image ID returned by ACF | |
$image_id = get_field('image_field'); | |
$image_size = 'thumbnail'; | |
$image_array = wp_get_attachment_image_src($image_id, $image_size); | |
$image_url = $image_array[0]; | |
?> |
NewerOlder