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
add_shortcode( "echo_static_html_cache", "echo_static_html_cache_callback"); | |
function echo_static_html_cache_callback( $atts ) { | |
$cache_dir = get_template_directory() . '/static-cache/'; | |
if ( ! is_dir( $cache_dir ) ) { | |
mkdir( $cache_dir ); | |
} |
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
$(".removeDeveloper").on( 'click', function() { | |
var usertodelete = $(this).data('usertodelete'); | |
var email = $(this).data('email'); | |
var displayName = $(this).data('userdisplayname'); | |
var nonce = $(this).data('nonce'); | |
// let emailConfirm = prompt(`Are you sure you want to remove ${displayName}? | |
// This function is to be used only when a developer has left your organisation. It will deactivate ALL their current activations and will mark their email address as deleted so that email will NOT be able to activate again. DO NOT use this to remove a single activation. Contact support@scichart.com instead. If you are sure you want to permanently remove this user, enter their email address to confirm`, ""); | |
var modal_input_email = $(this).closest( 'input' ).val(); |
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 getDatesFromRange($start, $end, $format = 'Y-m-d'){ | |
// Declare an empty array | |
$array = array(); | |
// Variable that store the date interval | |
// of period 1 day | |
$interval = new DateInterval('P1D'); | |
$realEnd = new DateTime($end); | |
$realEnd->add($interval); | |
$period = new DatePeriod(new DateTime($start), $interval, $realEnd); | |
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
<script> | |
jQuery(function(){ | |
$el = $( '#mk-text-block-544' ); | |
$el.find( 'img' ).attr( 'src', '{abhi, please replace this with the correct image url}' ) | |
$el.find( 'a' ).attr( 'hred', '{abhi, please replace this with the correct url}' ) | |
}) | |
</script> |
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
location ~* ^/(demo|react)$ { | |
proxy_pass https://phpstack-931910-5120025.cloudwaysapps.com; # Forward to the target URL | |
proxy_set_header Host "phpstack-931910-5120025.cloudwaysapps.com"; # Pass the original host header | |
proxy_set_header X-Real-IP $remote_addr; # Pass the real IP of the client | |
proxy_set_header X-Forwarded-For $remote_addr; # Forward the client IP through proxies | |
proxy_set_header X-Forwarded-Proto $scheme; # Pass the protocol (http or https) | |
proxy_ssl_verify off; # Disable SSL verification (for self-signed certs) | |
} | |
location ~* ^/(bundle.js|images|style.css) { |
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 jfs_product_pre_get_posts( $query ) { | |
if ( $query->is_main_query() ) { | |
if ( in_array ( $query->get('post_type'), array('slug_nung_prdoucts') ) ) { | |
$query->set( 'posts_per_page', 50 ); | |
} | |
} | |
} | |
add_action( 'pre_get_posts', 'jfs_product_pre_get_posts' ); |
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
add_action('woocommerce_thankyou', 'bofi_push_purchase_data_to_datalayer'); | |
function bofi_push_purchase_data_to_datalayer($order_id) { | |
$order = wc_get_order($order_id); | |
if ( !$order ) return; | |
$items = []; | |
foreach ($order->get_items() as $item) { |
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
stdClass Object | |
( | |
[standard] => stdClass Object | |
( | |
[items] => Array | |
( | |
[0] => stdClass Object | |
( | |
[id] => 119931 | |
[label] => 12V Power Socket in Boot |