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 pw_send_subscription_cancelled_to_admin( $sub_id, $subscription ) { | |
$email_to = '[email protected]'; | |
$subject = 'Subscription Cancelled'; | |
$message = 'Subscription cancelled for ' . $subscription->customer->email; | |
EDD()->emails->send( $email_to, $subject, $message ); | |
} | |
add_action( 'edd_subscription_cancelled', 'pw_send_subscription_cancelled_to_admin', 10, 2 ); | |
function pw_send_subscription_failed_to_admin( $subscription ) { | |
$email_to = '[email protected]'; |
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 pj_debug_to_txt_file( $debug_value, $filename, $append = true ){ | |
$upload_dir = wp_upload_dir(); | |
$filename = trailingslashit( $upload_dir['basedir'] ) . $filename . '.txt'; | |
if ( false === $append ) { | |
// Blank out the log file if needed | |
@file_put_contents( $filename, '' ); | |
@chmod( $filename, 0664 ); | |
} |
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 my_custom_field_links_for_postgrid( $permalink, $grid_post_id, $brick_id ){ | |
global $wp_query; | |
//If this page is the page with the postgrid on it | |
if ( $brick_id == '31981' ){ | |
$site_link = get_post_meta( $grid_post_id, 'your_custom_field_slug', true ); | |
//If there is a site link |
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 | |
function my_custom_gutenberg_block_enqueue_scripts(){ | |
// Required thing to build Gutenberg Blocks | |
$required_js_files = array( | |
'wp-blocks', | |
'wp-i18n', | |
'wp-element', | |
'wp-editor' | |
); |
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
const { __ } = wp.i18n; | |
const { registerBlockType } = wp.blocks; | |
registerBlockType( 'my-custom-gutenberg-block/static-jsx-example', { | |
title: __( 'Static Block Example with JSX' ), | |
icon: 'lock', | |
category: 'common', | |
edit() { |
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
if ( ! function_exists( 'disable_gutenberg' ) ) { | |
function disable_gutenberg() { | |
global $wp_filter; | |
$callbacks_array = $wp_filter['init']->callbacks; | |
foreach( $wp_filter as $tag => $priorities ) { | |
foreach( $priorities->callbacks as $priority => $callback_data ) { | |
foreach( $callback_data as $callback_function_name => $callback_function_data ) { |
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
// Google Analytics | |
function my_website_google_analytics(){ | |
// Don't track visits by logged-in administrators | |
if ( current_user_can( 'update_plugins' ) ) { | |
return; | |
} | |
?> | |
<!-- Replace me with Google Analytics Tracking Code --> |
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 get_my_plugin_data(){ | |
// You'll likely replace this with some sort of API call home. | |
$plugin = json_decode( | |
json_encode( | |
array( | |
'new_version' => 89, | |
'stable_version' => 89, | |
'name' => 'My Fake Plugin', | |
'slug' => 'my-fake-plugin', | |
'url' => 'https://myfakeplugin.com', |
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 | |
function simple_theme_updater( $update_themes, $transient_name ) { | |
// We can use the active theme name, because if this code is running, we know this is the active theme. | |
$active_theme_slug = get_template(); | |
$theme = json_decode( | |
json_encode( | |
array( |
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: Easy Digital Downloads - Fix child licenses | |
Description: Make the child licenses of all licensed bundles match the parent license expiration | |
Plugin URI: https://easydigitaldownlaods.com | |
Author: Phil Johnston | |
Author URI: https://easydigitaldownloads.com | |
Version: 1.0 | |
License: GPL2 | |
*/ |