register_setting() uses Settings API, which is just an API for options.php, is easier to use, more secure and preffered way of storing options since WordPress 2.7.
If you need to store only a few options or doing simple plugin just for yourself – it’s really up to you which one to use 🙂
Here’s the Settings API (well) explained: http://www.chipbennett.net/2011/02/17/incorporating-the-settings-api-in-wordpress-themes/
Basically it makes a few things much easier, you don’t have to render whole forms all over again (great for plugins/themes with many options), you don’t need to care about nonces etc.
So, to sum up, both these functions actually do the same thing 🙂
Related Posts:
- Is it bad practice to create own table for a plugin?
- WordPress 5.3 update causes media library file upload to break – Cannot convert undefined or null to object
- How to properly insert data into custom table via plugin
- How to enable edit button in the theme’s customize UI?
- How to add a sub menu with AJAX?
- Detecting $_GET parameters from any page + Cookie
- Template for custom post type shows all posts instead of just one
- Is there any multiple filter/criteria plugin for wordpress? [closed]
- Converting a simple plugin to be placed inside of functions.php
- How can I filter the contents of a metafield before it’s displayed in the admin?
- register_post_status invisible but searchable
- How can I get the post content displayed in a text field that allows to edit posts?
- Is it not recommendable to stick with plugins that are no longer supported by the author for production sites?
- Conditionally bypass plugin
- How to include code into functions.php file via a plugin
- Override WooCommerce page-specific js in my theme
- Calling JavaScript file with Custom Plugin
- change captcha design in Fast Secure Contact Form plugin
- WP-FB-AutoConnect: Unable to login with administrator account
- Image gallery plugin [closed]
- Where sales manager of WP-Commerce plugin?
- Custom Field Template seriously messed up in WP 3.1.1
- Not able to complete meta box save function and sanitization/validation
- Gravity Forms plugin: How to use “gform_editor_js” action hook? [closed]
- Access WordPress database outside of WordPress
- Prevent WordPress installing plugins and themes via Admin
- Filtering out specific post formats from certain pages
- Is there a way to set the default active tab on Post UI Tab pluggin?
- Show function to super admin
- Generate pages from markdown files in github automatically
- 306 MB of wp_options occupied by WordPress SEO Plugin, is that normal? [closed]
- Setting the profile picture from another field
- Woocommerce Create custom product type with variations
- Shortcode Plugin to dynamically build a shortcode via `do_shortcode` not working
- How to execute code only on posts older than 2 weeks
- Perform internal redirect in WordPress?
- Using AJAX to generate front end / viewer end pages
- Display custom content using page.php from theme
- how to deactivate a plugin without using a WP function?
- Conditional tag doesn’t work in WordPress plugin
- How can I delete a wordpress widget instance?
- Translations for my plugin don’t show up
- syntax error, unexpected ‘while’ (t_while) please help :)
- Activate and deactivate plugin automatically
- WooCommerce: after install hook
- Theme My Login Shortcode Doesn’t Return Anything
- Import MS-Access data file to make the searchable page
- Include Minit plugin in theme [closed]
- wp_redirect not working on plugin
- dynamic name of the style for wp_enqueue_style
- Inserting Plugins Into Blank Space of Externally Designed WordPress Theme
- Comment Approve – Add custom function when comment is approved
- how to add a comment button to be displayed only for the posts in the home page [closed]
- Disable Checkbox depending on state of another checkbox
- Should meta boxes for specific pages be save in their own plugins?
- How to handle a WordPress blog with articles in different languages?
- Change plugin author after someone leaves the company
- How to implement a plugin featuring foursquare like check-in
- how to render dashboard widgets conditionaly in wordpress admin
- Redirect plugin after form submit or show errors
- Plug-in that shows x number thumbnails from another post
- How to data add to table when update post wordpress? when we clicked!
- can’t unzip file
- WooCommerce – I want to add functionality of one plugin to another plugin — best approach?
- How to stop Facebook mobile in-app browser cache on WordPress
- ACF Fields are not showing up on Homepage
- WordPress not encoding “Ă©”
- How to create a page with the selected template after activating the plugin
- I enabled debugging but I still get the same message: There has been a critical error on your website
- wp_mail function not working in WordPress Plugin Boilerplate
- How To Remove “All, Publish, Draft and Expired” in Events Dashboard
- Implementing Scrollable Images
- Could someone maybe point me in the direction of a decent tutorial on how to create a wordpress plugin that is compatible with another plugin please?
- Javascript inserted from Plugin pointing to wrong location
- How to setup same post slug for different categories?
- ReferenceError: dokan_assets_url is not defined
- Trending Tags based on post views
- Plugin installation error in wordpress
- get Options value in “external” page
- Non english charcters support for WP Customer Reviews
- What possible reasons can cause my plugin not to be listed in the plugin search in the back-end of wordpress installs?
- how to load a file from a plugin when a url is passed
- Create custom fields on a post
- Is it possible to cancel a post status transition?
- How to use template field in the Event Organiser plugin widget
- Facebook Like Button with NextGen Gallery
- Activate plugins by a theme’s functions.php?
- Notify new post on page
- when i use wp automatic plugin post shows broken images
- iframe not showing on frontend when using a CMB2 field
- Template library for WordPress [closed]
- Is option_active_plugins actually doing anything useful?
- How to add infinite scroll to element products widget
- How can I resolve an error on WordPress after PHP update
- upload_mimes is getting ingored, how to add a new mime type?
- PHP FATAL ERROR
- Remove a specific sitemap from Sitemap_index.xml
- Testing Plugin – Install plugin dependencies in testing enviroment
- Show different page depending on user role
- Email notification when registred user clicks a link/visits page