[wp-trac] [WordPress Trac] #28672: add_settings_field & co don't return values
WordPress Trac
noreply at wordpress.org
Mon Nov 10 16:23:24 UTC 2014
#28672: add_settings_field & co don't return values
---------------------------------------------+-----------------------------
Reporter: TJNowell | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting
Component: Options, Meta APIs | Review
Severity: normal | Version: 2.7
Keywords: needs-unit-tests good-first-bug | Resolution:
| Focuses: administration
---------------------------------------------+-----------------------------
Comment (by mattshaw):
Replying to [comment:8 boonebgorges]:
> mattshaw - Could you give additional information about the breakage that
you're seeing in BuddyPress and elsewhere? Is it the `WP_Error` return
value?
Sure, I noticed the issue occurred when returning a WP_Error during
add_settings_section for an unregistered page, using the fix above
mentioned by GunGeekATX:
{{{
function add_settings_section($id, $title, $callback, $page) {
global $wp_settings_sections, $_registered_pages;
if ( !isset( $_registered_pages[$page] ) ) {
return new WP_Error( 'undefined_settings_page', sprintf(
__('Settings page %s has not been defined.'), $page ) );
}
...
}}}
It removed the BuddyPress main settings tab ( admin.php?page=bp-settings
), along with the settings pages for a few other plugins as well.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28672#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list