-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Use one option instead of multiple
We should have one edac
option which is an array with keys for all the things we need to store. No need for the many different options we have right now.
Instead of this:
add_option( 'edac_activation_date', gmdate( 'Y-m-d H:i:s' ) );
add_option( 'edac_post_types', array( 'post', 'page' ) );
add_option( 'edac_simplified_summary_position', 'after' );
We should be doing:
add_option( 'edac', [
'activation_date' => gmdate( 'Y-m-d H:i:s' ),
'post_types' => [ 'post', 'page' ],
'simplified_summary_position' => 'after',
] );
Ideally, we'd make a single options class which we use for all interactions with our single option. For example, something like this.
No need to add_option
if ( get_option( $option_name ) !== false ) {
update_option( $option_name, $new_value );
} else {
add_option( $option_name, $new_value );
}
can simply be
update_option( $option_name, $new_value );
If the option doesn't exist, it will be created. WP already takes care of these things.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request