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 | |
// Adds a custom rule type. | |
add_filter( 'acf/location/rule_types', function( $choices ){ | |
$choices[ __("Other",'acf') ]['wc_prod_attr'] = 'WC Product Attribute'; | |
return $choices; | |
} ); | |
// Adds custom rule values. | |
add_filter( 'acf/location/rule_values/wc_prod_attr', function( $choices ){ |
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( 'admin_init', 'prefix_reset_metabox_positions' ); | |
function prefix_reset_metabox_positions(){ | |
// for posts | |
delete_user_meta( wp_get_current_user()->ID, 'meta-box-order_post' ); | |
// for pages | |
delete_user_meta( wp_get_current_user()->ID, 'meta-box-order_page' ); | |
// for custom post type Sermon Series |
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 | |
// Outputs the button below the default Add to cart button on Single Product page | |
add_action('woocommerce_after_add_to_cart_button','hjs_add_quick_buy_link_single', 5); | |
function hjs_add_quick_buy_link_single() { ?> | |
<style> | |
.woocommerce div.product form.cart .button.quick-buy { | |
background: #f04e3d !important; | |
border-color: #f04e3d !important; | |
margin-left: 10px; | |
} |
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( 'gform_pre_submission', 'pre_submission_handler_one' ); | |
function pre_submission_handler_one( $form ) { | |
foreach ( $form['fields'] as $field ) { | |
$cssClass = $field->cssClass; | |
if ( strpos($cssClass, 'test') !== false) { | |
$field_id = $field->id; | |
$date = new DateTime( 'now' ); | |
$_POST["input_$field_id"] = $date->format('U'); | |
} |
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
rg_lead_meta -> gf_entry_meta | |
rg_lead_detail -> gf_entry_meta | |
rg_lead -> gf_entry | |
All lead_id columns -> entry_id | |
rg_form_meta -> gf_form_meta | |
rg_form_view -> gf_form_view | |
rg_form -> gf_form |
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
/* globals FWP */ | |
/** | |
* JavaScript for FacetWP Infinite Scroll | |
*/ | |
( function( $ ) { | |
'use-strict'; | |
var throttleTimer = null; | |
var throttleDelay = 100; |
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
/** | |
* @snippet Add New Tab to WooCommerce My Account Page | |
* @author Hire Jordan Smith // https://hirejordansmith.com | |
*/ | |
// Register new endpoint to use for My Account page | |
add_action( 'init', 'hjs_add_account_update_endpoint' ); | |
function hjs_add_account_update_endpoint() { | |
add_rewrite_endpoint( 'account-update', EP_ROOT | EP_PAGES ); | |
} |
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_shortcode( 'gallery', 'my_gallery_shortcode' ); | |
function my_gallery_shortcode( $atts ) { | |
$atts['link'] = 'file'; | |
return gallery_shortcode( $atts ); | |
} |
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
// This would be added to a callback or event function | |
// Replace "82" with the ID of your form | |
var gwrf = window.gwrf_82; | |
if( typeof gwrf != 'undefined' ) { | |
gwrf.reloadForm(); | |
} |
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 filters for Form ID 8 | |
add_filter( 'gform_pre_render_8', 'populate_posts' ); | |
add_filter( 'gform_pre_validation_8', 'populate_posts' ); | |
add_filter( 'gform_pre_submission_filter_8', 'populate_posts' ); | |
add_filter( 'gform_admin_pre_render_8', 'populate_posts' ); | |
function populate_posts( $form ) { | |
// Loop through each field searching for any "select" field with the class "populate-affs" |
NewerOlder