{"id":33593,"date":"2021-10-02T11:57:01","date_gmt":"2021-10-02T08:27:01","guid":{"rendered":"https:\/\/zardis.net\/news\/?p=33593"},"modified":"2021-10-02T11:58:59","modified_gmt":"2021-10-02T08:28:59","slug":"clone-wordpress-post-or-blog","status":"publish","type":"post","link":"https:\/\/zardis.net\/news\/33593\/clone-wordpress-post-or-blog\/","title":{"rendered":"\u0622\u0645\u0648\u0632\u0634 \u06a9\u067e\u06cc \u06a9\u0631\u062f\u0646 \u0628\u0631\u06af\u0647 \u0648 \u0646\u0648\u0634\u062a\u0647 \u062f\u0631 \u0648\u0631\u062f\u067e\u0631\u0633"},"content":{"rendered":"<p dir=\"RTL\">\u062f\u0644\u0627\u06cc\u0644 \u0645\u062e\u062a\u0644\u0641\u06cc \u0628\u0631\u0627\u06cc \u0622\u0645\u0648\u0632\u0634 \u062a\u06a9\u062b\u06cc\u0631 \u06a9\u0631\u062f\u0646 \u0646\u0648\u0634\u062a\u0647 \u0647\u0627 \u0648 \u0628\u0631\u06af\u0647 \u0647\u0627 \u062f\u0631 \u0648\u0631\u062f\u067e\u0631\u0633 \u0648\u062c\u0648\u062f \u062f\u0627\u0631\u062f. \u06cc\u06a9\u06cc \u0627\u0632 \u0631\u0627\u06cc\u062c\u200c\u062a\u0631\u06cc\u0646 \u062f\u0644\u0627\u06cc\u0644 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u062f \u0641\u0631\u0627\u0647\u0645 \u06a9\u0631\u062f\u0646 \u06cc\u06a9 \u0631\u0627\u0647 \u0622\u0633\u0627\u0646 \u0648 \u0633\u0627\u062f\u0647 \u0628\u0631\u0627\u06cc \u0645\u0634\u062a\u0631\u06cc\u0627\u0646 \u0628\u0627\u0634\u062f \u062a\u0627 \u0628\u062a\u0648\u0627\u0646\u0646\u062f \u0627\u0632 \u06cc\u06a9 \u0646\u0648\u0634\u062a\u0647 \u06cc\u0627 \u0628\u0631\u06af\u0647\u200c\u0627\u06cc \u06a9\u0647 \u0634\u0645\u0627 \u0627\u0632 \u0642\u0628\u0644 \u0628\u0631\u0627\u06cc \u0622\u0646\u200c\u0647\u0627 \u0622\u0645\u0627\u062f\u0647 \u06a9\u0631\u062f\u0647\u200c\u0627\u06cc\u062f\u060c \u0646\u0633\u062e\u0647\u200c\u06cc\u200c \u06a9\u067e\u06cc \u062a\u0647\u06cc\u0647 \u06a9\u0646\u0646\u062f \u0648 \u062f\u0631 \u06cc\u06a9 \u0642\u0627\u0644\u0628 \u0645\u0634\u062e\u0635\u060c \u0648 \u062a\u0646\u0647\u0627 \u0628\u0627 \u062a\u063a\u06cc\u06cc\u0631 \u0645\u062a\u063a\u06cc\u0631\u0647\u0627\u060c \u0645\u062d\u062a\u0648\u0627\u06cc \u062e\u0648\u062f \u0631\u0627 \u062a\u063a\u06cc\u06cc\u0631 \u062f\u0647\u0646\u062f.<\/p>\n<p dir=\"RTL\">\u0633\u0627\u062e\u062a \u0628\u0631\u06af\u0647 \u0647\u0645\u0633\u0627\u0646 \u062f\u0631 \u0648\u0631\u062f\u067e\u0631\u0633 \u0628\u0633\u06cc\u0627\u0631 \u0633\u0627\u062f\u0647 \u0628\u0648\u062f\u0647 \u0648 \u0628\u0647 \u062f\u0648 \u0631\u0648\u0634 \u0628\u062f\u0648\u0646 \u0627\u0641\u0632\u0648\u0646\u0647 \u0648 \u0628\u0627 \u0627\u0641\u0632\u0648\u0646\u0647 \u0642\u0627\u0628\u0644 \u0627\u0646\u062c\u0627\u0645 \u0645\u06cc\u200c\u0628\u0627\u0634\u062f. \u062f\u0631 \u0627\u062f\u0627\u0645\u0647\u200c\u06cc \u0627\u06cc\u0646 \u0645\u0642\u0627\u0644\u0647 \u0628\u0627 \u0622\u0645\u0648\u0632\u0634 \u062a\u06a9\u062b\u06cc\u0631 \u06cc\u06a9 \u0646\u0648\u0634\u062a\u0647 \u06cc\u0627 \u06a9\u067e\u06cc \u06a9\u0631\u062f\u0646 \u0628\u0631\u06af\u0647 \u062f\u0631 \u0648\u0631\u062f\u067e\u0631\u0633\u060c \u0628\u0627 \u0645\u0627 \u0647\u0645\u0631\u0627\u0647 \u0628\u0627\u0634\u06cc\u062f.<\/p>\n<h2>\u0622\u0645\u0648\u0632\u0634 \u06a9\u067e\u06cc \u06a9\u0631\u062f\u0646 \u0628\u0631\u06af\u0647 \u0648 \u0646\u0648\u0634\u062a\u0647 \u062f\u0631 \u0648\u0631\u062f\u067e\u0631\u0633 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0627\u0641\u0632\u0648\u0646\u0647<\/h2>\n<p dir=\"RTL\">\u06cc\u06a9\u06cc \u0627\u0632 \u0631\u0627\u0647\u200c\u0647\u0627\u06cc \u062a\u06a9\u062b\u06cc\u0631 \u06a9\u0631\u062f\u0646 \u0628\u0631\u06af\u0647 \u0648 \u0646\u0648\u0634\u062a\u0647\u200c\u0647\u0627 \u062f\u0631 \u0633\u0627\u06cc\u062a\u200c\u0647\u0627\u06cc \u0648\u0631\u062f\u067e\u0631\u0633\u06cc\u060c \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0627\u0641\u0632\u0648\u0646\u0647\u200c\u0647\u0627\u06cc \u0645\u0648\u062c\u0648\u062f \u0627\u0633\u062a. \u062f\u0631 \u0627\u062f\u0627\u0645\u0647 \u0628\u0627 \u0627\u06cc\u0646 \u0627\u0641\u0632\u0648\u0646\u0647\u200c\u0647\u0627 \u0622\u0634\u0646\u0627 \u0645\u06cc\u200c\u0634\u0648\u06cc\u0645.<\/p>\n<h3>\u0627\u0641\u0632\u0648\u0646\u0647 \u06a9\u067e\u06cc \u0628\u0631\u06af\u0647 \u0648\u0631\u062f\u067e\u0631\u0633 Duplicate Post<\/h3>\n<p dir=\"RTL\"><a href=\"https:\/\/wordpress.org\/plugins\/duplicate-post\/\" target=\"_blank\" rel=\"noopener\">\u0627\u0641\u0632\u0648\u0646\u0647 \u06a9\u067e\u06cc \u0628\u0631\u06af\u0647 \u0648\u0631\u062f\u067e\u0631\u0633 Duplicate Post<\/a> \u0631\u0627 \u0646\u0635\u0628 \u06a9\u0646\u06cc\u062f. \u067e\u0633 \u0627\u0632 \u0646\u0635\u0628 \u0627\u06cc\u0646 \u0627\u0641\u0632\u0648\u0646\u0647\u060c \u0635\u0641\u062d\u0647\u200c\u06cc \u0648\u06cc\u0631\u0627\u06cc\u0634 \u0646\u0648\u0634\u062a\u0647 \u06cc\u0627 \u0628\u0631\u06af\u0647\u200c\u06cc \u062e\u0648\u062f \u0631\u0627 \u0628\u0627\u0632 \u06a9\u0631\u062f\u0647 \u0648 \u0631\u0648\u06cc \u0644\u06cc\u0646\u06a9 Copy to a new draft \u06a9\u0644\u06cc\u06a9 \u06a9\u0646\u06cc\u062f. \u0627\u06cc\u0646 \u06a9\u0627\u0631 \u0628\u0627\u0639\u062b \u0645\u06cc\u200c\u0634\u0648\u062f \u0646\u0633\u062e\u0647\u200c\u0627\u06cc \u0627\u0644\u0645\u062b\u0646\u06cc \u0627\u0632 \u0628\u0631\u06af\u0647 \u06cc\u0627 \u0646\u0648\u0634\u062a\u0647\u200c\u06cc \u0634\u0645\u0627 \u062f\u0631 \u06cc\u06a9 \u0635\u0641\u062d\u0647\u200c\u06cc \u062c\u062f\u06cc\u062f \u0648\u06cc\u0631\u0627\u06cc\u0634 \u0628\u0627\u0632 \u0634\u0648\u062f.<\/p>\n<p dir=\"RTL\">\u0631\u0627\u0647 \u062f\u06cc\u06af\u0631 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0627\u06cc\u0646 \u0627\u0641\u0632\u0648\u0646\u0647 \u0627\u06cc\u0646 \u0627\u0633\u062a \u06a9\u0647 \u0628\u0647 \u0645\u0646\u0648\u06cc\u00a0<strong>\u0646\u0648\u0634\u062a\u0647 \u0647\u0627<\/strong>\u00a0&gt;\u00a0<strong>\u0647\u0645\u0647 \u0646\u0648\u0634\u062a\u0647 \u0647\u0627<\/strong>\u00a0\u0631\u0641\u062a\u0647 \u0648 \u0645\u0627\u0648\u0633 \u062e\u0648\u062f \u0631\u0627 \u0631\u0648\u06cc \u0639\u0646\u0648\u0627\u0646 \u0646\u0648\u0634\u062a\u0647 \u06cc\u0627 \u0628\u0631\u06af\u0647 \u0628\u06cc\u0627\u0648\u0631\u06cc\u062f. \u062f\u0648 \u0644\u06cc\u0646\u06a9 \u062c\u062f\u06cc\u062f \u062f\u0631 \u0627\u06cc\u0646\u062c\u0627 \u0648\u062c\u0648\u062f \u062f\u0627\u0631\u0646\u062f: Clone \u0648 New Draft.<\/p>\n<p dir=\"RTL\">\u06a9\u0644\u06cc\u06a9 \u06a9\u0631\u062f\u0646 \u0631\u0648\u06cc Clone \u0627\u0632 \u0646\u0648\u0634\u062a\u0647 \u06cc\u0627 \u0628\u0631\u06af\u0647\u200c\u06cc \u0634\u0645\u0627 \u06cc\u06a9 \u06a9\u067e\u06cc\u060c \u0628\u062f\u0648\u0646 \u0628\u0627\u0632 \u06a9\u0631\u062f\u0646 \u0622\u0646\u060c \u062a\u0647\u06cc\u0647 \u0645\u06cc\u200c\u06a9\u0646\u062f. \u0648 \u06a9\u0644\u06cc\u06a9 \u06a9\u0631\u062f\u0646 \u0631\u0648\u06cc New Draft \u0627\u0632 \u0646\u0648\u0634\u062a\u0647 \u06cc\u0627 \u0628\u0631\u06af\u0647 \u0634\u0645\u0627 \u06cc\u06a9 \u06a9\u067e\u06cc \u0627\u06cc\u062c\u0627\u062f \u06a9\u0631\u062f\u0647 \u0648 \u0622\u0646 \u0631\u0627 \u062f\u0631 \u062f\u0627\u062e\u0644 \u0648\u06cc\u0631\u0627\u06cc\u0634\u06af\u0631 \u0648\u0631\u062f\u067e\u0631\u0633 \u0628\u0627\u0632 \u0645\u06cc\u200c\u06a9\u0646\u062f.<\/p>\n<p dir=\"RTL\">\u062f\u0631 \u062a\u0646\u0638\u06cc\u0645\u0627\u062a \u0627\u06cc\u0646 \u0627\u0641\u0632\u0648\u0646\u0647\u060c \u0634\u0645\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u062a\u0639\u06cc\u06cc\u0646 \u06a9\u0646\u06cc\u062f \u06a9\u0647 \u0622\u06cc\u0627 \u0647\u0646\u06af\u0627\u0645 \u062a\u0647\u06cc\u0647\u200c\u06cc \u06cc\u06a9 \u06a9\u067e\u06cc \u0627\u0632 \u0645\u0637\u0627\u0644\u0628 \u062e\u0648\u062f\u060c \u0645\u0627\u06cc\u0644 \u0628\u0647 \u06a9\u067e\u06cc \u0634\u062f\u0646 \u0632\u0645\u0627\u0646 \u0645\u0637\u0644\u0628\u060c \u06cc\u0627 \u0648\u0636\u0639\u06cc\u062a \u0646\u0648\u0634\u062a\u0647 (\u0645\u0646\u062a\u0634\u0631 \u0634\u062f\u0647\u060c \u062f\u0631 \u062d\u0627\u0644 \u0628\u0631\u0631\u0633\u06cc \u0648 &#8230;)\u060c \u067e\u06cc\u0648\u0633\u062a\u200c\u0647\u0627\u06cc \u0646\u0648\u0634\u062a\u0647 \u0627\u0635\u0644\u06cc\u060c \u0632\u0645\u06cc\u0646\u0647\u200c\u0647\u0627\u06cc \u0633\u0641\u0627\u0631\u0634\u06cc\u060c \u062f\u0633\u062a\u0647 \u0628\u0646\u062f\u06cc \u0646\u0648\u0634\u062a\u0647 \u0648 &#8230; \u0647\u0633\u062a\u06cc\u062f \u06cc\u0627 \u062e\u06cc\u0631.<\/p>\n<h3>\u0627\u0641\u0632\u0648\u0646\u0647 \u06a9\u067e\u06cc \u0628\u0631\u06af\u0647 \u0648\u0631\u062f\u067e\u0631\u0633 Duplicate Page and Post<\/h3>\n<p id=\"tw-target-text\" class=\"tw-data-text tw-text-large tw-ta\" dir=\"rtl\" data-placeholder=\"Translation\"><span lang=\"fa\"><a href=\"https:\/\/wordpress.org\/plugins\/post-duplicator\/\" target=\"_blank\" rel=\"noopener\">\u0627\u0641\u0632\u0648\u0646\u0647\u200c\u06cc Post Duplicator<\/a>\u00a0\u0628\u0647 \u0634\u0645\u0627 \u0627\u0645\u06a9\u0627\u0646 \u0645\u06cc\u200c\u062f\u0647\u062f \u0636\u0645\u0646 \u062d\u0641\u0638 \u062c\u0632\u06cc\u06cc\u0627\u062a\u06cc \u0645\u0627\u0646\u0646\u062f \u062f\u0633\u062a\u0647\u200c\u0628\u0646\u062f\u06cc\u200c\u0647\u0627\u060c \u0648\u0636\u0639\u06cc\u062a \u0648&#8230; \u0631\u0648\u0646\u0648\u0634\u062a\u06cc \u062f\u0642\u06cc\u0642 \u0627\u0632 \u067e\u0633\u062a \u06cc\u0627 \u0628\u0631\u06af\u0647\u200c\u06cc\u00a0 \u0627\u0646\u062a\u062e\u0627\u0628\u06cc \u062e\u0648\u062f \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u06cc\u062f.<\/span><\/p>\n<p dir=\"rtl\" data-placeholder=\"Translation\">\u067e\u0633 \u0627\u0632 \u0646\u0635\u0628 \u0648 \u0641\u0639\u0627\u0644\u200c\u0633\u0627\u0632\u06cc \u0627\u0641\u0632\u0648\u0646\u0647 Post Duplicator\u060c \u0645\u0627\u0648\u0633 \u062e\u0648\u062f \u0631\u0627 \u0628\u0631 \u0631\u0648\u06cc \u0631\u0648\u06cc \u0646\u0648\u0634\u062a\u0647 \u06cc\u0627 \u0628\u0631\u06af\u0647 \u0645\u0648\u0631\u062f \u0646\u0638\u0631 \u0628\u0631\u062f\u0647 \u0648 \u0628\u0631 \u0631\u0648\u06cc \u06af\u0632\u06cc\u0646\u0647\u200c\u06cc\u00a0<strong>Duplicate \u0635\u0641\u062d\u0647\u00a0<\/strong>\u06cc\u0627\u00a0<strong>Duplicate \u0646\u0648\u0634\u062a\u0647\u00a0<\/strong>\u06a9\u0644\u06cc\u06a9 \u06a9\u0646\u06cc\u062f.<\/p>\n<p dir=\"rtl\" data-placeholder=\"Translation\"><span lang=\"fa\">\u062c\u0647\u062a \u062a\u0646\u0638\u06cc\u0645 \u06af\u0632\u06cc\u0646\u0647\u200c\u0647\u0627\u06cc \u0633\u0641\u0627\u0631\u0634\u06cc\u200c\u0633\u0627\u0632\u06cc \u06a9\u067e\u06cc\u060c \u0628\u0647 \u0628\u062e\u0634\u00a0<strong>\u0627\u0628\u0632\u0627\u0631\u0647\u0627 \u00bb Post Duplicator<\/strong>\u00a0\u0631\u0641\u062a\u0647 \u0648 \u0648\u0636\u0639\u06cc\u062a \u067e\u0633\u062a \u06cc\u0627 \u0628\u0631\u06af\u0647(\u067e\u06cc\u0634 \u0646\u0648\u06cc\u0633\u060c \u0645\u0646\u062a\u0634\u0631 \u0634\u062f\u0647) \u0648 \u0632\u0645\u0627\u0646 \u0627\u0631\u0633\u0627\u0644 \u0631\u0627 \u0645\u0637\u0627\u0628\u0642 \u0628\u0627 \u062e\u0648\u0627\u0633\u062a\u0647\u200c\u06cc \u062e\u0648\u062f \u062a\u0646\u0638\u06cc\u0645 \u06a9\u0646\u06cc\u062f.<\/span><\/p>\n<h2>\u0622\u0645\u0648\u0632\u0634 \u06a9\u067e\u06cc \u06a9\u0631\u062f\u0646 \u0628\u0631\u06af\u0647 \u0648 \u0646\u0648\u0634\u062a\u0647 \u062f\u0631 \u0648\u0631\u062f\u067e\u0631\u0633 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u06a9\u062f\u0646\u0648\u06cc\u0633\u06cc<\/h2>\n<p id=\"tw-target-text\" class=\"tw-data-text tw-text-large tw-ta\" dir=\"rtl\" data-placeholder=\"Translation\"><span lang=\"fa\">\u0645\u0645\u06a9\u0646 \u0627\u0633\u062a \u0628\u0631\u062e\u06cc \u0627\u0641\u0631\u0627\u062f \u0628\u0647 \u062f\u0644\u06cc\u0644 \u0633\u0646\u06af\u06cc\u0646 \u0634\u062f\u0646 \u0633\u0627\u06cc\u062a \u062e\u0648\u062f\u060c \u062a\u0645\u0627\u06cc\u0644\u06cc \u0628\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0627\u0641\u0632\u0648\u0646\u0647\u200c\u0647\u0627\u06cc \u0627\u0636\u0627\u0641\u06cc \u0646\u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u0646\u062f \u0648 \u062a\u0631\u062c\u06cc\u062d \u062f\u0647\u0646\u062f \u0627\u06cc\u0646 \u06a9\u0627\u0631 \u0631\u0627 \u0628\u0627 \u06a9\u0645\u06a9 \u06a9\u062f\u0646\u0648\u06cc\u0633\u06cc \u0627\u0646\u062c\u0627\u0645 \u062f\u0647\u0646\u062f. \u0627\u06cc\u0646 \u0631\u0648\u0634 \u0628\u0633\u06cc\u0627\u0631 \u0633\u0627\u062f\u0647 \u0645\u06cc\u200c\u0628\u0627\u0634\u062f.<\/span><\/p>\n<p dir=\"rtl\" data-placeholder=\"Translation\">\u0628\u0631\u0627\u06cc \u0627\u06cc\u0646 \u0645\u0646\u0638\u0648\u0631 \u0645\u06cc\u200c\u0628\u0627\u06cc\u0633\u062a \u0642\u0637\u0639\u0647 \u06a9\u062f \u0632\u06cc\u0631 \u0631\u0627 \u0628\u0647 \u0641\u0627\u06cc\u0644\u00a0<strong>functions.php<\/strong>\u00a0\u0642\u0627\u0644\u0628 \u0648\u0631\u062f\u067e\u0631\u0633 \u0633\u0627\u06cc\u062a \u062e\u0648\u062f \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u062f (\u0627\u06cc\u0646 \u0641\u0627\u06cc\u0644 \u0627\u0632 \u0647\u0627\u0633\u062a \u0634\u0645\u0627 \u0628\u062e\u0634 \u0642\u0627\u0644\u0628 \u0647\u0627 \u0648 \u0647\u0645\u0686\u0646\u06cc\u0646 \u062f\u0631 \u067e\u06cc\u0634\u200c\u062e\u0648\u0627\u0646 \u0648\u0631\u062f\u067e\u0631\u0633\u00a0<strong>\u0646\u0645\u0627\u06cc\u0634 \u00bb\u00a0\u0648\u06cc\u0631\u0627\u06cc\u0634\u06af\u0631 \u067e\u0648\u0633\u062a\u0647<\/strong>\u00a0\u0642\u0627\u0628\u0644 \u062f\u0633\u062a\u0631\u0633 \u0627\u0633\u062a).<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n\/*\r\n* Function for post duplication. Dups appear as drafts. User is redirected to the edit screen\r\n*\/\r\nfunction rd_duplicate_post_as_draft(){\r\nglobal $wpdb;\r\nif (! ( isset( $_GET&#x5B;'post']) || isset( $_POST&#x5B;'post']) || ( isset($_REQUEST&#x5B;'action']) &amp;&amp; 'rd_duplicate_post_as_draft' == $_REQUEST&#x5B;'action'] ) ) ) {\r\nwp_die('No post to duplicate has been supplied!');\r\n}\r\n\r\n\/*\r\n* Nonce verification\r\n*\/\r\nif ( !isset( $_GET&#x5B;'duplicate_nonce'] ) || !wp_verify_nonce( $_GET&#x5B;'duplicate_nonce'], basename( __FILE__ ) ) )\r\nreturn;\r\n\r\n\/*\r\n* get the original post id\r\n*\/\r\n$post_id = (isset($_GET&#x5B;'post']) ? absint( $_GET&#x5B;'post'] ) : absint( $_POST&#x5B;'post'] ) );\r\n\/*\r\n* and all the original post data then\r\n*\/\r\n$post = get_post( $post_id );\r\n\r\n\/*\r\n* if you don't want current user to be the new post author,\r\n* then change next couple of lines to this: $new_post_author = $post-&gt;post_author;\r\n*\/\r\n$current_user = wp_get_current_user();\r\n$new_post_author = $current_user-&gt;ID;\r\n\r\n\/*\r\n* if post data exists, create the post duplicate\r\n*\/\r\nif (isset( $post ) &amp;&amp; $post != null) {\r\n\r\n\/*\r\n* new post data array\r\n*\/\r\n$args = array(\r\n'comment_status' =&gt; $post-&gt;comment_status,\r\n'ping_status' =&gt; $post-&gt;ping_status,\r\n'post_author' =&gt; $new_post_author,\r\n'post_content' =&gt; $post-&gt;post_content,\r\n'post_excerpt' =&gt; $post-&gt;post_excerpt,\r\n'post_name' =&gt; $post-&gt;post_name,\r\n'post_parent' =&gt; $post-&gt;post_parent,\r\n'post_password' =&gt; $post-&gt;post_password,\r\n'post_status' =&gt; 'draft',\r\n'post_title' =&gt; $post-&gt;post_title,\r\n'post_type' =&gt; $post-&gt;post_type,\r\n'to_ping' =&gt; $post-&gt;to_ping,\r\n'menu_order' =&gt; $post-&gt;menu_order\r\n);\r\n\r\n\/*\r\n* insert the post by wp_insert_post() function\r\n*\/\r\n$new_post_id = wp_insert_post( $args );\r\n\r\n\/*\r\n* get all current post terms ad set them to the new post draft\r\n*\/\r\n$taxonomies = get_object_taxonomies($post-&gt;post_type); \/\/ returns array of taxonomy names for post type, ex array(&quot;category&quot;, &quot;post_tag&quot;);\r\nforeach ($taxonomies as $taxonomy) {\r\n$post_terms = wp_get_object_terms($post_id, $taxonomy, array('fields' =&gt; 'slugs'));\r\nwp_set_object_terms($new_post_id, $post_terms, $taxonomy, false);\r\n}\r\n\r\n\/*\r\n* duplicate all post meta just in two SQL queries\r\n*\/\r\n$post_meta_infos = $wpdb-&gt;get_results(&quot;SELECT meta_key, meta_value FROM $wpdb-&gt;postmeta WHERE post_id=$post_id&quot;);\r\nif (count($post_meta_infos)!=0) {\r\n$sql_query = &quot;INSERT INTO $wpdb-&gt;postmeta (post_id, meta_key, meta_value) &quot;;\r\nforeach ($post_meta_infos as $meta_info) {\r\n$meta_key = $meta_info-&gt;meta_key;\r\nif( $meta_key == '_wp_old_slug' ) continue;\r\n$meta_value = addslashes($meta_info-&gt;meta_value);\r\n$sql_query_sel&#x5B;]= &quot;SELECT $new_post_id, '$meta_key', '$meta_value'&quot;;\r\n}\r\n$sql_query.= implode(&quot; UNION ALL &quot;, $sql_query_sel);\r\n$wpdb-&gt;query($sql_query);\r\n}\r\n\r\n\r\n\/*\r\n* finally, redirect to the edit post screen for the new draft\r\n*\/\r\nwp_redirect( admin_url( 'post.php?action=edit&amp;post=' . $new_post_id ) );\r\nexit;\r\n} else {\r\nwp_die('Post creation failed, could not find original post: ' . $post_id);\r\n}\r\n}\r\nadd_action( 'admin_action_rd_duplicate_post_as_draft', 'rd_duplicate_post_as_draft' );\r\n\r\n\/*\r\n* Add the duplicate link to action list for post_row_actions\r\n*\/\r\nfunction rd_duplicate_post_link( $actions, $post ) {\r\nif (current_user_can('edit_posts')) {\r\n$actions&#x5B;'duplicate'] = '&lt;a href=&quot;' . wp_nonce_url('admin.php?action=rd_duplicate_post_as_draft&amp;post=' . $post-&gt;ID, basename(__FILE__), 'duplicate_nonce' ) . '&quot; title=&quot;Duplicate this item&quot; rel=&quot;permalink&quot;&gt;Duplicate&lt;\/a&gt;';\r\n}\r\nreturn $actions;\r\n}\r\n\r\nadd_filter( 'post_row_actions', 'rd_duplicate_post_link', 10, 2 );\r\n<\/pre>\n<p dir=\"rtl\" data-placeholder=\"Translation\">\u0627\u06cc\u0646 \u0642\u0637\u0639\u0647 \u06a9\u062f \u0641\u0642\u0637 \u0628\u0631\u0627\u06cc \u062a\u06a9\u062b\u06cc\u0631 \u0646\u0648\u0634\u062a\u0647\u200c\u0647\u0627\u06cc \u0634\u0645\u0627 \u06a9\u0627\u0631 \u062e\u0648\u0627\u0647\u062f \u06a9\u0631\u062f. \u062f\u0631 \u0635\u0648\u0631\u062a \u062a\u0645\u0627\u06cc\u0644 \u0628\u0631\u0627\u06cc \u0641\u0639\u0627\u0644\u200c\u0633\u0627\u0632\u06cc \u0627\u06cc\u0646 \u0642\u0627\u0628\u0644\u06cc\u062a \u0628\u0631\u0627\u06cc \u0628\u0631\u06af\u0647\u200c\u0647\u0627\u06cc \u062e\u0648\u062f \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0642\u0637\u0639\u0647 \u06a9\u062f \u0632\u06cc\u0631 \u0631\u0627 \u0628\u0627 \u0622\u062e\u0631\u06cc\u0646 \u062e\u0637 \u06a9\u062f \u0628\u0627\u0644\u0627 \u062c\u0627\u06cc\u06af\u0631\u06cc\u0646 \u06a9\u0646\u06cc\u062f.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\nadd_filter('page_row_actions', 'rd_duplicate_post_link', 10, 2);\r\n<\/pre>\n<p dir=\"rtl\" data-placeholder=\"Translation\">\n<p dir=\"rtl\" data-placeholder=\"Translation\">\u067e\u0633 \u0627\u0632 \u0627\u0641\u0632\u0648\u062f\u0646 \u0648 \u0630\u062e\u06cc\u0631\u0647\u200c\u0633\u0627\u0632\u06cc \u0627\u06cc\u0646 \u06a9\u062f\u0647\u0627\u060c \u06af\u0632\u06cc\u0646\u0647\u200c\u06cc\u00a0<strong>Duplicate<\/strong>\u00a0\u0628\u0631\u0627\u06cc \u067e\u0633\u062a\u200c\u0647\u0627 \u0648 \u0628\u0631\u06af\u0647\u200c\u0647\u0627\u06cc \u0634\u0645\u0627 \u0641\u0639\u0627\u0644 \u0645\u06cc\u200c\u0634\u0648\u062f.<\/p>\n<p dir=\"rtl\" data-placeholder=\"Translation\"><strong>\u062c\u0645\u0639\u200c \u0628\u0646\u062f\u06cc:<\/strong><\/p>\n<p dir=\"rtl\" data-placeholder=\"Translation\">\u0642\u0627\u0628\u0644\u06cc\u062a \u06a9\u067e\u06cc \u06a9\u0631\u062f\u0646 \u0628\u0631\u06af\u0647 \u0648 \u0646\u0648\u0634\u062a\u0647 \u062f\u0631 \u0648\u0631\u062f\u067e\u0631\u0633 \u060c \u0642\u0627\u0628\u0644\u06cc\u062a\u06cc \u0628\u0633\u06cc\u0627\u0631 \u06a9\u0627\u0631\u0628\u0631\u062f\u06cc \u0628\u0631\u0627\u06cc \u0633\u0627\u06cc\u062a\u200c\u0647\u0627\u06cc\u06cc \u0627\u0633\u062a \u06a9\u0647 \u062a\u0645\u0627\u06cc\u0644 \u062f\u0627\u0631\u0646\u062f \u0645\u062d\u062a\u0648\u0627\u06cc \u062e\u0648\u062f \u0631\u0627 \u062f\u0631 \u06cc\u06a9 \u0642\u0627\u0644\u0628 \u0645\u0634\u062e\u0635 \u0627\u0631\u0627\u0626\u0647 \u062f\u0647\u0646\u062f. \u0628\u0631\u0627\u06cc \u0627\u0641\u0632\u0648\u062f\u0646 \u0627\u06cc\u0646 \u0642\u0627\u0628\u0644\u06cc\u062a \u0628\u0647 \u0633\u0627\u06cc\u062a\u200c\u0647\u0627\u06cc \u0648\u0631\u062f\u067e\u0631\u0633\u06cc\u060c \u062f\u0648 \u0631\u0648\u0634 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0627\u0641\u0632\u0648\u0646\u0647 \u0648 \u0627\u0641\u0632\u0648\u062f\u0646 \u06a9\u062f \u0628\u0647 \u0642\u0627\u0644\u0628\u060c \u062f\u0631 \u062f\u0633\u062a\u0631\u0633 \u0647\u0633\u062a\u0646\u062f \u0648 \u0634\u0645\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0628\u0646\u0627 \u0628\u0631 \u0646\u06cc\u0627\u0632 \u0648 \u062a\u0645\u0627\u06cc\u0644 \u062e\u0648\u062f \u0627\u0632 \u0647\u0631 \u06a9\u062f\u0627\u0645 \u0627\u0632 \u0627\u06cc\u0646 \u0631\u0648\u0634\u200c\u0647\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f.<\/p>\n<p dir=\"rtl\" data-placeholder=\"Translation\">\u0634\u0645\u0627 \u06a9\u062f\u0627\u0645 \u06cc\u06a9 \u0627\u0632 \u0631\u0648\u0634\u200c\u0647\u0627 \u0631\u0627 \u062a\u0631\u062c\u06cc\u062d \u0645\u06cc\u200c\u062f\u0647\u06cc\u062f\u061f \u0646\u0638\u0631\u0627\u062a \u0648 \u062a\u062c\u0631\u0628\u06cc\u0627\u062a \u062e\u0648\u062f \u0631\u0627 \u0628\u0627 \u0645\u0627 \u0628\u0647 \u0627\u0634\u062a\u0631\u0627\u06a9 \u0628\u06af\u0630\u0627\u0631\u06cc\u062f.<\/p>\n<blockquote>\n<p dir=\"rtl\" data-placeholder=\"Translation\">\u0627\u06af\u0631 \u0628\u0647 \u06cc\u0627\u062f\u06af\u06cc\u0631\u06cc \u0628\u06cc\u0634\u062a\u0631 \u062f\u0631 \u0632\u0645\u06cc\u0646\u0647\u200c\u06cc \u0648\u0631\u062f\u067e\u0631\u0633 \u0639\u0644\u0627\u0642\u0647 \u062f\u0627\u0631\u06cc\u060c \u0634\u0631\u06a9\u062a \u062f\u0631 \u062f\u0648\u0631\u0647\u00a0\u0645\u062a\u062e\u0635\u0635 \u0648\u0631\u062f\u067e\u0631\u0633\u00a0\u0631\u0627 \u067e\u06cc\u0634\u0646\u0647\u0627\u062f \u0645\u06cc \u06a9\u0646\u06cc\u0645\u060c \u0628\u0627 \u0634\u0631\u06a9\u062a \u062f\u0631 \u0627\u06cc\u0646 \u062f\u0648\u0631\u0647\u060c \u062f\u0631 \u06a9\u0645\u062a\u0631 \u0627\u0632 \u06cc\u06a9\u0633\u0627\u0644 \u0628\u0647 \u06cc\u06a9 \u0645\u062a\u062e\u0635\u0635 \u0648\u0631\u062f\u067e\u0631\u0633 \u0647\u0645\u0647 \u0641\u0646 \u062d\u0631\u06cc\u0641 \u062a\u0628\u062f\u06cc\u0644 \u0645\u06cc \u0634\u0648\u06cc \u06a9\u0647 \u0622\u0645\u0627\u062f\u0647 \u0627\u0633\u062a\u062e\u062f\u0627\u0645\u060c \u062f\u0631\u06cc\u0627\u0641\u062a \u067e\u0631\u0648\u0698\u0647 \u0648 \u067e\u06cc\u0627\u062f\u0647\u200c\u0633\u0627\u0632\u06cc \u0642\u0627\u0644\u0628 \u0648 \u067e\u0644\u0627\u06af\u06cc\u0646\u200c\u0647\u0627\u06cc \u0648\u0631\u062f\u067e\u0631\u0633\u06cc \u0647\u0633\u062a\u06cc.<\/p>\n<\/blockquote>\n<p dir=\"rtl\" data-placeholder=\"Translation\">\u0645\u0646\u0628\u0639 : \u0633\u0648\u0646 \u0644\u0631\u0646<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u062f\u0644\u0627\u06cc\u0644 \u0645\u062e\u062a\u0644\u0641\u06cc \u0628\u0631\u0627\u06cc \u0622\u0645\u0648\u0632\u0634 \u062a\u06a9\u062b\u06cc\u0631 \u06a9\u0631\u062f\u0646 \u0646\u0648\u0634\u062a\u0647 \u0647\u0627 \u0648 \u0628\u0631\u06af\u0647 \u0647\u0627 \u062f\u0631 \u0648\u0631\u062f\u067e\u0631\u0633 \u0648\u062c\u0648\u062f \u062f\u0627\u0631\u062f. \u06cc\u06a9\u06cc \u0627\u0632 \u0631\u0627\u06cc\u062c\u200c\u062a\u0631\u06cc\u0646 \u062f\u0644\u0627\u06cc\u0644 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u062f \u0641\u0631\u0627\u0647\u0645 \u06a9\u0631\u062f\u0646 \u06cc\u06a9 \u0631\u0627\u0647 \u0622\u0633\u0627\u0646 \u0648 \u0633\u0627\u062f\u0647 \u0628\u0631\u0627\u06cc \u0645\u0634\u062a\u0631\u06cc\u0627\u0646 \u0628\u0627\u0634\u062f \u062a\u0627 \u0628\u062a\u0648\u0627\u0646\u0646\u062f \u0627\u0632 \u06cc\u06a9 \u0646\u0648\u0634\u062a\u0647 \u06cc\u0627 \u0628\u0631\u06af\u0647\u200c\u0627\u06cc \u06a9\u0647 \u0634\u0645\u0627 \u0627\u0632 \u0642\u0628\u0644 \u0628\u0631\u0627\u06cc \u0622\u0646\u200c\u0647\u0627 \u0622\u0645\u0627\u062f\u0647 \u06a9\u0631\u062f\u0647\u200c\u0627\u06cc\u062f\u060c \u0646\u0633\u062e\u0647\u200c\u06cc\u200c \u06a9\u067e\u06cc \u062a\u0647\u06cc\u0647 \u06a9\u0646\u0646\u062f \u0648 \u062f\u0631 \u06cc\u06a9 \u0642\u0627\u0644\u0628 \u0645\u0634\u062e\u0635\u060c \u0648 [&hellip;]<\/p>\n","protected":false},"author":15,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":"","_members_access_role":[],"_members_access_error":""},"categories":[3003],"tags":[],"class_list":["post-33593","post","type-post","status-publish","format-standard","hentry","category-wp"],"acf":[],"_links":{"self":[{"href":"https:\/\/zardis.net\/news\/wp-json\/wp\/v2\/posts\/33593","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zardis.net\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zardis.net\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zardis.net\/news\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/zardis.net\/news\/wp-json\/wp\/v2\/comments?post=33593"}],"version-history":[{"count":0,"href":"https:\/\/zardis.net\/news\/wp-json\/wp\/v2\/posts\/33593\/revisions"}],"wp:attachment":[{"href":"https:\/\/zardis.net\/news\/wp-json\/wp\/v2\/media?parent=33593"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zardis.net\/news\/wp-json\/wp\/v2\/categories?post=33593"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zardis.net\/news\/wp-json\/wp\/v2\/tags?post=33593"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}