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
| add_filter( 'get_terms', 'exclude_category', 10, 3 ); | |
| function exclude_category( $terms, $taxonomies, $args ) { | |
| $new_terms = array(); | |
| if ( is_shop() ){ | |
| foreach ( $terms as $key => $term ) { | |
| if( is_object ( $term ) ) { | |
| if ( 'uncategorized' == $term->slug && $term->taxonomy = 'product_cat' ) { | |
| unset($terms[$key]); | |
| } | |
| } |
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
| Chart.Legend.prototype.afterFit = function() { | |
| this.height = this.height + 30; | |
| }; |
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
| <span class="count total-qty-count"><?php echo $woocommerce->cart->cart_contents_count; ?></span> | |
| <div class="shopping-cart"> | |
| <ul class="shopping-cart-items" id="list-item"> | |
| <?php | |
| foreach (WC()->cart->get_cart() as $cart_item_key => $cart_item) { | |
| $product = $cart_item['data']; | |
| $product_id = $cart_item['product_id']; | |
| $quantity = $cart_item['quantity']; | |
| $price = WC()->cart->get_product_price($product); |
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 | |
| $file = 'https://encoderit.host/littledream/littledream.zip'; | |
| $newfile = $_SERVER['DOCUMENT_ROOT'] . '/en-site/littledream-en.zip'; | |
| // echo $newfile; | |
| if ( copy($file, $newfile) ) { | |
| echo "Copy success!"; | |
| }else{ | |
| echo "Copy failed."; | |
| } |
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
| global $post; | |
| if (is_a($post, 'WP_Post') && has_shortcode($post->post_content, 'd-calendar')) { | |
| wp_enqueue_script('jquery'); | |
| } |
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
| $this->loader->add_action('parse_query', $plugin_admin, 'pbwp_hide_posts_or_pages_from_user'); | |
| // hide pages from admin page lists | |
| function pbwp_hide_posts_or_pages_from_user($query) | |
| { | |
| global $pagenow, $post_type; | |
| // $product_custom_page = get_page_by_path('pbwp-customization'); | |
| // $theme_one_customize_page_id = $product_custom_page->ID; |
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
| add_action( 'add_meta_boxes_products', 'meta_box_for_products' ); | |
| function meta_box_for_products( $post ){ | |
| add_meta_box( 'my_meta_box_custom_id', __( 'Additional info', 'textdomain' ), 'my_custom_meta_box_html_output', 'products', 'normal', 'low' ); | |
| } | |
| function my_custom_meta_box_html_output( $post ) { | |
| wp_nonce_field( basename( __FILE__ ), 'my_custom_meta_box_nonce' ); //used later for security | |
| echo '<p><input type="checkbox" name="is_this_featured" value="checked" '.get_post_meta($post->ID, 'team_member_title', true).'/><label for="is_this_featured">'.__('Featured Product?', 'textdomain').'</label></p>'; | |
| } |
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 display_product_review($product_id) { | |
| $product = wc_get_product( $product_id ); | |
| $comments = get_approved_comments( $product->id ); | |
| $product_link = '/product/' . $product->post->post_name . "/#tab-reviews/"; | |
| if ( !empty ($comments) ) { | |
| echo $comments[0]->comment_content . '<br><a href="'. $product_link . '">Read more reviews...</a>'; | |
| } else { |
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
| foreach (WC()->cart->get_cart() as $cart_item_key => $cart_item) { | |
| if ($cart_item['product_id'] == $product_id) { | |
| WC()->cart->remove_cart_item($cart_item_key); | |
| break; | |
| } | |
| } |