WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#41576 closed enhancement (duplicate)

Add global filters in options API

Reported by: pcfreak30 Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.9
Component: Options, Meta APIs Keywords:
Focuses: Cc:
PR Number:

Description

Currently get_option has

$pre = apply_filters( "pre_option_{$option}", false, $option );

I would like to see:

$pre = apply_filters( "pre_option", false, $option );

and possibly a better filter name. Need this in all option CRUD functions. Use case is allowing any option to be rerouted without knowing the option name ahead of time. In my case dealing with any transients. At present I have to filter the wpdb query hook and do sql rewritng.

Change History (3)

#1 @SergeyBiryukov
2 years ago

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

Duplicate of #37930.

#2 follow-up: @pcfreak30
2 years ago

@SergeyBiryukov this isn't a duplicate as it is needed in delete_option too, and #37930 does not cover that.

#3 in reply to: ↑ 2 @SergeyBiryukov
2 years ago

Replying to pcfreak30:

this isn't a duplicate as it is needed in delete_option too, and #37930 does not cover that.

#37929 does :) And #37928 covers add_option().

Last edited 2 years ago by SergeyBiryukov (previous) (diff)
Note: See TracTickets for help on using tickets.