| 开发者 | joshuadnelson |
|---|---|
| 更新时间 | 2023年12月30日 12:20 |
| 捐献地址: | 去捐款 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 6.4.2 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
category and/or post_tag taxonomies, they will be visible and accessible through that post type.
Support
This plugin is maintained for free but please reach out and I will assist you as soon as possible. You can visit the WordPress.org support forums or create an issue on the GitHub repository.
View on GitHub & Contribute
View this plugin on GitHub to contribute as well as log any issues (or visit the WP support forums).
Please feel free to contribute! Refer to the Github Repo for specifics.
disable-blog plugin folder to the /wp-content/plugins/ directory.Other post types (like Pages) may have comment support and other great plugins exist that can disable comments, so this feature was not part of the initial development of this plugin. A future release will include options to disable comments, but until then if you would like to disable comments, try the Disable Comments plugin.
Deactivate the plugin, delete your posts (which will delete related comments), and delete any tags or categories you might want to remove as well. Then reactivate the Disable Blog to hide everything again.
Author archives are automatically created by WordPress for every user (example url: example.com/author/author-name). Typically these archives show posts by that user and possibly some biographical information. So many plugins and themes use author archives for other purposes - account page, profile page, etc. For that reason disabling author archives is currently only available with this plugin via a filter.
If you're not using the built-in WP author archives for other purposes and would like to disable them entirely, add the following to your theme functions.php file or a custom plugin file:
add_filter( 'dwpb_disable_author_archives', '__return_true' );.
If author archives are not disabled, the plugin adds functionality to support custom post types on author archives by passing an array of post type slugs to dwpb_author_archive_post_types filter - however, theme support is usually needed to disable custom content types correctly.
There are numerous filters available to change the way this plugin works. Refer to the GitHub page for more details or reach out on the support forums if you have any questions.
.wp-env.json for local development.typeof typo in disable-blog-customizer.js from 0.5.2 updates.get_comment_count function to query only post types supporting comments. This allows for the post types to be modified via the dwpb_post_types_supporting_comments filter and avoids large queries on post types that aren't relevant (e.g. shop_order in WooCommerce).dwpb_post_types_with_feature function.dwpb_post_types_supporting_comments to turn off all Disable Blog comment-related functions if Disable Comments is active.dwpb_disabled_blocks filter. Closes #60 Closes #53.distignore to remove itself and .gitignore from WP-dot-org repo.dwpb_disabled_blocks passing array of blocks being disabled by the plugin.remove_filter method. Closes #58.dwpb_disable_feed filter into a function in the Disable_Blog_Functions class.dwpb_disable_author_archives filter. Pass true to disable author archives entirely. Default does not disable author archives because numerous other plugins use author archives for other purposes. (A future settings page will provide more flexibility here).dwpb_author_archive_post_types filter to provide author archive support for custom post types. Pass an array of post type slugs to this filter to modify the post types queried on author archives, if not removed by filter above.dwpb_disabled_xmlpc_methods filter to extend the methods being disabled by the plugin. Pass false to remove the functionality entirely. Closes #50dwpb_pass_query_string_on_redirect filter, returning true enables all valid url query params to be passed during redirects. Default is false. Use the dwpb_allowed_query_vars to limit the vars passed in the redirect by passing an array of keys (e.g. return array( 'utm' ) to only pass utm query variables in the query string). Closes #52post.php, post-new.php, etc occur. Closes #45.post type) with a matching function using the page endpoint instead. This was throwing an error with the post type REST endpoints are disabled. Closes #46.dwpb_menu_subpages_to_remove param has been updated to support an array of subpages in the format of $remove_subpages['parent-page-slug.php'] = array( 'subpage-1.php', 'subpage-2.php' );, though it still supports subpages as strings for backwards compatibility. Fixes bugs were options-writing.php and options-discussion.php were conflicting.dwpb_redirect_admin_url filters the final url used in admin redirects.dwpb_redirect_admin only accepts 1 parameter, the previous version accepted 3 (dropping $redirect_url & $current_url).dwpb_redirect_admin_edit_post is now dwpb_redirect_admin_edit.dwpb_redirect_single_post_edit is now dwpb_redirect_admin_post.dwpb_redirect_admin_edit_single_post is now dwpb_redirect_admin_edit.dwpb_redirect_edit_tax has been removed. Use dwpb_redirect_admin_edit_tags or dwpb_redirect_admin_term instead, depending on the context.dwpb_redirect_edit_comments has been removed. use dwpb_redirect_admin_edit_comments instead.dwpb_redirect_options_discussion has been removed. Use dwpb_redirect_admin_options_discussion instead.dwpb_redirect_admin_options_writing that would pass a boolean to toggle off the options writing page has been remained dwpb_remove_options_writing and must be passed with true in order to have the page redirect and the admin menu item removed. By default the value filtered is false and the options Writing page does not go away, as numerous other plugins use this page for non-blog related settings. Now dwpb_redirect_admin_options_writing is used to filter the redirect url itself, replacing the previously named dwpb_redirect_options_writing filter.dwpb_redirect_options_tools has been removed. Use dwpb_redirect_admin_options_tools instead.dwpb_disabled_xmlpc_methods (see above).dwpb_author_archive_post_types (see above).dwpb_disable_author_archives (see above).dwpb_front_end_redirect_url filters the final url used in front end redirects.dwpb_redirect_author_archive to change the redirect used on author archives, if they are disabled.dwpb_disable_user_sitemap to change the user sitemap default, pass true to keep disable the sitmap. Note that if author archives are disabled by the above filter, user sitemps will be as well.dwpb_redirect_posts is now dwpb_redirect_post.dwpb_redirect_post_{$post->ID} filter has been removed. Use dwpb_redirect_post and check for the post id to target a specific post.dwpb_redirect_front_end only accepts 1 parameter, the previous version accepted 3 (dropping $redirect_url & $current_url).modify_query function to only remove posts from built-in taxonomy archives, as that was the original intent.post_type arguments for posts so they are no longer public and removes all post_type support parameters. This disables the post-related admin redirects, as WordPress will now show users an error page stating "Sorry, you are not allowed to edit posts in this post type." It also pulls posts out of a lot of other locations (menus, etc) and is a much more efficient method of "disabling" the post type. This method is also used on built-in taxonomies, unless another post type supports them. This change may impact other plugins or themes, be sure to back up your site and, if you can, test these changes prior to updating the plugin on a production site.edit-comments.php admin page if no other post type support comments (note that WordPress default is for pages and attachments to support comments).plugins_loaded.post post types from all archives, previously it was just author archives and search results.dwpb_redirect_feeds filter now has (3) params, to match those in the dwpb_disable_feed filter: $bool, $post, $is_comment_feed.dwpb_author_post_types filter is now dwpb_archive_post_types, as the query modification now includes all pages passing is_archive.dwpb_disable_rest_api, dwpb_remove_post_comment_support, dwpb_remove_post_trackback_support, dwpb_redirect_admin_edit_single_post, dwpb_redirect_single_post_edit, dwpb_redirect_admin_edit_post, dwpb_redirect_edit, dwpb_redirect_admin_post_new, dwpb_redirect_post_new as these are rendered obsolete by above changes.disable_blog.is_singular works prior to running redirects to avoid non-object errors in feeds.home_url in redirection function