Memory is not the issue here. There are no complex operations, and the difference will be almost unmeasurable.
What matters is readability: If your stuff
function is rather short (less than eight functional steps) and you use the check just once – keep the check in it.
But if you need the support check in different functions separate it.
I’d rather optimize the names: greatness
is not very descriptive, and while I like fluid layouts – they are not a synonym for great layouts. 🙂
Also, it is a custom name, so prefix it to avoid collisions with plugins and to tell the uninformed reader (you, one year later) that it is something custom.
Suggestion for a theme named wpse51275:
function wpse51275_box()
{
// some awesome code …
$box_class="box";
current_theme_supports( 'wpse51275_fluid_layout' ) and $box_class .= '-fluid';
$output = "<div class="$box_class">";
// more awesome code …
}
Related Posts:
- Why isn’t WordPress part of Framework Interop Group?
- When to use Exceptions vs Error Objects vs just plain false/null
- WordPress and event-driven programming – what is it about?
- How to set up phpcs with WordPress coding standard with PHP8?
- PHPCS: Strings should have translatable content
- Some problems calling a function into sprintf() inside functions.php template file [closed]
- Should I use wp_cache in my plugin to make it faster?
- How to correctly add the featured immage (thumbnails) support in a WP theme? Why I can’t add a featured immage?
- Adding theme support for a custom header image
- How can one use variables in a template or template part without polluting the global scope?
- How do I use WP_query with multiple post IDs?
- esc_attr() right way and use
- Show content if parent page has children
- Detection of theme being used
- Where to include php files in wordpress and how to refer to them later [closed]
- WooCommerce: How to display item meta data in email confirmation using woocommerce_order_item_meta_end
- How to order posts by modified date without using ‘query_posts’?
- How to add a featured image to a existing post via php?
- How to add 2 posts under another post? Formatting should be intact
- Can’t Find a Way to Edit the Home Page Content [closed]
- Get widget settings function?
- wp_handle_upload_prefilter valid date from input file
- Mysterious HTTP 404 header in my own scripts
- Archive dropdown styling not applied
- Browser title script ignoring is_page /else conditional [closed]
- Add a Different CSS Class Into The Body Tag of Different WP Pages
- Custom php page outside the scope of my theme
- How to get 2 or multiple custom post types in wordpress functions.php
- Interrupting $html.= ‘ for IF statement
- Asking popup for delete post in WordPress [closed]
- Show comments menu in dashboard only if the site has comment
- WP nonce invalid
- Trouble creating conditional PHP for nav menu items with children for custom Walker
- Creating a Multi-Level Associative Object Using AJAX
- Create WP_Query to search for posts by their categories or their parent/child categories
- add_action shortcut?
- How to deal with checkboxes in edit page?
- Must I download entire WP directory for each separate instance/website that uses WP?
- Pass variable from one function to another
- Embed html in php code
- How can I dynamically update the class in my shortcode?
- How to edit widget code to add unique class name to each div?
- Does wordpress templates always in files or in database?
- Concatenate output of php function into string
- Why File_exists returns true with or without ABSPATH?
- how much php coding do i need to know in order to create web blog using wordpress.org
- Pull GetOption() variable into jQuery dynamically created html
- Parse error: syntax error, unexpected end of file
- How would I use this filter to change the output of the date format to “Twitter time”?
- WP Business Directory Manager Plugin Admin Listings?
- wordpress admin plugin menu custom css
- wp_insert_post() with HTML tags using PHP
- Shortcode not staying inside div tag
- HTML showing after PHP code in tag
- Why i can’t get custom fields value or post ID via Ajax?
- Fallback image URL if no featured image exists via a shortcode function
- Limit tags shown in post
- Unexpected token ILLEGAL, even on clean install – jquery-issue?
- Get value from db for custom contact form
- PHP time function ($today) for GMT +1
- Add class to every other posts using get_posts
- WP insert post Redirect after function has executed
- Uncaught TypeError: extract(): Argument #1 ($array) must be of type array, null given
- add_action in namespace not working
- How to Send Pingbacks for all Posts in WordPress?
- Featured image in menu wordpres
- Has a PHP update given me a 404?
- Replace background image with post thumbnail in shortcode
- Using A PHP App in WordPress
- HTML comment cause issue in functions.php script root
- Custom User registration system
- how to create a user rule that can only manage support tickets?
- Programmatically add a product to the cart and set price to zero when buying from certain category
- I want to show cart items number if any or nothing, simple CART text
- How to prevent adding data to a localhost database after refresh?
- Generating 3 random numbers and saving them in database
- Find and print first entry from WordPress post in custom excerpt?
- Trying to reload page with update_option_{$option} hook causing infinite reload
- PHP warning with code for nav menu walker [duplicate]
- Error inserting into custom table – Object of class wpdb could not be converted to string [closed]
- Get the image title and alt from custom query
- How to Retrieve All Category Images on Front-End
- Switch position of elements in the footer [closed]
- media_handle_upload fails with gravity form submitted image
- how to display woocomerce description of each category in wordpress? [closed]
- Problem with ajax request and directory structure after site migration
- Notify admin (by email) if post added with specific tag
- uploading a new theme to live server
- Display post from a category
- WordPress HTML Helper
- See output of a sql query while plugin installation in wordpress
- Shortcode Display From WordPress Dashboard Page Without Using post_id
- Warning: preg_replace(): Compilation failed: unknown option bit(s) set at offset -1
- Amending PHP for WordPress Theme
- Send foreach $_post method to contact form 7 [closed]
- Null value given when confirming email’s
- Predefine Magazine Style Layouts
- how to create twitter card without plugin in wordpress website?
- How to use phpspreadsheet reader with $wpdb
- How to modify default tags in wp_head()