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 | |
/* | |
* SQL doesn't care that the terms come from different taxonomies, but WP_Query does because they're looked up by slug. So the query it generates is very innefficient. | |
* These filters will combine the various taxoomy ids into a single array so query can be simplified | |
*/ | |
$search_args['tax_query'] = array( | |
'relation' => 'OR', | |
); | |
if ( !empty($query_vars['size']) ) { |
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 | |
/** | |
* Customize form page title if errors present | |
*/ | |
add_filter('frm_validate_entry', function ( $errors, $values ) { | |
if ( !empty($errors) ) { | |
add_filter( 'pre_get_document_title', function( $title ) { | |
return 'Errors Found - ' . $title; | |
}, 999, 1 ); | |
} |
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 | |
public function get_product_qty_in_orders( $product_id, $order_status ) | |
{ | |
global $wpdb; | |
if ( is_string($order_status) ) { | |
$order_status = array($order_status); | |
} | |
if ( !empty($product_id) && !empty($order_status) && is_array($order_status) ) { |
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 | |
private function get_icon_array_version_5() { | |
$icons_metadata = $this->get_icons_metadata(); | |
$icons = array(); | |
// Add style prefixes. | |
foreach ( $icons_metadata as $slug => $metadata ) { | |
if ( !empty($metadata['search']['terms']) ) { |
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
/** | |
* Modify the transaction data sent to Authorize.net | |
* Ref: plugins/gravityformsauthorizenet/authorizenet.php | |
* Ref: https://legacy.forums.gravityhelp.com/topic/sending-additional-information-to-authorizenet-via-namevalue-pairs | |
*/ | |
add_action( 'gform_authorizenet_transaction_pre_capture', 'app_gform_authorizenet_transaction_pre_capture', 10, 5 ); | |
function app_gform_authorizenet_transaction_pre_capture( $transaction, $form_data, $config, $form, $entry ) | |
{ | |
if ( $form['id'] == 14 ) { |
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
(?s)<div class="something".*?<\/div> |
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 App = { | |
floodlight: { | |
createFloodlightTagUrl: function(floodlightOptions){ | |
var tagUrl = 'https://' + floodlightOptions.src + '.fls.doubleclick.net/activityi' + | |
';src=' + floodlightOptions.src + | |
';type=' + floodlightOptions.type + | |
';cat=' + floodlightOptions.cat + | |
';dc_lat=' + floodlightOptions.dc_lat + | |
';dc_rdid=' + floodlightOptions.dc_rdid + |
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 | |
/** | |
* Process custom app_transaction_id merge tag | |
* Note: Add the string: {app_transaction_id} in your email notification body | |
*/ | |
add_filter('gform_replace_merge_tags', 'app_gform_replace_merge_tags__app_transaction_id', 10, 7); | |
function app_gform_replace_merge_tags__app_transaction_id( $text, $form, $entry, $url_encode, $esc_html, $nl2br, $format ) | |
{ | |
$merge_tag = '{app_transaction_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 | |
/* From https://www.usps.com/send/official-abbreviations.htm */ | |
$us_state_abbrevs_names = array( | |
'AL'=>'ALABAMA', | |
'AK'=>'ALASKA', | |
'AS'=>'AMERICAN SAMOA', | |
'AZ'=>'ARIZONA', | |
'AR'=>'ARKANSAS', |
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
a.close { | |
color: transparent; | |
display: block; | |
height: 32px; | |
position: fixed; | |
right: 0; | |
top: 0; | |
transition: transform .25s ease-in-out; | |
width: 32px; |
NewerOlder