Monday, January 11, 2016

How to Add Settings Section in WordPress Default Settings

It’s very easy to create settings page in WordPress. But sometimes in our plugin we only need a single/few options. And creating dedicated settings page just for this option is overkill. That’s what I think when I write “f(x) Private Site” Plugin yesterday. You can download the plugin for a full code example: When it make sense, we can add settings to WordPress default settings page such as “General Settings”, Writing Settings”, “Reading Settings”, etc. And this is how to do that. WordPress Default Settings WordPress currently have 6 default settings pages. And each have settings page ID (slug?), here’s the list: General Settings: “general” Writing Settings: “writing” Reading Settings: “reading” Discussion Settings: “discussion” Media Settings: “media” Permalink Settings: “permalink” You can extend each settings page and add your own option. WordPress also use the same option group for each settings page. NOTE: I can’t seem to save settings in “Permalink” page. Maybe there’s a bug in WP, maybe Permalink Settings page need a different treatment. In this tutorial we will create an additional settings in “Reading Settings” Page, but you can easily implement this to other settings page. #wordpress #smallbusiness #entrepreneur

https://managewp.org/articles/11501/how-to-add-settings-section-in-wordpress-default-settings

No comments:

Post a Comment