{"id":20207,"date":"2021-08-22T19:00:08","date_gmt":"2021-08-22T14:30:08","guid":{"rendered":"https:\/\/www.themento.net\/fa\/?p=20207"},"modified":"2021-08-23T11:55:40","modified_gmt":"2021-08-23T07:25:40","slug":"hide-missing-products-in-woocommerce","status":"publish","type":"post","link":"https:\/\/www.themento.net\/fa\/20207\/hide-missing-products-in-woocommerce\/","title":{"rendered":"\u0645\u062e\u0641\u06cc \u06a9\u0631\u062f\u0646 \u0645\u062d\u0635\u0648\u0644\u0627\u062a \u0646\u0627\u0645\u0648\u062c\u0648\u062f \u062f\u0631 \u0648\u0648\u06a9\u0627\u0645\u0631\u0633"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"20207\" class=\"elementor elementor-20207\" data-elementor-post-type=\"post\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-71ff87fc elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"71ff87fc\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-688904dc\" data-id=\"688904dc\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-3b0f6d4c elementor-widget elementor-widget-text-editor\" data-id=\"3b0f6d4c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<span style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" data-mce-type=\"bookmark\" class=\"mce_SELRES_start\">\ufeff<\/span>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-818b4f3 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"818b4f3\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-c0cf541\" data-id=\"c0cf541\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-2297ad9 elementor-widget elementor-widget-text-editor\" data-id=\"2297ad9\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>\u0634\u0627\u06cc\u062f \u0628\u0631\u0627\u06cc \u0645\u0627 \u067e\u06cc\u0634 \u0628\u06cc\u0627\u062f \u06a9\u0647 \u0645\u062d\u0635\u0648\u0644\u0627\u062a\u06cc \u06a9\u0647 \u062a\u0648\u06cc \u0641\u0631\u0648\u0634\u06af\u0627\u0647 \u0645\u0627 \u0646\u0627\u0645\u0648\u062c\u0648\u062f \u0645\u06cc\u0634\u0646 \u062a\u0648\u06cc \u0635\u0641\u062d\u0647 \u0641\u0631\u0648\u0634\u06af\u0627\u0647 \u0648 \u0644\u06cc\u0633\u062a \u0645\u062d\u0635\u0648\u0644\u0627\u062a \u062f\u06cc\u062f\u0647 \u0646\u0634\u0648\u0646\u062f \u0648 \u0647\u0631 \u0632\u0645\u0627\u0646 \u0645\u0648\u062c\u0648\u062f \u0634\u062f\u0646\u062f \u0645\u062c\u062f\u062f \u062f\u0631 \u0644\u06cc\u0633\u062a \u062a\u0631\u062a\u06cc\u0628 \u0628\u0646\u062f\u06cc \u0645\u062d\u0635\u0648\u0644\u0627\u062a \u0646\u0645\u0627\u06cc\u0634 \u062f\u0627\u062f\u0647 \u0634\u0648\u0646\u062f \u0648 \u0628\u0631\u0627\u06cc \u0627\u06cc\u0646 \u06a9\u0627\u0631 \u0627\u0632 \u062f\u0648 \u0631\u0648\u0634 \u0627\u06cc\u0646 \u062a\u0646\u0638\u06cc\u0645\u0627\u062a \u0631\u0627 \u0627\u0646\u062c\u0627\u0645 \u0645\u06cc\u062f\u06cc\u0645 \u06a9\u0647 \u0627\u062f\u0627\u0645\u0647 \u0622\u0645\u0648\u0632\u0634 \u0631\u0627 \u0647\u0645\u0631\u0627\u0647 \u0645\u0627 \u0628\u0627\u0634\u06cc\u062f:<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-4fd0ec8 elementor-widget elementor-widget-heading\" data-id=\"4fd0ec8\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">\u0645\u062e\u0641\u06cc \u06a9\u0631\u062f\u0646 \u0645\u062d\u0635\u0648\u0644\u0627\u062a \u0646\u0627\u0645\u0648\u062c\u0648\u062f \u0627\u0632 \u0648\u0648\u06a9\u0627\u0645\u0631\u0633 \u0648 \u0641\u0631\u0648\u0634\u06af\u0627\u0647 \u0633\u0627\u06cc\u062a<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-fcc6b21 elementor-widget elementor-widget-text-editor\" data-id=\"fcc6b21\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>\u0628\u0631\u0627\u06cc \u0627\u06cc\u0646\u06a9\u0627\u0631 \u0627\u0632 \u067e\u06cc\u0634\u062e\u0648\u0627\u0646 \u0648\u0631\u062f\u067e\u0631\u0633 \u0648\u0627\u0631\u062f \u0628\u062e\u0634 &#8220;<span style=\"color: #0000ff;\">\u0648\u0648\u06a9\u0627\u0645\u0631\u0633 \u00bb \u067e\u06cc\u06a9\u0631\u0628\u0646\u062f\u06cc \u00bb \u062a\u0628 \u0645\u062d\u0635\u0648\u0644\u0627\u062a \u00bb \u062a\u0628 \u0641\u0647\u0631\u0633\u062a \u0645\u0648\u062c\u0648\u062f\u06cc<\/span>&#8221; \u0628\u0634\u06cc\u062f \u0648 \u062a\u06cc\u06a9 \u06af\u0632\u06cc\u0646\u0647 &#8220;<span style=\"color: #ff0000;\">\u0645\u062e\u0641\u06cc \u06a9\u0631\u062f\u0646 \u0645\u062d\u0635\u0648\u0644\u0627\u062a\u06cc \u06a9\u0647 \u062f\u0631 \u0627\u0646\u0628\u0627\u0631 \u0645\u0648\u062c\u0648\u062f \u0646\u06cc\u0633\u062a\u0646\u062f<\/span>&#8221; \u0631\u0627 \u0628\u0632\u0646\u06cc\u062f \u0648 \u062a\u0646\u0638\u06cc\u0645\u0627\u062a \u0631\u0627 \u0630\u062e\u06cc\u0631\u0647 \u06a9\u0646\u06cc\u062f.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-39dcedd elementor-widget elementor-widget-image\" data-id=\"39dcedd\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"https:\/\/www.themento.net\/fa\/wp-content\/uploads\/2021\/08\/woo-hide-unavilable-products.jpg\" data-elementor-open-lightbox=\"yes\" data-elementor-lightbox-title=\"woo-hide-unavilable-products\" data-e-action-hash=\"#elementor-action%3Aaction%3Dlightbox%26settings%3DeyJpZCI6MjAyMTAsInVybCI6Imh0dHBzOlwvXC93d3cudGhlbWVudG8ubmV0XC9mYVwvd3AtY29udGVudFwvdXBsb2Fkc1wvMjAyMVwvMDhcL3dvby1oaWRlLXVuYXZpbGFibGUtcHJvZHVjdHMuanBnIn0%3D\">\n\t\t\t\t\t\t\t<img fetchpriority=\"high\" decoding=\"async\" width=\"2531\" height=\"1705\" src=\"https:\/\/www.themento.net\/fa\/wp-content\/uploads\/2021\/08\/woo-hide-unavilable-products.jpg\" class=\"attachment-full size-full wp-image-20210\" alt=\"\" srcset=\"https:\/\/www.themento.net\/fa\/wp-content\/uploads\/2021\/08\/woo-hide-unavilable-products.jpg 2531w, https:\/\/www.themento.net\/fa\/wp-content\/uploads\/2021\/08\/woo-hide-unavilable-products-600x404.jpg 600w, https:\/\/www.themento.net\/fa\/wp-content\/uploads\/2021\/08\/woo-hide-unavilable-products-300x202.jpg 300w, https:\/\/www.themento.net\/fa\/wp-content\/uploads\/2021\/08\/woo-hide-unavilable-products-1024x690.jpg 1024w, https:\/\/www.themento.net\/fa\/wp-content\/uploads\/2021\/08\/woo-hide-unavilable-products-768x517.jpg 768w, https:\/\/www.themento.net\/fa\/wp-content\/uploads\/2021\/08\/woo-hide-unavilable-products-1536x1035.jpg 1536w, https:\/\/www.themento.net\/fa\/wp-content\/uploads\/2021\/08\/woo-hide-unavilable-products-2048x1380.jpg 2048w\" sizes=\"(max-width: 2531px) 100vw, 2531px\" title=\"\">\t\t\t\t\t\t\t\t<\/a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-0ed97a6 elementor-widget elementor-widget-text-editor\" data-id=\"0ed97a6\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>\u062f\u0631 \u0635\u0648\u0631\u062a\u06cc \u06a9\u0647 \u0628\u0627 \u0631\u0648\u0634 \u0628\u0627\u0644\u0627 \u0646\u062a\u0648\u0646\u0633\u062a\u06cc\u062f \u0645\u062d\u0635\u0648\u0644\u0627\u062a \u0646\u0627\u0645\u0648\u062c\u0648\u062f \u0631\u0627 \u0627\u0632 \u062f\u06cc\u062f \u06a9\u0627\u0631\u0628\u0631 \u062e\u0627\u0631\u062c \u06a9\u0646\u06cc\u062f \u0645\u06cc\u062a\u0648\u0627\u0646\u06cc\u062f \u0627\u0632 \u06a9\u062f \u0632\u06cc\u0631 \u0628\u0631\u0627\u06cc \u0627\u06cc\u0646 \u06a9\u0627\u0631 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f \u0648 \u0627\u06cc\u0646 \u06a9\u062f \u0631\u0627 \u062f\u0631 \u0641\u0627\u06cc\u0644 function.php \u0642\u0627\u0644\u0628 \u062e\u0648\u062f \u06cc\u0627 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0622\u0645\u0648\u0632\u0634 &#8220;<a href=\"https:\/\/www.themento.net\/fa\/18784\/insert-and-inject-php-code-in-wordpress\/\">\u0642\u0631\u0627\u0631 \u062f\u0627\u062f\u0646 \u0648 \u062a\u0632\u0631\u06cc\u0642 \u06a9\u062f php \u062f\u0631 \u0648\u0631\u062f\u067e\u0631\u0633 \u0628\u062f\u0648\u0646 \u062f\u0633\u062a\u06a9\u0627\u0631\u06cc \u0642\u0627\u0644\u0628<\/a>&#8221; \u0627\u06cc\u0646 \u06a9\u062f \u0631\u0627 \u062f\u0631 \u0633\u0627\u06cc\u062a \u062e\u0648\u062f \u0641\u0631\u0627\u062e\u0648\u0627\u0646\u06cc \u06a9\u0646\u06cc\u062f:<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2cdae9d elementor-widget elementor-widget-bdt-source-code\" data-id=\"2cdae9d\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"bdt-source-code.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\n\n        <div class=\"bdt-source-code prism-okaidia\">\n\n\t\t\t                <button class=\"bdt-copy-button\">Copy<\/button>\n\t\t\t<pre class=\"language-php\"><code>add_action( &#039;pre_get_posts&#039;, &#039;tmt_hide_out_of_stock_products&#039; );\n \nfunction tmt_hide_out_of_stock_products( $q ) {\n \n    if ( ! $q-&gt;is_main_query() || is_admin() ) {\n        return;\n    }\n \n    if ( $outofstock_term = get_term_by( &#039;name&#039;, &#039;outofstock&#039;, &#039;product_visibility&#039; ) ) {\n \n        $tax_query = (array) $q-&gt;get(&#039;tax_query&#039;);\n \n        $tax_query[] = array(\n            &#039;taxonomy&#039; =  &#039;product_visibility&#039;,\n            &#039;field&#039; =  &#039;term_taxonomy_id&#039;,\n            &#039;terms&#039; =  array( $outofstock_term-&gt;term_taxonomy_id ),\n            &#039;operator&#039; =  &#039;NOT IN&#039;\n        );\n \n        $q-&gt;set( &#039;tax_query&#039;, $tax_query );\n \n    }\n \n    remove_action( &#039;pre_get_posts&#039;, &#039;tmt_hide_out_of_stock_products&#039; );\n \n}<\/code><\/pre><\/div>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>\u0634\u0627\u06cc\u062f \u0628\u0631\u0627\u06cc \u0645\u0627 \u067e\u06cc\u0634 \u0628\u06cc\u0627\u062f \u06a9\u0647 \u0645\u062d\u0635\u0648\u0644\u0627\u062a\u06cc \u06a9\u0647 \u062a\u0648\u06cc \u0641\u0631\u0648\u0634\u06af\u0627\u0647 \u0645\u0627 \u0646\u0627\u0645\u0648\u062c\u0648\u062f \u0645\u06cc\u0634\u0646 \u062a\u0648\u06cc \u0635\u0641\u062d\u0647 \u0641\u0631\u0648\u0634\u06af\u0627\u0647 \u0648 \u0644\u06cc\u0633\u062a \u0645\u062d\u0635\u0648\u0644\u0627\u062a \u062f\u06cc\u062f\u0647 \u0646\u0634\u0648\u0646\u062f \u0648 \u0647\u0631 \u0632\u0645\u0627\u0646 \u0645\u0648\u062c\u0648\u062f \u0634\u062f\u0646\u062f \u0645\u062c\u062f\u062f \u062f\u0631 \u0644\u06cc\u0633\u062a \u062a\u0631\u062a\u06cc\u0628 \u0628\u0646\u062f\u06cc \u0645\u062d\u0635\u0648\u0644\u0627\u062a \u0646\u0645\u0627\u06cc\u0634 \u062f\u0627\u062f\u0647 \u0634\u0648\u0646\u062f \u0648 \u0628\u0631\u0627\u06cc \u0627\u06cc\u0646 \u06a9\u0627\u0631 \u0627\u0632 \u062f\u0648 \u0631\u0648\u0634 \u0627\u06cc\u0646 \u062a\u0646\u0638\u06cc\u0645\u0627\u062a \u0631\u0627 \u0627\u0646\u062c\u0627\u0645 \u0645\u06cc\u062f\u06cc\u0645 \u06a9\u0647 \u0627\u062f\u0627\u0645\u0647 \u0622\u0645\u0648\u0632\u0634 \u0631\u0627 \u0647\u0645\u0631\u0627\u0647 \u0645\u0627 \u0628\u0627\u0634\u06cc\u062f: \u0645\u062e\u0641\u06cc [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":20217,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[58,57,59],"tags":[],"class_list":["post-20207","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wocommerce-shop-tutorials","category-wordpress-tutorials","category-wordpress-codes"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.themento.net\/fa\/wp-json\/wp\/v2\/posts\/20207","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.themento.net\/fa\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.themento.net\/fa\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.themento.net\/fa\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.themento.net\/fa\/wp-json\/wp\/v2\/comments?post=20207"}],"version-history":[{"count":0,"href":"https:\/\/www.themento.net\/fa\/wp-json\/wp\/v2\/posts\/20207\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.themento.net\/fa\/wp-json\/wp\/v2\/media\/20217"}],"wp:attachment":[{"href":"https:\/\/www.themento.net\/fa\/wp-json\/wp\/v2\/media?parent=20207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.themento.net\/fa\/wp-json\/wp\/v2\/categories?post=20207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.themento.net\/fa\/wp-json\/wp\/v2\/tags?post=20207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}