Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#41576 closed enhancement (duplicate)

Add global filters in options API

Reported by: pcfreak30's profile pcfreak30 Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.9
Component: Options, Meta APIs Keywords:
Focuses: Cc:

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
7 years ago

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

Duplicate of #37930.

#2 follow-up: @pcfreak30
7 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
7 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 7 years ago by SergeyBiryukov (previous) (diff)
Note: See TracTickets for help on using tickets.