| 开发者 | jrybacek |
|---|---|
| 更新时间 | 2026年11月28日 08:05 |
| 捐献地址: | 去捐款 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
hide-a-post folder to your /wp-content/plugins/ directory (or upload the ZIP via Plugins → Add New → Upload Plugin).To avoid installing 15 different plugins just to hide posts by category from non-Administrators.
Yes. Starting in 2.0.0, Hide A Post safely handles WP-CLI's scoped loader and bypasses post filtering for unauthenticated WP-CLI commands (such as wp post list). Passing --user=<editor> to WP-CLI applies non-Administrator filtering as expected.
Hidden posts are removed from post lists, search, feeds, sitemaps, archives, previous/next links, menus, the REST API, oEmbed, and wp-admin, and their comments are hidden too. Where a hidden post is referenced by ID, non-Administrators see the title "(Private post)". Post counts are not adjusted: category counts and the "All (N)" totals in wp-admin still include hidden posts. Selecting a parent category does not hide posts that are only in its child categories. Pages and custom post types are never hidden.
Yes. Use the hap_user_can_view_hidden_posts filter to grant or deny access per user, hap_hide_admin_default_category_posts to turn off the default-category rule, and hap_administrator_ids to change whose default-category posts are hidden.
Through Buy Me a Coffee or PayPal.
TypeError crash when listing posts via WP-CLI.wp_ table prefixes and raw SQL interpolation with dynamic $wpdb table names, qualified columns, and parameterized NOT EXISTS queries via $wpdb->prepare().map_meta_cap, including WP_Post arguments), REST API reads of posts and their sub-resources (404 before the endpoint runs), revisions, oEmbed, old-slug redirects, and canonical/404 slug-guess redirects.menu-items and wp_navigation responses, so links to hidden posts are not shown to non-Administrators (stored menus are not changed).edit-comments.php?p=) for hidden posts.?attachment_id= so the parent post's slug is not exposed.wp_get_archives(), and get_posts() calls that use suppress_filters.manage_options capability (plus Super Admins on Multisite) as an Administrator for the default-category rule.hap_user_can_view_hidden_posts, hap_should_filter_query, hap_hide_admin_default_category_posts, and hap_administrator_ids filters.screen_icon() and role-name capability checks with modern Settings API markup and manage_options capability checks.uninstall.php so deactivating the plugin preserves saved settings.default_category option instead of hardcoding the English string "Uncategorized".