Not possible. You may do both, but may not be as optimal as single line:
$verify = (empty($var)) ? 'current_value' : $var;
checked( $verify, $current );
Or you can create a custom function:
function better_checked($check, $current, $echo = true) {
$result=" checked="checked"";
if ( ( $check != '' && $current != '' ) && ( (string) $check !== (string) $current ) )
$result="";
if ($echo)
echo $result;
return $result;
}
Related Posts:
- How do I change/modify the_post_thumbnail(); html output?
- start_lvl Ignored in Custom walker_nav_menu
- Modify previous and next text from pagination links
- Calling a method from functions.php on a click of a button
- HTML table from shortcode with multiple parameters
- Placing raw HTML inside a WordPress shortcode
- Slide in Panel WordPress Post
- Shortcode content output but not in correct place
- Add itemprop Schema.org Markup to li Elements in wp_nav_menu
- Removing unneccessary p-tags (Not every p)
- Add a class to the anchor tag on HTML5 gallery
- Where in PHP do I move title and meta (date) to bottom of each blog section?
- Converting HTML Template to WordPress Theme
- Populate dropdown with Child Pages based on Parent Page chosen
- How to store data from multiple forms using ajax and php
- Use DOMDocument with ob_start breaks my HTML code
- Add .htm extention to a custom taxonomy
- Noscript not working as it should in wordpress site
- How to make modifications only to certain elements of an HTML string on the server-side?
- Widget back end radio button issue
- Adding function to child theme’s function.php
- Calling function in loop causes repeat data
- How can I use custom menus with a Bootstrap WordPress theme?
- Time Delay a URL Redirect for Specific Page
- how to changes mobile menu toggle breakpoint in WordPress
- WordPress User Meta value variable into Google Gauge Chart
- Adding HTML Code to Replace Text in PHP
- PHP function for horizontal Woocommerce thumbnails and badges
- How to use data URL in WordPress?
- HTML comment cause issue in functions.php script root
- Remove span tags from WooCommerce Downloads page
- How to center all text body in single.php at once?
- How can I get my pagination loop to display the correct number of total pages?
- Can’t get_users info by using json_encode
- Show post/page into div using function
- WordPress HTML Helper
- Cant get theme to change footer color through theme customizer
- Sorting Problem
- Add multiple HTML attributes to an Elementor button
- How to get the custom header image’s alt text?
- Cleaning up WordPress to improve performance?
- How can I modify the permalink via a filter?
- wp_set_object_terms and arrays
- How to use WordPress (PHP) functions in AngularJS partials files?
- The best way to customize “nav-menu-template.php” to add if the ‘link_before’ is “checkbox”
- enqueue multiple Google fonts with multiple weights and styles (italic)
- Correct syntax to html php conversion
- Can’t load WP function into external function
- Image as Sales Badge
- Getting a specific post values to another div or modal
- WSoD being caused by this piece of code
- How to Arrange PHP Files to Allow for Multiple Types of Pages?
- How to complete two other input fields, completed the first
- WP grandchild categories in nested ul li
- Retrieve $_POST data submitted from external URL in WordPress(NOT API)
- Compare the old get_theme_mod($name) to the new get_theme_mod($name) return value
- Scrape external webpage for first image and add it to new post
- jQuery code not working when included in functions.php
- Fatal Errors on pluggable.php
- Log in / Log Out Custom Button
- How i can get post data from database when i am getting post id from url in wordpress
- Limit Taxonomy Output in Conditional Statement
- wp_redirect only works on main site and not on other sites
- Fatal error: Call to undefined function register_new_user()
- How to modify the default feed via a function
- require_once() if a product in woocommerce contains a tag [closed]
- Loop over Array and get the distinct ids
- How do I change this function from two returns to one string to show sku and dimensions in WooCommerce cart?
- Where can I find the inline-css of my theme header?
- how to enqueque code in a php file from functions.php
- Convert all uploaded PNG files to PNG-8 format
- Uses for function: wp_update_user
- How to Redirect Buddypress Directories To Login Page For Non Logged in Users
- WordPress Post Block Element not properly parsed with the_content filter
- Display logged in user name and lastname on page
- How to Add a cutsom slug to my custom author role
- How to output the taxonomies that are assigned to each custom post?
- Exclude category from function – PHP
- opens like sitename.com/URL
- How to display post meta bellow every posts
- Hide a specific category title from displaying on site
- Need help with AJAX login to call php in functions.php to handle redirects based on user cap (role)
- Populate Posts based on category selected using AJAX that means without page refresh
- PHP script to redirect traffic based on website accessed
- How to remove title tag with this filter
- Why transition_post_type hook is called twice for the same post?
- What is wrong in this code?
- Can’t put a hyperlink on Featured Post’s Image
- Page returning ID from array, how to return the correct values for post in acf wordpress
- Permission error on plugin save
- Removing all my hardcoded URLs with get_site_url()
- get_post_meta is always empty when I use wp_mail
- Display default WordPress login/registration form into a modal window
- Highlight main menu when on specific posts or pages
- Pull GET parameter from URL in functions.php
- Adding Gravity Form With if(is_page) Is Not Working
- Implement “No related posts for this entry” into the loop?
- Woocommerce – Shipping tax class based on cart items not using the highest tax available
- ACF repeater image in video poster with jquery
- Generate and upload screenshot as featured image for user-submitted post