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
/** On Freemius purchase complete **/ | |
jQuery(document).on( | |
"wpt-freemius-checkout", | |
function(event, response, handler_args){ | |
}); |
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 WpCsp { | |
public function register(): void | |
{ | |
add_filter('script_loader_tag', [$this, 'filter_script_loader_tag'], 3, 50); | |
add_filter('wp_inline_script_attributes', [$this, 'action_wp_inline_script_attributes']); |
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 | |
/** @var \Freemius $myfreemiustag_fs Freemius global object. */ | |
global $myfreemiustag_fs; | |
if ( ! isset( $myfreemiustag_fs ) ) { | |
// Include Freemius SDK. | |
require_once 'mypath/includes/vendor/freemius/wordpress-sdk/start.php'; | |
$myfreemiustag_fs = fs_dynamic_init( array( | |
'id' => '10000', |
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 | |
// AppSumo AJAX form submission | |
add_action( 'wp_ajax_nopriv_deo_appsumo_submission', 'deo_appsumo_submission' ); | |
add_action( 'wp_ajax_deo_appsumo_submission', 'deo_appsumo_submission' ); | |
function deo_appsumo_submission() { | |
check_ajax_referer( 'deo_ajax_nonce', 'nonce' ); | |
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 | |
/** | |
* Get autoload heavy options from options table | |
* | |
* @todo Change the `prefix_` and with your own unique prefix. | |
* | |
* @since 1.0.0 | |
*/ | |
if( ! function_exists( 'prefix_get_heavy_autoload_options' ) ) : | |
function prefix_get_heavy_autoload_options() { |
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 | |
/** | |
* Get Autoload Options Size | |
* | |
* Get the size of all options which are set as `autoload_size` in the WordPress `wp_options` ($wpdb->options) table. | |
* | |
* @todo Change the `prefix_` and with your own unique prefix. | |
* | |
* @since 1.0.0 | |
*/ |
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 | |
/** | |
* Get image & other links from the given content. | |
* | |
* @todo Change the `prefix_` and with your own unique prefix. | |
* | |
* @since 1.0.0 | |
* @return array | |
*/ | |
if( ! function_exists( 'prefix_get_links_from_content' ) ) : |
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 custom column | |
* | |
* @todo Change the `prefix_` and with your own unique prefix. | |
* | |
* @since 1.0.0 | |
*/ | |
if( ! function_exists( 'prefix_add_custom_column' ) ) : | |
function prefix_add_custom_column( $columns = array() ) { |
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
/** | |
* Preload any footer JS files in the header | |
* | |
* originally from: https://macarthur.me/posts/preloading-javascript-in-wordpress | |
*/ | |
add_action('wp_head', function () { | |
global $wp_scripts; |
NewerOlder