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
add_shortcode('get_current_post_terms', function( $atts ) { | |
$atts = shortcode_atts( array( | |
'taxonomy' => 'category', | |
'limit' => '1', | |
'fields' => 'slugs', | |
'separator' => ',', | |
'print' => 0 | |
), $atts ); | |
global $post; |
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
/** | |
* Sticky 1.0.0 | |
* https://github.com/AchalJ | |
* | |
* Copyright (c) 2020 Achal Jain | |
* | |
* Licensed under the MIT License | |
*/ | |
(function(factory) { | |
if ( typeof define === 'function' && define.amd ) { |
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
// PP Header / Footer. | |
add_filter( 'pp_header_footer_theme_slug', 'acsend_pp_header_footer_slug' ); | |
function acsend_pp_header_footer_slug( $slug ) { | |
return 'ascend_premium'; | |
} | |
add_action( 'pp_header_footer_after_setup', 'acsend_pp_header_footer_setup' ); | |
function acsend_pp_header_footer_setup( $slug ) { | |
if ( 'ascend_premium' === $slug || 'ascend_premium_child' === $slug ) { | |
add_action( 'wp', 'acsend_pp_header_footer_init' ); |
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
add_shortcode( 'woo_wc_get_product_price', function( $args ) { | |
if ( ! isset( $args['id'] ) || empty( absint( $args['id'] ) ) ) { | |
return; | |
} | |
if ( ! function_exists( 'wc_get_product' ) ) { | |
return; | |
} | |
$id = absint( $args['id'] ); | |
$product = wc_get_product( $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
add_filter( 'pre_user_email', function( $email ) { | |
$allowed_domains = array( | |
'example.com', | |
'yoursite.com', | |
); | |
if ( ! is_email( $email ) ) { | |
return $email; | |
} |
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
// Add fields. | |
add_filter( 'pp_rf_fields', function( $fields, $settings, $id ) { | |
if ( isset( $fields['consent'] ) ) { | |
$consent = $fields['consent']; | |
unset( $fields['consent'] ); | |
} | |
$fields[] = array( | |
'name' => 'meta_address_field', | |
'label' => 'Address', | |
'type' => 'textarea', |
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
.pp-post-equal-align .pp-post-body { | |
height: 100%; | |
} | |
.pp-post-equal-align:not(.pp-content-alternate) .pp-post-body { | |
display: flex; | |
flex-direction: column; | |
} | |
.pp-post-equal-align .pp-post-info { | |
height: 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
add_filter( 'pp_rf_fields', function( $fields, $settings, $id ) { | |
if ( isset( $fields['consent'] ) ) { | |
$consent = $fields['consent']; | |
unset( $fields['consent'] ); | |
} | |
$fields[] = array( | |
'type' => 'text', | |
'name' => 'company_name', | |
'label' => 'Company Name', |
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
add_action( 'fl_page_data_add_properties', 'ac_add_field_connections' ); | |
function ac_add_field_connections() { | |
FLPageData::add_post_property( 'woocommerce_product_stock_status', array( | |
'label' => __( 'Product Image with Gallery Slider', 'woopack' ), | |
'group' => 'woocommerce', | |
'type' => 'string', | |
'getter' => 'ac_get_product_stock_status', | |
) ); | |
} |