Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace update_option() calls with option_${option_name} filter hooks #121

Open
cjg89 opened this issue Feb 17, 2021 · 0 comments
Open

Replace update_option() calls with option_${option_name} filter hooks #121

cjg89 opened this issue Feb 17, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@cjg89
Copy link
Member

cjg89 commented Feb 17, 2021

Description

Update explicit update_option() calls in the theme with option_${option_name} filter hooks.

// Force Tuition and Fees plugin to use 'degree_code' field for
// a single degree's degree plan code value
if ( get_option( 'ucf_tuition_fees_degree_plan_code_name' ) !== 'degree_code' ) {
update_option( 'ucf_tuition_fees_degree_plan_code_name', 'degree_code' );
}

Why it's Important

To remove unneeded db calls.

Alternatives

n/a

Possible Implementation

Something like
add_filter( 'option_ucf_tuition_fees_degree_plan_code_name', function() { return 'degree_code'; } );

Additional context

n/a

@cjg89 cjg89 added the enhancement New feature or request label Feb 17, 2021
@cjg89 cjg89 added this to the backlog milestone Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants