這個外掛並未在最新的 3 個 WordPress 主要版本上進行測試。開發者可能不再對這個外掛進行維護或提供技術支援,並可能會與更新版本的 WordPress 產生使用上的相容性問題。

Private Page Forbidden

外掛說明

This plugin is developed at Shepherd Interactive
for the benefit of the community. No support is available. Please post any questions to the support forum.

Instead of serving a 404 Not Found error with the 404.php template, send a 403 Forbidden error and set $wp_query->is_403 and load 403.php if it exists.

Provides a filter forbidden_redirect which if results in a non-empty filtered value will result in the user being redirected if attempting to visit a forbidden page; the default value is "" (no redirect).

Useful with a filter which selectively prevents a private post from being forbidden, so that the page will not show up in the navigation and won’t be included in XML Sitemaps, for example.

function my_filter_private_posts($posts){     if(is_singular() && $posts[0]->post_status == 'private'        && #Now optionally allow/disallow based on user session:        in_array($_SERVER['REQUEST_URI'], (array)@$_SESSION['allowed_private_uris']))     ){         header('Cache-Control: private'); #Prevent proxies from caching this private page         $posts[0]->post_status = 'publish';     }     return $posts; } add_filter('posts_results', 'my_filter_private_posts');

使用者評論

這個外掛目前沒有任何使用者評論。

參與者及開發者

以下人員參與了開源軟體〈Private Page Forbidden〉的開發相關工作。

參與者

將〈Private Page Forbidden〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

變更記錄

2009-09-28: 0.2

  • Initial release