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 | |
// For iBid Auctions theme: https://themeforest.net/item/ibid-multi-vendor-auctions-woocommerce-theme/24923136 | |
function ibid_outbid_always_notice_product_page() { | |
if (is_user_logged_in() && is_singular('product')) { | |
$user_id = get_current_user_id(); | |
$notice_type = 'error'; | |
// if ($user_id == '35') { |
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 | |
function ibid_update_language_wpml_option() { | |
if(is_user_logged_in()){ | |
$user_id = get_current_user_id(); | |
$language_value = ICL_LANGUAGE_CODE; | |
update_user_meta( $user_id, 'locale', sanitize_text_field( $language_value ) ); | |
} | |
} |
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 | |
// CMB2 with Prefix | |
function prefix_default_offer_id_by_offer_id( $field_args, $field ) { | |
return 'prefix_'. $field->object_id; | |
} | |
$cmb->add_field( array( | |
'name' => esc_html__( 'Nr. Oferta', 'cmb2' ), | |
'id' => 'woopog_offer_id', | |
'type' => 'text', |
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
select { | |
background-image: linear-gradient( 45deg,transparent 50%,gray 0),linear-gradient( 135deg,gray 50%,transparent 0),linear-gradient( 90deg,#ccc,#ccc); | |
background-position: calc(100% - 18px) calc(1em + 1px),calc(100% - 13px) calc(1em + 1px),calc(100% - 2.5em) .5em; | |
background-size: 6px 5px,6px 5px,0 1.5em; | |
width: 100%; | |
background-repeat: no-repeat; | |
appearance: none !important; | |
-moz-appearance: none !important; | |
-o-appearance: none !important; | |
-webkit-appearance: none !important; |
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 | |
/** | |
* @snippet WooCommerce How To Add New Tab @ My Account | |
* @how-to Watch tutorial @ https://techiesandesh.com | |
* @author Sandesh Jangam | |
* @compatible WooCommerce 3.6.2 | |
* @donate $7 https://www.paypal.me/SandeshJangam/7 | |
*/ | |
/** |
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_filter( 'register_post_type_args', 'modeltheme_register_post_type_args', 10, 2 ); | |
function modeltheme_register_post_type_args( $args, $post_type ) { | |
if ( 'mt_listing' === $post_type ) { | |
$args['rewrite']['slug'] = 'new-casino-slug'; /*ADD YOUR OWN SERMON SLUG ONLY ON THIS LINE */ | |
} | |
return $args; | |
} |
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 | |
function modeltheme_update_taxonomy_slug() { | |
// Current taxonomy name (not slug) -> 'mt-listing-payment-methods' | |
$sermon_category_args = get_taxonomy( 'mt-listing-payment-methods' ); // returns an object | |
$sermon_category_args->show_admin_column = true; | |
// Here we will add the new slug 'payment' instead of 'payment-methods' | |
$sermon_category_args->rewrite['slug'] = 'payment'; /* HERE WE ADDED THE NEW LINK ------*/ | |
$sermon_category_args->rewrite['with_front'] = false; | |
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 | |
/** | |
* | |
* Get deepest product category woocommerce | |
* @param $product_id is the id of a product | |
* | |
*/ | |
function prefix_get_deepest_product_category($product_id = ''){ | |
// get all product cats for the current post | |
$categories = get_the_terms( $product_id, 'product_cat' ); |
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( 'cmb2_admin_init', 'yourprefix_register_repeatable_group_field_metabox' ); | |
/** | |
* Hook in and add a metabox to demonstrate repeatable grouped fields | |
*/ | |
function yourprefix_register_repeatable_group_field_metabox() { | |
/** | |
* Repeatable Field Groups |