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
remove_action( 'edd_purchase_form', 'edd_show_purchase_form' ); | |
add_action( 'edd_checkout_form_top', 'edden_show_purchase_form_user_fields' ); | |
add_action( 'edd_purchase_form', 'edden_show_purchase_form_payment_fields' ); | |
function edden_show_purchase_form_user_fields() { | |
if ( edd_can_checkout() ) { | |
do_action( 'edd_purchase_form_before_register_login' ); |
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 edd_checkout_cart_columns() { | |
global $wp_filter; | |
$head_first = 0; | |
$head_last = 0; | |
if( isset( $wp_filter['edd_checkout_table_header_first'] ) ){ | |
$head_first = count( $wp_filter['edd_checkout_table_header_first'] ); | |
} | |
if( isset( $wp_filter['edd_checkout_table_header_last'] ) ){ | |
$head_last = count( $wp_filter['edd_checkout_table_header_last'] ); | |
} |
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 get_plugin_install_count( $plugin ) { | |
$api = plugins_api( 'plugin_information', array( | |
'slug' => 'popup-maker', | |
'fields' => array( 'active_installs' => true ) | |
) ); | |
if( ! is_wp_error( $api ) ) { | |
return $api->active_installs; | |
} |
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 plugin_install_count_shortcode( $atts ) { | |
$a = shortcode_atts( array( | |
'plugin' => NULL, | |
), $atts ); | |
if( ! $a['plugin'] ) { | |
return; | |
} | |
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 schedule_my_popup( $is_loadable, $popup_id ) { | |
if( $popup_id == 123 ) { | |
$start = strtotime( 'May 4, 2015 11:59PM' ); | |
$end = strtotime( 'May 5, 2015 11:59PM' ); | |
$now = strtotime( 'now' ); | |
if( $now >= $start && $now <= $end ) { | |
return true; |
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
var ingredients = [ | |
{ID:"9", value:"Cocoa Powder"}, | |
{ID:"11", value:"Baking Powder"} | |
]; | |
$(".ingredient-label") | |
.autocomplete({ | |
source: ingredients, | |
autoFocus: true, | |
select: function (e, ui) { |
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 | |
/** | |
* Use * for origin | |
*/ | |
add_action( 'rest_api_init', function() { | |
remove_filter( 'rest_pre_serve_request', 'rest_send_cors_headers' ); | |
add_filter( 'rest_pre_serve_request', function( $value ) { | |
header( 'Access-Control-Allow-Origin: *' ); | |
header( 'Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE' ); |
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( 'wp_footer', 'my_custom_popup_scripts', 500 ); | |
function my_custom_popup_scripts() { ?> | |
<script type="text/javascript"> | |
(function ($, document, undefined) { | |
// Your custom code goes here. |
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
jQuery('#popmake-123 form').on('submit', function () { | |
jQuery.pm_cookie( | |
'pum-123', // The cookie name that is checked prior to auto opening. | |
true, // Setting a cookie value of true. | |
'10 years', // Plain english time frame. | |
'/' // Cookie path of / means site wide. | |
); | |
}); |
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('wp_footer', 'my_custom_popup_scripts', 500 ); | |
function my_custom_popup_scripts() { ?> | |
<script type="text/javascript"> | |
jQuery('#popmake-123') | |
.on('popmakeBeforeOpen', function () { | |
var $iframe = jQuery('iframe', jQuery(this)), | |
src = $iframe.prop('src'); | |
$iframe.prop('src', '').prop('src', src + '/?autoplay=1'); |