<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                當您從插件卸載時,插件可能需要進行一些清理。 如果用戶已停用該插件,然后單擊WordPress管理員中的刪除鏈接,則會將插件視為已卸載。 當您的插件被卸載時,您將需要清除插件特定的任何插件選項和/或設置,和/或其他數據庫實體(如表)。 經驗不足的開發人員有時會使用停用掛鉤的錯誤。 此表說明了停用和卸載之間的區別。 |Scenario |Deactivation Hook |Uninstall Hook| |---|---|---| |Flush Cache/Temp| Yes| No| |Flush Permalinks |Yes| No| |Remove Options from {$wpdb->prefix}_options| No| Yes| |Remove Tables from wpdb |No |Yes| ## 方法1:register_uninstall_hook 要設置卸載掛鉤,請使用register_uninstall_hook()函數: ``` register_uninstall_hook(__FILE__, 'pluginprefix_function_to_run'); ``` ##方法2:uninstall.php 要使用此方法,您需要在插件的根文件夾中創建一個uninstall.php文件。 當用戶刪除插件時,這個魔術文件會自動運行。 例如: /plugin-name/uninstall.php >[danger]警報:使用uninstall.php時,在執行前,插件應該始終檢查常量WP_UNINSTALL_PLUGIN以防止直接訪問。 該常量將由WordPress在uninstall.php調用期間定義。 當register_uninstall_hook()執行卸載時,常量不被定義。 以下是刪除選項條目并刪除數據庫表的示例: ``` // if uninstall.php is not called by WordPress, die if (!defined('WP_UNINSTALL_PLUGIN')) { die; } $option_name = 'wporg_option'; delete_option($option_name); // for site options in Multisite delete_site_option($option_name); // drop a custom database table global $wpdb; $wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}mytable"); ``` >[warning] 注意:在多站點中,通過所有博客循環刪除選項可能非常耗資源。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看