{"id":3027,"date":"2025-06-11T10:53:15","date_gmt":"2025-06-11T02:53:15","guid":{"rendered":"https:\/\/www.zhaozhao123.cn\/wpcms\/wpdt\/3027.html"},"modified":"2025-06-11T10:53:15","modified_gmt":"2025-06-11T02:53:15","slug":"%e5%a6%82%e4%bd%95%e8%87%aa%e5%8a%a8%e6%b8%85%e7%a9%bawordpress%e5%9e%83%e5%9c%be%e6%a1%b6%ef%bc%88%e4%b8%a4%e7%a7%8d%e6%96%b9%e6%b3%95%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.zhaozhao123.cn\/wpcms\/post\/3027.html","title":{"rendered":"\u5982\u4f55\u81ea\u52a8\u6e05\u7a7aWordPress\u5783\u573e\u6876\uff08\u4e24\u79cd\u65b9\u6cd5\uff09"},"content":{"rendered":"<div class=\"wp-block-columns p-0 border is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\r\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\r\n<div class=\"wp-block-columns px-4 py-3 border-bottom has-background is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\" style=\"background:linear-gradient(243deg,rgb(238,238,238) 0%,rgba(58,166,242,0.15) 100%)\">\r\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\r\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-6c531013 wp-block-group-is-layout-flex\">\r\n<figure class=\"wp-block-image size-thumbnail is-resized is-style-rounded is-style-rounded--1\"><img decoding=\"async\" src=\"https:\/\/www.zhaozhao123.cn\/myitems\/images\/sites16\/2025\/06\/dyA-1-400x300.jpg\" alt=\"Bug&#32534;&#35793;&#29422;\" class=\"wp-image-1842\" style=\"object-fit:cover;width:30px;height:30px\"><\/figure>\r\n\r\n\r\n\r\n<p class=\"my-0\">Bug&#32534;&#35793;&#29422;<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n\r\n\r\n<div class=\"wp-block-columns px-xl-5 px-4 py-xl-4 py-3 is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\r\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\r\n<p>&#22312;WordPress&#20013;&#65292;&#22403;&#22334;&#26742;&#21151;&#33021;&#20801;&#35768;&#29992;&#25143;&#26242;&#26102;&#20445;&#23384;&#20182;&#20204;&#32534;&#36753;&#30340;&#24086;&#23376;&#25110;&#25991;&#31456;&#65292;&#20197;&#20415;&#26085;&#21518;&#20462;&#25913;&#12289;&#21024;&#38500;&#25110;&#20854;&#20182;&#25805;&#20316;&#12290;&#28982;&#32780;&#65292;&#22312;&#26576;&#20123;&#24773;&#20917;&#19979;&#65292;&#21487;&#33021;&#24076;&#26395;&#33258;&#21160;&#28165;&#31354;&#36825;&#20010;&#22403;&#22334;&#26742;&#65292;&#20197;&#30830;&#20445;&#19981;&#20877;&#26377;&#26410;&#25552;&#20132;&#30340;&#31295;&#20214;&#23384;&#22312;&#12290;&#20197;&#19979;&#26159;&#20004;&#31181;&#24120;&#35265;&#30340;&#26041;&#27861;&#26469;&#23454;&#29616;&#36825;&#19968;&#30446;&#26631;&#12290;<\/p>\n<h3>&#26041;&#27861;&#19968;&#65306;&#20351;&#29992;&#25554;&#20214;<\/h3>\n<ol>\n<li>\n<p><strong>&#23433;&#35013;&#24182;&#28608;&#27963;&ldquo;Trash Purge&rdquo;&#25554;&#20214;<\/strong>&#65306;<\/p>\n<ul>\n<li>&#36827;&#20837;&#24744;&#30340;WordPress&#21518;&#21488;&#12290;<\/li>\n<li>&#25214;&#21040;&ldquo;&#25554;&#20214;&rdquo;&#37096;&#20998;&#65292;&#28857;&#20987;&ldquo;&#28155;&#21152;&#26032;&#25554;&#20214;&rdquo;&#12290;<\/li>\n<li>&#22312;&#25628;&#32034;&#26694;&#20013;&#36755;&#20837;&ldquo;trash purge&rdquo;&#65292;&#36873;&#25321;&#21512;&#36866;&#30340;&#29256;&#26412;&#24182;&#28857;&#20987;&ldquo;&#23433;&#35013;&rdquo;&#25353;&#38062;&#12290;<\/li>\n<li>&#30830;&#35748;&#26356;&#26032;&#21518;&#65292;&#28857;&#20987;&ldquo;&#21551;&#29992;&rdquo;&#12290;<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>&#37197;&#32622;&#25554;&#20214;<\/strong>&#65306;<\/p>\n<ul>\n<li>&#19968;&#26086;&#25554;&#20214;&#23433;&#35013;&#23436;&#25104;&#65292;&#24744;&#21487;&#20197;&#22312;&#35774;&#32622;&#33756;&#21333;&#19979;&#25214;&#21040;&ldquo;Trash Purge&rdquo;&#12290;&#22312;&#36825;&#37324;&#65292;&#24744;&#21487;&#20197;&#35843;&#25972;&#22403;&#22334;&#31665;&#30340;&#20445;&#30041;&#26102;&#38388;&#20197;&#21450;&#26159;&#21542;&#20801;&#35768;&#33258;&#21160;&#28165;&#29702;&#12290;<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>&#25163;&#21160;&#28165;&#31354;&#22403;&#22334;&#31665;<\/strong>&#65306;<\/p>\n<ul>\n<li>&#22312;&#35774;&#32622;&#39029;&#38754;&#20013;&#65292;&#25214;&#21040;&ldquo;&#22403;&#22334;&#31665;&#28165;&#29702;&#38388;&#38548;&rdquo;&#36873;&#39033;&#65292;&#26681;&#25454;&#38656;&#35201;&#35843;&#25972;&#20026;&#36866;&#21512;&#30340;&#26102;&#38388;&#21608;&#26399;&#12290;<\/li>\n<li>&#22914;&#26524;&#21551;&#29992;&#20102;&#33258;&#21160;&#28165;&#29702;&#21151;&#33021;&#65292;&#35831;&#25353;&#29031;&#25552;&#31034;&#25191;&#34892;&#12290;<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>&#30830;&#35748;&#28165;&#29702;<\/strong>&#65306;<\/p>\n<ul>\n<li>&#28165;&#29702;&#23436;&#25104;&#21518;&#65292;&#31995;&#32479;&#20250;&#36890;&#30693;&#24744;&#24050;&#25104;&#21151;&#28165;&#38500;&#25152;&#26377;&#26410;&#25552;&#20132;&#30340;&#31295;&#20214;&#12290;<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h3>&#26041;&#27861;&#20108;&#65306;&#20351;&#29992;&#33258;&#23450;&#20041;&#33050;&#26412;<\/h3>\n<p>&#36825;&#31181;&#26041;&#27861;&#19981;&#38656;&#35201;&#39069;&#22806;&#30340;&#25554;&#20214;&#65292;&#32780;&#26159;&#36890;&#36807;&#32534;&#20889;&#31616;&#21333;&#30340;PHP&#33050;&#26412;&#26469;&#23450;&#26399;&#26816;&#26597;&#21644;&#28165;&#29702;&#22403;&#22334;&#31665;&#20013;&#30340;&#20869;&#23481;&#12290;<\/p>\n<h4>&#31034;&#20363;&#20195;&#30721;&#65306;<\/h4>\n<pre><code class=\"language-php\">\/\/ &#33258;&#23450;&#20041;&#33050;&#26412;&#25991;&#20214;&#21517;&#65306;clear_trash.php\n&lt;?php\n\/*\nPlugin Name: Clear Trash\nDescription: Automatically clear the trash after a certain period of inactivity.\nVersion: 1.0\nAuthor: Your Name\n*\/\n\nfunction clear_trash() {\n    \/\/ &#35774;&#32622;&#28165;&#38500;&#22403;&#22334;&#31665;&#30340;&#38388;&#38548;&#26102;&#38388;&#65292;&#21333;&#20301;&#20026;&#22825;\n    $interval = 7; \/\/ &#27599;&#21608;&#28165;&#38500;&#19968;&#27425;\n    $now = time();\n\n    \/\/ &#33719;&#21462;&#24403;&#21069;&#26085;&#26399;\n    $current_date = date(\"Y-m-d H:i:s\");\n\n    \/\/ &#23450;&#20041;&#22403;&#22334;&#31665;&#30340;&#25345;&#20037;&#21270;&#26102;&#38388;\n    $expire_time = strtotime('+' . $interval . ' days', $now);\n\n    \/\/ &#33719;&#21462;&#25152;&#26377;&#30340;&#22403;&#22334;&#31665;&#39033;\n    $trashed_posts = get_posts(array(\n        'post_type' =&gt; 'post',\n        'meta_key' =&gt; '_wp_post_is',\n        'meta_value' =&gt; 'trash'\n    ));\n\n    foreach ($trashed_posts as $post) {\n        \/\/ &#21028;&#26029;&#24403;&#21069;&#26102;&#38388;&#21644;&#22403;&#22334;&#31665;&#39033;&#30340;&#25345;&#20037;&#21270;&#26102;&#38388;&#26159;&#21542;&#36229;&#36807;&#25351;&#23450;&#30340;&#38388;&#38548;\n        if (strtotime($current_date) &gt; $expire_time + strtotime('-' . $interval . ' days')) {\n            wp_delete_post($post-&gt;ID, true); \/\/ &#21024;&#38500;&#24086;&#23376;\n        }\n    }\n}\nadd_action('init', 'clear_trash');<\/code><\/pre>\n<h4>&#20351;&#29992;&#27493;&#39588;&#65306;<\/h4>\n<ol>\n<li>&#23558;&#19978;&#36848;&#20195;&#30721;&#20445;&#23384;&#21040;&#21517;&#20026;<code>clear_trash.php<\/code>&#30340;&#25991;&#20214;&#20013;&#65292;&#24182;&#23558;&#20854;&#25918;&#22312;&#24744;&#30340;&#32593;&#31449;&#26681;&#30446;&#24405;&#19979;&#30340;<code>\/wp-content\/plugins\/<\/code>&#23376;&#30446;&#24405;&#19979;&#12290;<\/li>\n<li>&#30331;&#24405;&#21040;WordPress&#31649;&#29702;&#21518;&#21488;&#65292;&#36827;&#20837;&ldquo;&#25554;&#20214;&rdquo;&#37096;&#20998;&#65292;&#25214;&#21040;&#24182;&#21551;&#29992;&ldquo;Clear Trash&rdquo;&#25554;&#20214;&#12290;<\/li>\n<li>&#26681;&#25454;&#38656;&#35201;&#35843;&#25972;&#28165;&#38500;&#38388;&#38548;&#26102;&#38388;&#65288;&#20363;&#22914;&#27599;&#21608;&#19968;&#27425;&#65289;&#65292;&#28982;&#21518;&#21047;&#26032;&#39029;&#38754;&#26597;&#30475;&#25928;&#26524;&#12290;<\/li>\n<\/ol>\n<p>&#35831;&#27880;&#24847;&#65292;&#20197;&#19978;&#31034;&#20363;&#20195;&#30721;&#20165;&#20316;&#20026;&#35828;&#26126;&#20043;&#29992;&#65292;&#23454;&#38469;&#24212;&#29992;&#26102;&#35831;&#30830;&#20445;&#20102;&#35299;&#20854;&#23433;&#20840;&#24615;&#21644;&#20860;&#23481;&#24615;&#65292;&#24182;&#36981;&#24490;&#30456;&#20851;&#27861;&#24459;&#27861;&#35268;&#12290;<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<\/div><div class=\"wp-block-columns p-0 border is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\r\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\r\n<div class=\"wp-block-columns px-4 py-3 border-bottom has-background is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\" style=\"background:linear-gradient(243deg,rgb(238,238,238) 0%,rgba(58,166,242,0.15) 100%)\">\r\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\r\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-6c531013 wp-block-group-is-layout-flex\">\r\n<figure class=\"wp-block-image size-thumbnail is-resized is-style-rounded is-style-rounded--2\"><img decoding=\"async\" src=\"https:\/\/www.zhaozhao123.cn\/myitems\/images\/sites16\/2025\/06\/zp-400x300.jpg\" alt=\"&#40657;&#26495;&#21069;&#30340;Bug&#35821;&#27861;&#35762;&#24072;\" class=\"wp-image-1849\" style=\"object-fit:cover;width:30px;height:30px\"><\/figure>\r\n\r\n\r\n\r\n<p class=\"my-0\">&#40657;&#26495;&#21069;&#30340;Bug&#35821;&#27861;&#35762;&#24072;<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n\r\n\r\n<div class=\"wp-block-columns px-xl-5 px-4 py-xl-4 py-3 is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\r\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\r\n<h3>&#22914;&#20309;&#33258;&#21160;&#28165;&#31354;WordPress&#22403;&#22334;&#26742;<\/h3>\n<p><strong>&#38382;&#39064;&#25551;&#36848;<\/strong>\n&#22312;WordPress&#20013;&#65292;&#22403;&#22334;&#31665;&#26159;&#19968;&#20010;&#37325;&#35201;&#30340;&#21151;&#33021;&#65292;&#29992;&#20110;&#23384;&#20648;&#21644;&#28165;&#29702;&#24050;&#21024;&#38500;&#30340;&#20869;&#23481;&#12290;&#28982;&#32780;&#65292;&#23545;&#20110;&#37027;&#20123;&#38656;&#35201;&#39057;&#32321;&#22320;&#20174;&#22403;&#22334;&#31665;&#20013;&#28165;&#38500;&#26087;&#25968;&#25454;&#25110;&#26356;&#26032;&#25805;&#20316;&#30340;&#20154;&#26469;&#35828;&#65292;&#25163;&#21160;&#22788;&#29702;&#21487;&#33021;&#25928;&#29575;&#20302;&#19979;&#12290;&#22240;&#27492;&#65292;&#33258;&#21160;&#28165;&#31354;&#22403;&#22334;&#31665;&#25104;&#20026;&#19968;&#20010;&#23454;&#29992;&#30340;&#21151;&#33021;&#12290;<\/p>\n<h3>&#26041;&#27861;&#19968;&#65306;&#20351;&#29992;WordPress&#33258;&#23450;&#20041;&#20989;&#25968;<\/h3>\n<h4>&#27493;&#39588;1: &#23433;&#35013;&#24182;&#28608;&#27963;&#33258;&#23450;&#20041;&#20989;&#25968;&#25554;&#20214;<\/h4>\n<p>&#39318;&#20808;&#65292;&#20320;&#38656;&#35201;&#23433;&#35013;&#19968;&#20010;&#33258;&#23450;&#20041;&#20989;&#25968;&#25554;&#20214;&#65292;&#20363;&#22914;<code>WP_Quick_Bin_Cleaner<\/code>. &#36825;&#20010;&#25554;&#20214;&#21487;&#20197;&#24110;&#21161;&#20320;&#22312;&#29305;&#23450;&#30340;&#26102;&#38388;&#28857;&#33258;&#21160;&#28165;&#31354;&#22403;&#22334;&#31665;&#20013;&#30340;&#20869;&#23481;&#12290;<\/p>\n<ul>\n<li>&#19979;&#36733;&#24182;&#23433;&#35013;&#25554;&#20214;&#65306;&#25171;&#24320;WordPress&#21518;&#21488; -&gt; &#25554;&#20214;&#31649;&#29702; -&gt; &#25214;&#21040;&ldquo;WP_Quick_Bin_Cleaner&rdquo; -&gt; &#23433;&#35013;&#12290;<\/li>\n<li>&#21551;&#29992;&#25554;&#20214;&#65306;&#22312;&#23433;&#35013;&#36807;&#31243;&#20013;&#65292;&#25554;&#20214;&#20250;&#26174;&#31034;&#26159;&#21542;&#21551;&#29992;&#12290;&#40664;&#35748;&#24773;&#20917;&#19979;&#65292;&#23427;&#24050;&#32463;&#21551;&#29992;&#20102;&#12290;<\/li>\n<\/ul>\n<h4>&#27493;&#39588;2: &#32534;&#36753;&#33258;&#23450;&#20041;&#20989;&#25968;<\/h4>\n<p>&#25509;&#19979;&#26469;&#65292;&#36827;&#20837;WordPress&#21518;&#21488; -&gt; &#31995;&#32479;&#35774;&#32622; -&gt; &#33258;&#23450;&#20041;&#21151;&#33021;&#12290;&#25214;&#21040;&#24182;&#32534;&#36753;&#21517;&#20026; <code>bin_cleaner.php<\/code> &#30340;&#25991;&#20214;&#12290;<\/p>\n<h4>&#27493;&#39588;3: &#28155;&#21152;&#33258;&#23450;&#20041;&#20989;&#25968;<\/h4>\n<p>&#22312; <code>bin_cleaner.php<\/code> &#25991;&#20214;&#20013;&#28155;&#21152;&#20197;&#19979;&#20195;&#30721;&#65306;<\/p>\n<pre><code class=\"language-php\">\/\/ &#26085;&#26399;&#26684;&#24335;&#21270;\n$date_format = 'Y-m-d H:i:s';\n$now = time();\n$date = date($date_format, $now);\n\n\/\/ &#33719;&#21462;&#24403;&#21069;&#26102;&#38388;&#25139;\n$current_timestamp = strtotime($date);\n$current_date = date('Ymd', $current_timestamp);\n\n\/\/ &#33719;&#21462;&#22403;&#22334;&#31665;&#20013;&#30340;&#25991;&#31456;ID\n$trash_posts_ids = get_option('wp_quick_bin_trash');\n\n\/\/ &#36941;&#21382;&#22403;&#22334;&#31665;&#20013;&#30340;&#25991;&#31456;\nforeach ($trash_posts_ids as $post_id) {\n    \/\/ &#26816;&#26597;&#26159;&#21542;&#20026;&#22403;&#22334;&#31665;&#20013;&#30340;&#25991;&#31456;\n    if (is_sticky($post_id)) { \/\/ &#22686;&#21152;&#26816;&#26597;&#26465;&#20214;&#20197;&#38450;&#27490;&#37325;&#22797;&#25191;&#34892;\n        continue;\n    }\n\n    \/\/ &#22914;&#26524;&#25991;&#31456;&#19981;&#22312;&#22403;&#22334;&#31665;&#20013;&#65292;&#21017;&#23558;&#20854;&#31227;&#38500;\n    delete_post_meta($post_id, '_stuck_in_bin');\n}\n\n\/\/ &#28165;&#31354;&#22403;&#22334;&#31665;\ndelete_option('wp_quick_bin_trash');<\/code><\/pre>\n<h4>&#27493;&#39588;4: &#26356;&#26032;&#20027;&#39064;&#26679;&#24335;<\/h4>\n<p>&#30830;&#20445;&#22312;&#20462;&#25913;&#33258;&#23450;&#20041;&#20989;&#25968;&#21518;&#65292;&#37325;&#26032;&#21152;&#36733;&#39029;&#38754;&#20197;&#24212;&#29992;&#26356;&#25913;&#12290;&#22914;&#26524;&#26377;&#24517;&#35201;&#65292;&#21487;&#20197;&#32771;&#34385;&#23545;CSS&#36827;&#34892;&#24494;&#35843;&#26469;&#36866;&#24212;&#26032;&#26679;&#24335;&#12290;<\/p>\n<h4>&#31034;&#20363;&#20195;&#30721;&#35828;&#26126;&#65306;<\/h4>\n<ul>\n<li><code>date()<\/code> &#20989;&#25968;&#29992;&#20110;&#33719;&#21462;&#24403;&#21069;&#26085;&#26399;&#21644;&#26102;&#38388;&#12290;<\/li>\n<li><code>get_option('wp_quick_bin_trash')<\/code> &#21487;&#20197;&#36890;&#36807;&#35775;&#38382; WordPress &#35774;&#32622;&#39029;&#38754;&#26469;&#26597;&#30475;&#22403;&#22334;&#31665;&#20013;&#30340;&#25991;&#31456;ID&#21015;&#34920;&#12290;<\/li>\n<li><code>is_sticky($post_id)<\/code> &#26159;&#19968;&#20010;&#33258;&#23450;&#20041;&#20989;&#25968;&#65292;&#29992;&#20110;&#21028;&#26029;&#25991;&#31456;&#26159;&#21542;&#20026;&#22403;&#22334;&#31665;&#20013;&#30340;&#25991;&#31456;&#65292;&#30446;&#30340;&#26159;&#36991;&#20813;&#22312;&#22403;&#22334;&#31665;&#20013;&#21457;&#29616;&#37325;&#22797;&#30340;&#25991;&#31456;&#12290;<\/li>\n<li><code>delete_post_meta($post_id, '_stuck_in_bin')<\/code> &#21024;&#38500;&#25991;&#31456;&#26631;&#35760;&#20026;&#22403;&#22334;&#31665;&#30340;&#25991;&#31456;&#12290;<\/li>\n<li><code>delete_option('wp_quick_bin_trash')<\/code> &#21024;&#38500;&#20840;&#23616;&#36873;&#39033;&#65292;&#20197;&#20415;&#23558;&#22403;&#22334;&#31665;&#20869;&#23481;&#23436;&#20840;&#28165;&#31354;&#12290;<\/li>\n<\/ul>\n<h3>&#26041;&#27861;&#20108;&#65306;&#20351;&#29992;WordPress&#25554;&#20214;&#24037;&#20855;<\/h3>\n<h4>&#27493;&#39588;1: &#23433;&#35013;&#24182;&#21551;&#29992;&#22403;&#22334;&#31665;&#31649;&#29702;&#22120;&#25554;&#20214;<\/h4>\n<p>&#25512;&#33616;&#20351;&#29992;<code>WP_Quick_Bin_Manager<\/code>&#65292;&#22240;&#20026;&#23427;&#25552;&#20379;&#20102;&#26356;&#39640;&#32423;&#30340;&#21151;&#33021;&#21644;&#26356;&#22909;&#30340;&#29992;&#25143;&#30028;&#38754;&#12290;&#20320;&#21487;&#20197;&#36890;&#36807;&#20197;&#19979;&#27493;&#39588;&#23433;&#35013;&#21644;&#21551;&#29992;&#36825;&#20010;&#25554;&#20214;&#65306;<\/p>\n<ul>\n<li>&#22312;WordPress&#21518;&#21488; -&gt; &#25554;&#20214;&#31649;&#29702; -&gt; &#25214;&#21040;&ldquo;WP_Quick_Bin_Manager&rdquo; -&gt; &#23433;&#35013;&#12290;<\/li>\n<li>&#21551;&#29992;&#25554;&#20214;&#65306;&#22312;&#23433;&#35013;&#36807;&#31243;&#20013;&#65292;&#25554;&#20214;&#20250;&#26174;&#31034;&#26159;&#21542;&#21551;&#29992;&#12290;&#40664;&#35748;&#24773;&#20917;&#19979;&#65292;&#23427;&#24050;&#32463;&#21551;&#29992;&#20102;&#12290;<\/li>\n<\/ul>\n<h4>&#27493;&#39588;2: &#20351;&#29992;&#33258;&#23450;&#20041;&#21151;&#33021;<\/h4>\n<p>&#25509;&#19979;&#26469;&#65292;&#36827;&#20837;WordPress&#21518;&#21488; -&gt; &#31995;&#32479;&#35774;&#32622; -&gt; &#33258;&#23450;&#20041;&#21151;&#33021;&#12290;&#25214;&#21040;&#24182;&#32534;&#36753;&#21517;&#20026; <code>quick-bin-manager.php<\/code> &#30340;&#25991;&#20214;&#12290;<\/p>\n<h4>&#27493;&#39588;3: &#28155;&#21152;&#33258;&#23450;&#20041;&#20989;&#25968;<\/h4>\n<p>&#22312; <code>quick-bin-manager.php<\/code> &#25991;&#20214;&#20013;&#28155;&#21152;&#20197;&#19979;&#20195;&#30721;&#65306;<\/p>\n<pre><code class=\"language-php\">\/\/ &#26085;&#26399;&#26684;&#24335;&#21270;\n$date_format = 'Y-m-d H:i:s';\n\n\/\/ &#33719;&#21462;&#24403;&#21069;&#26102;&#38388;&#25139;\n$current_timestamp = strtotime(date('Y-m-d H:i:s'));\n\n\/\/ &#33719;&#21462;&#22403;&#22334;&#31665;&#20013;&#30340;&#25991;&#31456;ID\n$trash_posts_ids = get_option('wp_quick_bin_trash');\n\n\/\/ &#36941;&#21382;&#22403;&#22334;&#31665;&#20013;&#30340;&#25991;&#31456;\nforeach ($trash_posts_ids as $post_id) {\n    \/\/ &#26816;&#26597;&#26159;&#21542;&#20026;&#22403;&#22334;&#31665;&#20013;&#30340;&#25991;&#31456;\n    if (is_sticky($post_id)) { \/\/ &#22686;&#21152;&#26816;&#26597;&#26465;&#20214;&#20197;&#38450;&#27490;&#37325;&#22797;&#25191;&#34892;\n        continue;\n    }\n\n    \/\/ &#22914;&#26524;&#25991;&#31456;&#19981;&#22312;&#22403;&#22334;&#31665;&#20013;&#65292;&#21017;&#23558;&#20854;&#31227;&#38500;\n    delete_post_meta($post_id, '_stuck_in_bin');\n}\n\n\/\/ &#28165;&#31354;&#22403;&#22334;&#31665;\ndelete_option('wp_quick_bin_trash');<\/code><\/pre>\n<h4>&#31034;&#20363;&#20195;&#30721;&#35828;&#26126;&#65306;<\/h4>\n<ul>\n<li><code>date()<\/code> &#20989;&#25968;&#29992;&#20110;&#33719;&#21462;&#24403;&#21069;&#26085;&#26399;&#21644;&#26102;&#38388;&#12290;<\/li>\n<li><code>get_option('wp_quick_bin_trash')<\/code> &#21487;&#20197;&#36890;&#36807;&#35775;&#38382; WordPress &#35774;&#32622;&#39029;&#38754;&#26469;&#26597;&#30475;&#22403;&#22334;&#31665;&#20013;&#30340;&#25991;&#31456;ID&#21015;&#34920;&#12290;<\/li>\n<li><code>is_sticky($post_id)<\/code> &#26159;&#19968;&#20010;&#33258;&#23450;&#20041;&#20989;&#25968;&#65292;&#29992;&#20110;&#21028;&#26029;&#25991;&#31456;&#26159;&#21542;&#20026;&#22403;&#22334;&#31665;&#20013;&#30340;&#25991;&#31456;&#65292;&#30446;&#30340;&#26159;&#36991;&#20813;&#22312;&#22403;&#22334;&#31665;&#20013;&#21457;&#29616;&#37325;&#22797;&#30340;&#25991;&#31456;&#12290;<\/li>\n<li><code>delete_post_meta($post_id, '_stuck_in_bin')<\/code> &#21024;&#38500;&#25991;&#31456;&#26631;&#35760;&#20026;&#22403;&#22334;&#31665;&#30340;&#25991;&#31456;&#12290;<\/li>\n<li><code>delete_option('wp_quick_bin_trash')<\/code> &#21024;&#38500;&#20840;&#23616;&#36873;&#39033;&#65292;&#20197;&#20415;&#23558;&#22403;&#22334;&#31665;&#20869;&#23481;&#23436;&#20840;&#28165;&#31354;&#12290;<\/li>\n<\/ul>\n<h3>&#24635;&#32467;<\/h3>\n<p>&#20197;&#19978;&#20004;&#20010;&#26041;&#27861;&#37117;&#23637;&#31034;&#20102;&#22914;&#20309;&#33258;&#21160;&#21270;&#28165;&#29702;WordPress&#22403;&#22334;&#31665;&#20013;&#30340;&#20869;&#23481;&#12290;&#36873;&#25321;&#26368;&#36866;&#21512;&#24744;&#38656;&#27714;&#30340;&#26041;&#27861;&#65292;&#26681;&#25454;&#24744;&#30340;&#20855;&#20307;&#24773;&#20917;&#36827;&#34892;&#35843;&#25972;&#21363;&#21487;&#12290;<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Bug&#32534;&#35793;&#29422; &#22312;WordPress&#20013;&#65292;&#22403;&#22334;&#26742;&#21151;&#33021;&#20801;&#35768;&#29992;&#25143;&#26242;&#26102;&#20445;&#038;#2..<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"tuisongtax":[],"class_list":["post-3027","post","type-post","status-publish","format-standard","hentry","category-wpdt"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/posts\/3027","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/comments?post=3027"}],"version-history":[{"count":0,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/posts\/3027\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/media?parent=3027"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/categories?post=3027"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/tags?post=3027"},{"taxonomy":"tuisongtax","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/tuisongtax?post=3027"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}