Make WordPress Core

Opened 16 months ago

Closed 16 months ago

Last modified 16 months ago

#58925 closed enhancement (duplicate)

Settings API: Add way to remove fields added via add_settings_field().

Reported by: dcavins's profile dcavins Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Administration Keywords: has-patch
Focuses: Cc:

Description

It doesn't appear that the Settings API offers a built-in way to remove fields added using add_settings_field(). It is possible to deregister settings using unregister_setting(), but the field markup will still be written.

Attachments (1)

58925-remove-settings-function-01.patch (1.3 KB) - added by dcavins 16 months ago.
Adds remove_settings_field() function

Download all attachments as: .zip

Change History (3)

@dcavins
16 months ago

Adds remove_settings_field() function

#1 @costdev
16 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
  • Version 6.2.2 deleted

Hi @dcavins, it looks like we're already tracking this in #15865, which includes a patch which adds this function and a couple of others too.

Let's continue the discussion there and see if we can land these functions in the near future.

#2 @dcavins
16 months ago

Thanks! I'm shocked that Trac search failed me! :)

I agree though that anything called an API should have add_ edit_ and remove_ functions built in. Thanks again!

Note: See TracTickets for help on using tickets.