If you have registered your option without setting the fourth parameter $autoload
to no
your calls to get_option
will not trigger any extra database call because all aotoload options are stored in the cache when the site is loaded.
To test it add …
define( 'WP_DEBUG', TRUE );
define( 'SAVEQUERIES', TRUE );
… to your wp-config.php
, install the plugin Debug Queries and look at the real queries.
Related Posts:
- Remove Customize Background and Header from Appearance admin menu without CSS or JS
- Why is this Ajax not working?
- Proper use of Output Buffer for a whole php clas
- Image not displayed
- Adding Media button to only pages
- $_html is empty when var dumped
- Why have on every line
- Remove update nags for non-admins [duplicate]
- How to check if woocommerce is activated in theme
- Function to return true if current page has child pages
- add_action in namespace not working
- WordPress Themes and PHP unit
- How to determine if WP_DEBUG is enabled? [duplicate]
- PHP unit testing WordPress?
- Any guides on creating custom admin pages?
- Does an activated plugin automatically mean its methods are available to other WP functions?
- Proper use of Output Buffer
- Include a external PHP file into a WordPress Custom Template
- List of all theme customizer control types?
- Need help setting default setting value for radio button in theme customizer
- Get author full name
- Is having multiple theme customizers for different pages possible?
- How to export/import theme customizer settings?
- How to remove hardcoded characters from playlists?
- function_exists call in function.php
- Is it possible to get a theme customizer setting from wp.customize using jquery?
- Debugging an error: wp_enqueue_style was called incorrectly
- renaming an admin menu item with decimal array index number
- Conditionally loading JavaScript based on the Advanced Custom Fields in the post
- reason of splitting theme files to multiple files
- Jquery no more loading, load-scripts.php not found (404)
- Admin Bar (Toolbar) not showing on custom PHP file that loads WordPress
- How do I remove a require_once admin panel from the parent theme from the child theme functions.php?
- How to get the registered sidebar’s name by its id?
- is there a simple way to list every templates / php files used to generate a specific page?
- Set the transport of the Customizer ‘header_image’ core setting to ‘postMessage’
- Dynamically change feature image in customiser
- Best way to extends core classes in theme?
- One button to change all settings in theme customizer?
- Handling error states with admin_post
- Custom HTML structure in wp_list_categories
- Installing wp3.2.1 on IIS; getting empty sessions
- Guidance with The Loop for CMS
- Hide a menu-item and its submenus and display a ‘Log in’ link if the user is logged out
- The best way to customize “nav-menu-template.php” to add if the ‘link_before’ is “checkbox”
- How to use copy() function and paste file in /wp-content/themes directory
- Why isn’t my if/elseif/else working correctly here?
- How to use SRCSET with get_the_post_thumbnail()?
- Design view breaking on Pages
- Adjust the results quantity for Search Results page pagination
- OOP Plugin Development. Including external object
- Dynamically loaded Theme components based on Customizer Settings values : changes not appearing in Customizer preview – (Workaround found)
- How can I add a class to a single menu item?
- Multiple do_shortcode($content) within one shortcode
- List authors with posts in a category
- Understanding WordPress child theme custom JS loading
- How can I loop into two different DIVS without repeating the DIVs
- Removing unnecessary wordpress files
- Adding Field to Profile “Name”
- Admin Menus – Name Menu different from first Submenu [duplicate]
- Remove css styles from specific page
- Use different javascript files for each page on website
- WordPress loop specific thumbnail size
- Is the regular ajax request method safe or I should use admin-ajax.php?
- WP Plugin + OOP: Adding Menu Page doesn’t create required effect
- Show different Customizer Settings on Page-Tamplates
- How to get custom image size for image uploaded in Customizer
- Initiate only latest version of a class
- Passing array in add_option()
- Add a Custom Class to Admin Menus
- When is is_admin() available?
- do not show web page section when using advanced custom fields pro
- Is it possible to use the featured image of a page as a css background without inlining?
- PHP Customization: Taxonomies and Queries, why? [closed]
- Creating a new page and automatically associating it with a template in WordPress
- I think emoji are killing my WordPress site… How can I debug?
- Widgets not showing in my custom theme
- Unable to set right time in admin and frontend template
- How do I list the_tags() into HTML data-attribute
- How do I translate this string – PHP syntax question
- How to do conditional publishing?
- Site Health : An active PHP session was detected
- Switching between custom templates in a post type of the admin menu
- Am I not understanding plugins?
- Using Font Awesome as post thumbnail
- Can I change a variable in a content part while calling it?
- How to make thumbnail image fit into a div where image dimentions are completely different?
- Why WordPress architecture is not pure object oriented and it don’t use MVC pattern? [closed]
- Custom Logo URL | Help me print the URL of the custom logo I inserted into my theme
- How to display recent posts on home page with custom HTML
- Remove annoying WP Adminbar CSS
- What is the fastest way to load PHP functions that are only used in one theme template?
- My Own layout in WooCommerce pages [closed]
- List User order by ID in Descending order (Backend)
- Extend a class of a plugin
- Differences when using the the_time and the_date functions
- Exclude posts from homepage having a specified tag
- How do I access the media settings
- How do themes render caption texts in extended markup (e.g. “wp-caption” paragraphs)
- Changing the template hierarchy