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 my_custom_post_types() { | |
| $args = array( | |
| 'label' => 'Recipes', | |
| 'hierarchical' => true, | |
| 'taxonomies => array( 'post_tag' ) | |
| ); | |
| register_post_type( 'recipe', $args ); | |
| } | |
| add_action( 'init', 'my_custom_post_types' ); |
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 | |
| /** | |
| * @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 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 | |
| if(!function_exists('wc_get_products')) { | |
| return; | |
| } | |
| $paged = (get_query_var('paged')) ? absint(get_query_var('paged')) : 1; | |
| $ordering = WC()->query->get_catalog_ordering_args(); | |
| $ordering['orderby'] = array_shift(explode(' ', $ordering['orderby'])); | |
| $ordering['orderby'] = stristr($ordering['orderby'], 'price') ? 'meta_value_num' : $ordering['orderby']; |
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 | |
| /** | |
| * Send "New User Registration" email to admins when new customer is created on WooCommerce. | |
| * | |
| * @param int $id New customer ID. | |
| */ | |
| function my_wc_customer_created_notification( $id ) { | |
| wp_new_user_notification( $id, null, 'admin' ); | |
| } |
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 | |
| /** | |
| * List available attributes on product page in a drop-down selection | |
| */ | |
| add_action('woocommerce_before_add_to_cart_button', 'list_attributes_on_product_page'); | |
| function list_attributes_on_product_page() { | |
| global $product; | |
| $attributes = $product->get_attributes(); |
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
| Afghanistan | |
| Albania | |
| Algeria | |
| Andorra | |
| Angola | |
| Antigua & Deps | |
| Argentina | |
| Armenia | |
| Australia | |
| Austria |