| @@ -17,9 +17,8 @@ | ||
| 17 | 17 | public function __construct() { |
| 18 | 18 | add_action( 'create_term', array($this,'wpstream_redo_transient') ); |
| 19 | 19 | add_action( 'edit_term', array($this,'wpstream_redo_transient') ); |
| 20 | 20 | add_action( 'delete_term', array($this,'wpstream_redo_transient') ); |
| 21 | - add_filter('manage_edit-product_columns', array($this,'remove_wpstream_category_column') ) ; | |
| 22 | 21 | } |
| 23 | 22 | |
| 24 | 23 | |
| 25 | 24 | public function wpstream_redo_transient(){ |
| @@ -190,9 +189,8 @@ | ||
| 190 | 189 | |
| 191 | 190 | $all_tax_labels=array(); |
| 192 | 191 | $property_action_category_values = get_transient('wpstream_woo_movie_category_values'); |
| 193 | 192 | if($property_action_category_values===false){ |
| 194 | - $property_action_category_values=array(); | |
| 195 | 193 | $terms_category = get_terms( array( |
| 196 | 194 | 'taxonomy' => 'wpstream_category', |
| 197 | 195 | 'hide_empty' => false, |
| 198 | 196 | ) ); |
| @@ -224,9 +222,8 @@ | ||
| 224 | 222 | $all_tax_labels=array(); |
| 225 | 223 | $movie_actors_values = get_transient('wpstream_woo_actors_category_values'); |
| 226 | 224 | |
| 227 | 225 | if($movie_actors_values===false){ |
| 228 | - $movie_actors_values=array(); | |
| 229 | 226 | $terms_actors= get_terms( array( |
| 230 | 227 | 'taxonomy' => 'wpstream_actors', |
| 231 | 228 | 'hide_empty' => false, |
| 232 | 229 | ) ); |
| @@ -261,9 +258,11 @@ | ||
| 261 | 258 | $product_cat= get_terms( array( |
| 262 | 259 | 'taxonomy' => 'product_cat', |
| 263 | 260 | 'hide_empty' => false, |
| 264 | 261 | ) ); |
| 265 | - $product_categ_values=array(); | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 266 | 265 | if( is_array($product_cat) ){ |
| 267 | 266 | foreach($product_cat as $term){ |
| 268 | 267 | $places[$term->name]= $term->term_id; |
| 269 | 268 | $temp_array=array(); |
| @@ -293,9 +292,8 @@ | ||
| 293 | 292 | $movie_ratiog= get_terms( array( |
| 294 | 293 | 'taxonomy' => 'wpstream_movie_rating', |
| 295 | 294 | 'hide_empty' => false, |
| 296 | 295 | ) ); |
| 297 | - $movie_rating_values=array(); | |
| 298 | 296 | if( is_array($movie_ratiog) ){ |
| 299 | 297 | foreach($movie_ratiog as $term){ |
| 300 | 298 | $places[$term->name]= $term->term_id; |
| 301 | 299 | $temp_array=array(); |
| @@ -401,9 +399,9 @@ | ||
| 401 | 399 | * CUSTOMIZE CUSTOM POST TYPE AS YOU WISH. |
| 402 | 400 | */ |
| 403 | 401 | |
| 404 | 402 | |
| 405 | - public function wpstream_category_callback_function($tag, $taxonomy){ | |
| 403 | + public function wpstream_category_callback_function($tag){ | |
| 406 | 404 | if(is_object ($tag)){ |
| 407 | 405 | $t_id = $tag->term_id; |
| 408 | 406 | $term_meta = get_option( "taxonomy_$t_id"); |
| 409 | 407 | $pagetax = $term_meta['pagetax'] ? $term_meta['pagetax'] : ''; |
| @@ -421,20 +419,20 @@ | ||
| 421 | 419 | print' |
| 422 | 420 | <table class="form-table"> |
| 423 | 421 | <tbody> |
| 424 | 422 | <tr class="form-field"> |
| 425 | - <th scope="row" valign="top"><label for="term_meta[pagetax]">'.esc_html__( 'Display the content for page id for this term','wpstream').'</label></th> | |
| 423 | + <th scope="row" valign="top"><label for="term_meta[pagetax]">'.esc_html__( 'Page id for this term','wpstream').'</label></th> | |
| 426 | 424 | <td> |
| 427 | 425 | <input type="text" name="term_meta[pagetax]" class="postform" value="'.$pagetax.'"> |
| 428 | - <p class="description">'.esc_html__( 'Display the content for page id for this term','wpstream').'</p> | |
| 426 | + <p class="description">'.esc_html__( 'Page id for this term','wpstream').'</p> | |
| 429 | 427 | </td> |
| 430 | 428 | |
| 431 | 429 | <tr valign="top"> |
| 432 | 430 | <th scope="row"><label for="category_featured_image">'.esc_html__( 'Featured Image','wpstream').'</label></th> |
| 433 | 431 | <td> |
| 434 | - <input id="category_featured_image" type="text" class="postform wpestate_landing_upload" size="36" name="term_meta[category_featured_image]" value="'.$category_featured_image.'" /> | |
| 432 | + <input id="category_featured_image" type="text" class="postform" size="36" name="term_meta[category_featured_image]" value="'.$category_featured_image.'" /> | |
| 435 | 433 | <input id="category_featured_image_button" type="button" class="upload_button button category_featured_image_button" value="'.esc_html__( 'Upload Image','wpstream').'" /> |
| 436 | - <input id="category_attach_id" class="wpestate_landing_upload_id" type="hidden" size="36" name="term_meta[category_attach_id]" value="'.$category_attach_id.'" /> | |
| 434 | + <input id="category_attach_id" type="hidden" size="36" name="term_meta[category_attach_id]" value="'.$category_attach_id.'" /> | |
| 437 | 435 | </td> |
| 438 | 436 | </tr> |
| 439 | 437 | |
| 440 | 438 | <tr valign="top"> |
| @@ -445,9 +443,9 @@ | ||
| 445 | 443 | </tr> |
| 446 | 444 | |
| 447 | 445 | |
| 448 | 446 | |
| 449 | - <input id="category_tax" type="hidden" size="36" name="term_meta[category_tax]" value="'.$taxonomy.'" /> | |
| 447 | + <input id="category_tax" type="hidden" size="36" name="term_meta[category_tax]" value="'.$tag->taxonomy.'" /> | |
| 450 | 448 | |
| 451 | 449 | |
| 452 | 450 | </tr> |
| 453 | 451 | </tbody> |
| @@ -487,11 +485,11 @@ | ||
| 487 | 485 | </div> |
| 488 | 486 | |
| 489 | 487 | <div class="form-field"> |
| 490 | 488 | <label for="term_meta[pagetax]">'. esc_html__( 'Featured Image','wpstream').'</label> |
| 491 | - <input id="category_featured_image" class="wpestate_landing_upload" type="text" size="36" name="term_meta[category_featured_image]" value="'.$category_featured_image.'" /> | |
| 489 | + <input id="category_featured_image" type="text" size="36" name="term_meta[category_featured_image]" value="'.$category_featured_image.'" /> | |
| 492 | 490 | <input id="category_featured_image_button" type="button" class="upload_button button category_featured_image_button" value="'.esc_html__( 'Upload Image','wpstream').'" /> |
| 493 | - <input id="category_attach_id" type="hidden" class="wpestate_landing_upload_id" size="36" name="term_meta[category_attach_id]" value="'.$category_attach_id.'" /> | |
| 491 | + <input id="category_attach_id" type="hidden" size="36" name="term_meta[category_attach_id]" value="'.$category_attach_id.'" /> | |
| 494 | 492 | |
| 495 | 493 | </div> |
| 496 | 494 | |
| 497 | 495 | <div class="form-field"> |
| @@ -497,9 +495,9 @@ | ||
| 497 | 495 | <div class="form-field"> |
| 498 | 496 | <label for="term_meta[category_tagline]">'. esc_html__( 'Category Tagline','wpstream').'</label> |
| 499 | 497 | <input id="category_tagline" type="text" size="36" name="term_meta[category_tagline]" value="'.$category_tagline.'" /> |
| 500 | 498 | </div> |
| 501 | - <input id="category_tax" type="hidden" size="36" name="term_meta[category_tax]" value="'.$tag.'" /> | |
| 499 | + <input id="category_tax" type="hidden" size="36" name="term_meta[category_tax]" value="'.$tag->taxonomy.'" /> | |
| 502 | 500 | '; |
| 503 | 501 | } |
| 504 | 502 | |
| 505 | 503 | /** |
| @@ -574,9 +572,9 @@ | ||
| 574 | 572 | ), |
| 575 | 573 | 'menu_position' => 20, |
| 576 | 574 | 'public' => true, |
| 577 | 575 | 'publicly_queryable' => true, |
| 578 | - 'exclude_from_search' => false, | |
| 576 | + 'exclude_from_search' => true, | |
| 579 | 577 | 'show_ui' => true, |
| 580 | 578 | 'show_in_menu' => true, |
| 581 | 579 | 'query_var' => true, |
| 582 | 580 | 'show_in_admin_bar' => true, |
| @@ -583,9 +581,8 @@ | ||
| 583 | 581 | 'show_in_nav_menus' => true, |
| 584 | 582 | 'supports' => array( |
| 585 | 583 | 'title', |
| 586 | 584 | 'editor', |
| 587 | - 'excerpt', | |
| 588 | 585 | 'thumbnail', |
| 589 | 586 | 'comments', |
| 590 | 587 | |
| 591 | 588 | ), |
| @@ -599,9 +596,9 @@ | ||
| 599 | 596 | array( |
| 600 | 597 | 'taxonomy' => 'wpstream_actors', |
| 601 | 598 | 'plural' => esc_html__('Actors','wpstream'), |
| 602 | 599 | 'single' => esc_html__('Actor','wpstream'), |
| 603 | - 'post_types' => array('wpstream_product','product','wpstream_product_vod','wpstream_bundles'), | |
| 600 | + 'post_types' => array('wpstream_product','product','wpstream_product_vod'), | |
| 604 | 601 | 'hierarchical' => true, |
| 605 | 602 | 'query_var' => true, |
| 606 | 603 | 'rewrite' => array( 'slug' => 'actors' ) |
| 607 | 604 | ), |
| @@ -609,9 +606,9 @@ | ||
| 609 | 606 | array( |
| 610 | 607 | 'taxonomy' => 'wpstream_category', |
| 611 | 608 | 'plural' => esc_html__('Media Categories','wpstream'), |
| 612 | 609 | 'single' => esc_html__('Media Category','wpstream'), |
| 613 | - 'post_types' => array('wpstream_product','product','wpstream_product_vod','wpstream_bundles'), | |
| 610 | + 'post_types' => array('wpstream_product','product','wpstream_product_vod'), | |
| 614 | 611 | 'hierarchical' => true, |
| 615 | 612 | 'query_var' => true, |
| 616 | 613 | 'rewrite' => array( 'slug' => 'media_category' ) |
| 617 | 614 | ), |
| @@ -619,9 +616,9 @@ | ||
| 619 | 616 | array( |
| 620 | 617 | 'taxonomy' => 'wpstream_movie_rating', |
| 621 | 618 | 'plural' => esc_html__('Movie Ratings','wpstream'), |
| 622 | 619 | 'single' => esc_html__('Movie Rating','wpstream'), |
| 623 | - 'post_types' => array('wpstream_product','product','wpstream_product_vod','wpstream_bundles'), | |
| 620 | + 'post_types' => array('wpstream_product','product','wpstream_product_vod'), | |
| 624 | 621 | 'hierarchical' => true, |
| 625 | 622 | 'query_var' => true, |
| 626 | 623 | 'rewrite' => array( 'slug' => 'rating' ) |
| 627 | 624 | ), |
| @@ -650,9 +647,9 @@ | ||
| 650 | 647 | ), |
| 651 | 648 | 'menu_position' => 20, |
| 652 | 649 | 'public' => true, |
| 653 | 650 | 'publicly_queryable' => true, |
| 654 | - 'exclude_from_search' => false, | |
| 651 | + 'exclude_from_search' => true, | |
| 655 | 652 | 'show_ui' => true, |
| 656 | 653 | 'show_in_menu' => true, |
| 657 | 654 | 'query_var' => true, |
| 658 | 655 | 'show_in_admin_bar' => true, |
| @@ -659,9 +656,8 @@ | ||
| 659 | 656 | 'show_in_nav_menus' => true, |
| 660 | 657 | 'supports' => array( |
| 661 | 658 | 'title', |
| 662 | 659 | 'editor', |
| 663 | - 'excerpt', | |
| 664 | 660 | 'thumbnail', |
| 665 | 661 | 'comments', |
| 666 | 662 | |
| 667 | 663 | ), |
| @@ -671,68 +667,10 @@ | ||
| 671 | 667 | ), |
| 672 | 668 | |
| 673 | 669 | ); |
| 674 | 670 | |
| 675 | - if( function_exists('wpstream_custom_theme_customizer')){ | |
| 676 | - $post_types_fields[] = array( | |
| 677 | - | |
| 678 | - 'slug' => 'wpstream_bundles', | |
| 679 | - 'singular' => __( 'Video Collection','wpstream'), | |
| 680 | - 'plural' => __( 'Video Collections','wpstream'), | |
| 681 | - 'menu_name' => __( 'Video Collections','wpstream'), | |
| 682 | - 'description' => __( 'Video Collections','wpstream'), | |
| 683 | - | |
| 684 | - 'labels' => array( | |
| 685 | - 'name' => esc_html__( 'Video Collections', 'wpstream' ), | |
| 686 | - 'singular_name' => esc_html__( 'Video Collection', 'wpstream' ), | |
| 687 | - 'add_new' => esc_html__( 'Add New Video Collection', 'wpstream' ), | |
| 688 | - 'add_new_item' => esc_html__( 'Add Video Collection', 'wpstream' ), | |
| 689 | - 'edit' => esc_html__( 'Edit', 'wpstream' ), | |
| 690 | - 'edit_item' => esc_html__( 'Edit Video Collection', 'wpstream' ), | |
| 691 | - 'new_item' => esc_html__( 'New Video Collection', 'wpstream' ), | |
| 692 | - 'view' => esc_html__( 'View', 'wpstream' ), | |
| 693 | - 'view_item' => esc_html__( 'View Video Collection', 'wpstream' ), | |
| 694 | - 'search_items' => esc_html__( 'Search Video Collection By Name or ID', 'wpstream' ), | |
| 695 | - 'not_found' => esc_html__( 'No Video Collection found', 'wpstream' ), | |
| 696 | - 'not_found_in_trash' => esc_html__( 'No Video Collection found in Trash', 'wpstream' ), | |
| 697 | - 'parent' => esc_html__( 'Parent Video Collection', 'wpstream' ), | |
| 698 | - 'featured_image' => esc_html__( 'Featured Image', 'wpstream' ), | |
| 699 | - 'set_featured_image' => esc_html__( 'Set Featured Image', 'wpstream' ), | |
| 700 | - 'remove_featured_image' => esc_html__( 'Remove Featured Image', 'wpstream' ), | |
| 701 | - 'use_featured_image' => esc_html__( 'Use Featured Image', 'wpstream' ), | |
| 702 | - ), | |
| 703 | - | |
| 704 | - 'has_archive' => true, | |
| 705 | - 'hierarchical' => false, | |
| 706 | - 'menu_icon' => WPSTREAM_PLUGIN_DIR_URL.'img/wpstream-icon-menu_2.png', | |
| 707 | - 'rewrite' => array( 'slug' => 'wpstream_bundles' ), | |
| 708 | - 'menu_position' => 20, | |
| 709 | - 'public' => true, | |
| 710 | - 'publicly_queryable' => true, | |
| 711 | - 'show_in_rest' => true, | |
| 712 | - 'exclude_from_search' => false, | |
| 713 | - 'show_ui' => true, | |
| 714 | - 'show_in_menu' => true, | |
| 715 | - 'query_var' => true, | |
| 716 | - 'show_in_admin_bar' => true, | |
| 717 | - 'show_in_nav_menus' => true, | |
| 718 | - 'supports' => array( | |
| 719 | - 'title', | |
| 720 | - 'editor', | |
| 721 | - 'excerpt', | |
| 722 | - 'thumbnail', | |
| 723 | - 'comments', | |
| 724 | - | |
| 725 | - ), | |
| 726 | - 'custom_caps' => true, | |
| 727 | - 'custom_caps_users' => array( | |
| 728 | - 'administrator', | |
| 729 | - ), | |
| 730 | - | |
| 731 | - ); | |
| 732 | - } | |
| 733 | - | |
| 734 | 671 | |
| 672 | + | |
| 735 | 673 | // loop torugh custom post type array and register |
| 736 | 674 | foreach ( $post_types_fields as $fields ) { |
| 737 | 675 | $this->register_single_post_type( $fields ); |
| 738 | 676 | } |
| @@ -775,21 +713,9 @@ | ||
| 775 | 713 | } |
| 776 | 714 | |
| 777 | 715 | |
| 778 | 716 | |
| 779 | - | |
| 780 | - /* | |
| 781 | - *Remove the custom taxonomy column from the WooCommerce product list | |
| 782 | - */ | |
| 783 | - function remove_wpstream_category_column($columns) { | |
| 784 | - if (isset($columns['taxonomy-wpstream_category'])) { | |
| 785 | - unset($columns['taxonomy-wpstream_category']); | |
| 786 | - unset($columns['taxonomy-wpstream_actors']); | |
| 787 | - unset($columns['taxonomy-wpstream_movie_rating']); | |
| 788 | - } | |
| 789 | - return $columns; | |
| 790 | - } | |
| 791 | - | |
| 717 | + | |
| 792 | 718 | |
| 793 | 719 | |
| 794 | 720 | |
| 795 | 721 | } |