Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#58925 closed enhancement (duplicate)

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

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

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 3 years ago.
Adds remove_settings_field() function

Download all attachments as: .zip

Change History (3)

@dcavins
3 years ago

Adds remove_settings_field() function

#1 @costdev
3 years ago

  • Milestone Awaiting Review
  • Resolutionduplicate
  • Status newclosed
  • Version 6.2.2

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
3 years 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.