New disable author archive functionality via new 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).
New 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.
Extend wp_safe_redirect_fallback on redirects to set the front-end fallback to home_url (WordPress defaults to admin_url).
New dwpb_redirect_status_code filter to allow for custom status codes for redirects. Defaults to 301 and will set the default if the filter returns a non-300 code.
New dwpb_pass_query_string_on_redirect filter, returning true enables all valid url query params to be passed during redirects. 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 #52
Remove user sitemaps unless author archives are supported by custom post types via the filter noted above.
Replace the "Posts" column on the user admin screen by a "Pages" column, also adds similar columns for custom post types using the filter noted above.
Remove the "view" link to author archives in the user screen if author archives are not supported.
Update the post tag and category "count" columns to correctly show the number of posts by post type, for use with custom post types supporting built-in taxonomies.
Update the customizer "Homepage" view to match the Reading options page view, when homepage is set.
Update the default posts page admin notice indicating the blog is redirected.
Add javascript to hide admin screen items not easily selected by CSS, include:
Hiding toggle comment link on welcome screen (if they are not supported by other post types),
Hiding the category and tag permalink base options (if not supported by other post types), and
Hiding the default category & default post format on Writing options page.
Fixes:
Add dwpb_xmlrpc_methods_to_remove filter to extend the methods being disabled by the plugin. Pass false to remove the functionality entirely. Closes #50
Bring back some admin page redirects to account for use cases where direct access to post.php, post-new.php, etc occur. Closes #45.
Replace the REST API site health check (which uses the 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
Fix issue with Reading Settings link in admin notice outputting raw HTML instead of a link. Closes #47
In order to account for multiple subpages of a common parent page being removed the 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.
Improvements/Updates:
Update admin filters to a common format and removing redundent filters. Filter changes include:
New filter: 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.
The filter dwpb_redirect_admin_options_writing that would pass a boolean to toggle off the options writing page has been remaned 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.
New filter: dwpb_xmlrpc_methods_to_remove (see above).
New filter: dwpb_author_archive_post_types (see above).
New filter: dwpb_disable_author_archives (see above).
Update public redirect filters to match the pattern used for the new admin redirects. Filer changes include:
New filter: dwpb_front_end_redirect_url filters the final url used in front end redirects.
New filter: dwpb_redirect_author_archive to change the redirect used on author archives, if they are disabled.
New filter: 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 also be disabled regardless of this filter.
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).
Bump minimum PHP to 5.6.
Tested up to WP Core version 5.9.3.
Updated minimum WP Core version to 4.0.
Updated translation file for all current plugin strings.
New:
dwpb_disable_author_archives
filter. Passtrue
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.wp_safe_redirect_fallback
on redirects to set the front-end fallback tohome_url
(WordPress defaults toadmin_url
).dwpb_redirect_status_code
filter to allow for custom status codes for redirects. Defaults to 301 and will set the default if the filter returns a non-300 code.dwpb_pass_query_string_on_redirect
filter, returningtrue
enables all valid url query params to be passed during redirects. Use thedwpb_allowed_query_vars
to limit the vars passed in the redirect by passing an array of keys (e.g. returnarray( 'utm' )
to only passutm
query variables in the query string). Closes #52Fixes:
dwpb_xmlrpc_methods_to_remove
filter to extend the methods being disabled by the plugin. Passfalse
to remove the functionality entirely. Closes #50post.php
,post-new.php
, etc occur. Closes #45.post
type) with a matching function using thepage
endpoint instead. This was throwing an error with thepost
type REST endpoints are disabled. Closes #46dwpb_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 wereoptions-writing.php
andoptions-discussion.php
were conflicting.Improvements/Updates:
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 nowdwpb_redirect_admin_edit
.dwpb_redirect_single_post_edit
is nowdwpb_redirect_admin_post
.dwpb_redirect_admin_edit_single_post
is nowdwpb_redirect_admin_edit
.dwpb_redirect_edit_tax
has been removed. Usedwpb_redirect_admin_edit_tags
ordwpb_redirect_admin_term
instead, depending on the context.dwpb_redirect_edit_comments
has been removed. usedwpb_redirect_admin_edit_comments
instead.dwpb_redirect_options_discussion
has been removed. Usedwpb_redirect_admin_options_discussion
instead.dwpb_redirect_admin_options_writing
that would pass a boolean to toggle off the options writing page has been remaneddwpb_remove_options_writing
and must be passed withtrue
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. Nowdwpb_redirect_admin_options_writing
is used to filter the redirect url itself, replacing the previously nameddwpb_redirect_options_writing
filter.dwpb_redirect_options_tools
has been removed. Usedwpb_redirect_admin_options_tools
instead.dwpb_xmlrpc_methods_to_remove
(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, passtrue
to keep disable the sitmap. Note that if author archives are disabled by the above filter, user sitemps will be also be disabled regardless of this filter.dwpb_redirect_posts
is nowdwpb_redirect_post
.dwpb_redirect_post_{$post->ID}
filter has been removed. Usedwpb_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
).