Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

WP nonce field checkbox prints checked=’checked’ outside input field

This is because you have used the checked() function, which echoes its value, inside another echo statement. If you are adding a value to a string you need the function to return a value. This can be done by setting the third argument, $echo, to false:

echo '<lable for="zoom_activity_state"> <input type="checkbox" name="zoom_activity_state" value="' . $zoom_activity_state . '" class="widefat" ' . checked($zoom_activity_state, true, false)  . '/> Is comming soon?</lable>';

You’ve also spelt <label> incorrectly:

echo '<label for="zoom_activity_state"> <input type="checkbox" name="zoom_activity_state" value="' . $zoom_activity_state . '" class="widefat" ' . checked($zoom_activity_state, true, false)  . '/> Is comming soon?</label>';

Related Posts:

  1. Save metabox with multiple checkbox array
  2. update post meta for checkbox in the admin when inserted in the front-end
  3. Add a Save Button to Custom Meta Box [duplicate]
  4. Any way to update_post_meta with html content? It gets stripped and becomes empty
  5. Adjust query on single
  6. Why is $_POST empty when saving custom Meta Box?
  7. Post meta vs separate database tables
  8. Get List of Registered Meta Boxes and Removing Them
  9. How to add tab which is visible only in admin side of product in woocommerce? [closed]
  10. Dashboard like meta boxes in my plugin – how to save their position and open/closed state?
  11. How to Use WordPress Color Picker API in Custom Post Type Metabox
  12. How to create Image gallery Metabox in wordpress [closed]
  13. How to enable users to down-vote in this simple voting counter (that uses the post meta)?
  14. Conflicting save_post functions when passing the post id and saving custom meta boxes for different post types
  15. How to add meta boxes to the ‘Add new post’ screen?
  16. Rearranging Dashboard meta boxes with use of plugin/functions.php
  17. How can I free up the memory used by update_post_meta?
  18. How to add multiple featured image in meta box in post editor?
  19. Plugin admin page meta_box toggle and order state not saving
  20. Is there a way to list tags order by post_meta field
  21. Metabox Not Showing on Custom Post Type But On Pages and Post
  22. Using radio button meta data from a custom meta box
  23. Best choice of options/settings framework for plugin/theme development
  24. Plugin development: get_post_meta is not working [closed]
  25. Ordering posts by metadata
  26. Act on user meta updated, but only once
  27. Admin auto-refresh is interfering with Firebug — how to prevent it?
  28. Show add_meta_box by selecting a specific category
  29. How to check if Woocommerce Order number equals to post ID?
  30. 403 Error when text is pasted in Custom Metabox Textarea
  31. Custom Taxonomy to dropdown box on adminside wordpress
  32. Create & Save multiple Meta-boxes
  33. Saving value of a selection option in comment form as comment meta
  34. Dashboard – get status and position of metaboxes and pass them to ajax method
  35. Plugin with action ‘save_post’ needs to press publish twice on order to publish
  36. Getting List of all registered Dashboard Widgets
  37. what is the difference between these phares?
  38. How to get Metabox custom field to show checked if value is updated using post meta query?
  39. How do I update a field of a meta box?
  40. Input value from metabox is not found in $_POST after post save
  41. Doubts about the use of metadata and how this can affect performance on WordPress
  42. update_post_meta not working in a loop
  43. Run Shortcode of post’s custom field in functions.php / Plugin
  44. Get draggable widgets on Edit Post page
  45. Including comments meta box on a plugin page
  46. How to add a widget to the post editing view?
  47. Adding admin menus to wordpress
  48. Automating the process of shortcode generation in a plugin – how is it done?
  49. Meta box on options page save form problem
  50. Moving/dragging a metabox removes TinyMCE’s content
  51. Store custom meta box data as serialized array
  52. Ajax: Populate with content from a post’s ID not working – duplicating current page html instead
  53. Adding custom meta boxes to specified custom post type
  54. Issues Updating Post Meta with AJAX (Seems simple but cannot figure it out)
  55. How to add custom post widgets as tags into wordpress
  56. Using delete_post_meta for deleting multiple selected options
  57. Get audio metadata on file upload
  58. Plugin can’t be activated [closed]
  59. Remove Meta-boxes (Yoast SEO plugin) [duplicate]
  60. Is there a way to add a link with add_post_meta?
  61. Can I attach a plugin via my add_filter callback contents?
  62. Metabox is not displaying
  63. Catch metabox values in Plugin
  64. want to show CMB2 metabox on woocommerce product data tab
  65. WP_List_Table Inside Metabox With Bulk Actions Not Working on Submit
  66. Condition to check previous next article post title
  67. register_meta not showing custom post type metabox data in rest api
  68. Insert, update or remove data from database (usermeta)
  69. Save meta box data from selected dropdown list in bbpress reply form
  70. Metabox types list
  71. WordPress Filesystem create CSS-File – get Shortcode ID for Name
  72. How to save multiple values in custom post type from front end to back end
  73. add_meta_box does not display meta box in Admin
  74. Add WordPress Meta Box saved form input to WordPress RSS feed [duplicate]
  75. set a custom post type to a taxonomy term programmatically in metabox
  76. Unexpected issue when using attachment_fields_to_edit filter
  77. WordPress delete mysql rows with string
  78. Dynamically getting tags in post edit screen
  79. Saving post meta
  80. Displaying Custom Post Meta
  81. How to show metabox just in post.php in admin?
  82. Plugin dev: How to multiply instances of a plugin in the same metabox?
  83. Include add_post_meta in a plugin
  84. save_post not called in plugin / custom field still saving overwriting metaboxes
  85. Get fields of a widget
  86. Display Data’s metabox in page
  87. Show Metabox Images in slideshow instead of static
  88. How to set/change another post author by custom fields or something else?
  89. A better way of getting draft posts that has a particular post meta using get_posts function
  90. Saving metabox updates causing fatal error
  91. Secruity Questions on a timer
  92. Make wordpress join default user metas with a column from another table while displaying the wp_users table on the users screen
  93. AJAX button with success callback. (Titan Framework)
  94. Is there any way to fire heartbeat API from for website visitors?
  95. How to output functions from plugin inside theme
  96. ajax working when function is on child theme but not in plugin page
  97. modify show UI of a registered taxonomy
  98. I need to refresh page to display wp_get_current_user() : why?
  99. Look for a file in a theme before loading from plugin
  100. AJAX call to admin-ajax.php by subscriber returns home page
Categories plugin-development Tags metabox, plugin-development, post-meta
How to keep the capability of users and disable Gutenberg editor in WordPress?
WooCommerce – set session with new cart item meta when updating cart item quantity [closed]

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress