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 curl_to_hubspot($entry, $str_post, $form_ID){ | |
$hubspotutk = $_COOKIE['hubspotutk']; | |
$portalID = '******'; //HubSpot USER ID | |
$hs_context = array( | |
'hutk' => $hubspotutk, | |
'ipAddress' => $entry['ip'], | |
'pageURL' => $entry['source_url'], | |
'pageName' => get_the_title( $entry['post_id']) |
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 | |
add_filter( 'acf/location/rule_types', 'acf_location_rules_types', 999 ); | |
function acf_location_rules_types( $choices ) { | |
$tax_label = __( 'News Type' ); //<--YOUR LABEL | |
$key = __('Forms', 'acf'); | |
if ( ! isset( $choices[ $key ] ) ) { | |
$choices[ $key ] = []; | |
} |
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
/** | |
* CF7 Optimize Enqueue | |
*/ | |
add_action( 'wp_enqueue_scripts', 'cf7_optimize_equeues' ); | |
add_action( 'admin_enqueue_scripts', 'cf7_optimize_equeues' ); | |
function cf7_optimize_equeues(){ | |
global $post; | |
if( !class_exists( 'WPCF7' ) || !$post ) { | |
return; |
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 | |
/** | |
* @title: WC Mini Cart | |
* @usage: echo do_shortcode( '[xcminicart]' ); | |
*/ | |
if ( ! class_exists( 'WooCommerce' ) ) { | |
return; | |
} |
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 | |
/** | |
* Create the image attachment and return the new media upload id. | |
* | |
* @param $fileObject | |
* @return false|int|WP_Error | |
* @see http://codex.wordpress.org/Function_Reference/wp_insert_attachment#Example | |
* @since 1.0.0 | |
*/ |
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
//Delete all POSTS META | |
DELETE | |
FROM `wp_postmeta` | |
WHERE post_id in (SELECT id | |
FROM `wp_posts` | |
WHERE `post_type` = 'post' ) | |
//Delete all POSTS | |
DELETE FROM `wp_posts` | |
WHERE `post_type` = 'post' |
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 geocode($address) | |
{ | |
// url encode the address | |
$address = urlencode($address); | |
$apiKey = GMAP_API_KEY; | |
// google map geocode api url | |
$url = "https://maps.googleapis.com/maps/api/geocode/json?address={$address}&key={$apiKey}"; | |
// get the json response | |
$resp_json = file_get_contents($url); | |
// decode the json |
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 | |
/** | |
* Class XC_ProductCategories | |
* @usage $cat_list = new XC_ProductCategories(); | |
* @usage $cat_list->render($attributes); | |
*/ | |
class XC_ProductCategories { | |
public $defaults |
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
$(document).ajaxComplete(function (event, xhr, settings) { | |
//if (!settings.url.includes('update_listing_account')) { return; } | |
if (typeof settings.data != 'object') { return } | |
if (settings.data.get('action') != 'update_listing_account') { return } | |
if (typeof xhr.responseText != 'undefined') { | |
const response = $.parseJSON(xhr.responseText) | |
} | |
}); |
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 | |
$query_args = array( | |
'post_type' => [ 'product_variation', 'product' ], | |
'posts_per_page' => - 1, | |
'meta_query' => array( | |
'relation' => 'AND', | |
array( | |
'key' => '_sale_price_dates_from', | |
'value' => time(), |
OlderNewer