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 | |
/** | |
* Check if the current user has a valid license for the $download_id passed-in. | |
* | |
* @param array ( 'download' => Download/Item ID (post_id), 'price_id' => Price ID ) | |
* @return bool true/false | |
*/ | |
function edd_sl_current_user_has_valid_license_for( $download_ids ){ | |
// Get the current user 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 | |
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 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 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 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
#!/bin/bash | |
FILES_CHANGED=$(find /var/www -type f -mmin -$((60*24)) -printf '%TY-%Tm-%Td %TT %p\n' | sort -r) | |
if [ !$FILES_CHANGED ] | |
then | |
curl -s --user 'api:MAILGUN_API_KEY' \ | |
https://api.mailgun.net/v3/YOURMAILGUNDOMAIN/messages \ | |
-F from='Name of your server<support@yourdomain.com>' \ | |
-F to=support@yourdomain.com \ |
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
function get_dir_and_filename_of_active_plugin( $plugin_filename = 'akismet.php' ) { | |
$plugin_dir_and_filename = false; | |
$active_plugins = get_option( 'active_plugins' ); | |
foreach ( $active_plugins as $active_plugin ) { | |
if ( false !== strpos( $active_plugin, $plugin_filename ) ) { | |
$plugin_dir_and_filename = $active_plugin; | |
break; | |
} | |
} | |
return $plugin_dir_and_filename; |
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
function my_prefix_hide_everything_if_javascript_disabled() { | |
?> | |
<noscript id="javascript_test"> | |
<style type="text/css"> | |
body > * {display:none!important;} | |
#javascript_test{ | |
display:block!important; | |
} | |
</style> | |
<div class="noscriptmsg"> |
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
function custom_prefix_warn_about_old_refunds_js() { | |
if ( ! isset( $_GET['prevent_accidental_refunds_js'] ) ) { | |
return false; | |
} | |
header('Content-Type: application/javascript'); | |
?> |
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: 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 | |
*/ |
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 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( |
NewerOlder