Set default admin settings
-
Hi,
This question probably seems unnecessary and I’m not sure if it is actually possible to do as I have searched how to do this everywhere.
I am trying to set a couple of admin settings to new default values so when users first sign up, admin settings are set to different values to what the default wordpress values are.
For example, The closest I have come is setting default values like this:
//Admin: Discussions: Users must enter name and email to comment - set to no update_option( 'require_name_email', '0' ); //Admin: Discussions: Only registered users can comment - set to yes update_option( 'comment_registration', '1' ); //Admin: Discussions: Comments - set to descending update_option( 'comment_order', 'desc' );
These work but the only problem is the above codes forces the new values so users can’t change them. I’m looking for a way that does the job above but users can still change them.
The same way you can set a default header and default background but users can still change them, example:
$defaults = array( 'default-image' => network_site_url() . 'path to header image.jpg', ); add_theme_support( 'custom-header', $defaults );
The above code sets a default header image and users can change it in appearance > header. I’m trying to do the same thing but for admin settings.
Any help appreciated.
- The topic ‘Set default admin settings’ is closed to new replies.