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

Issue migrating a checkbox-type meta field to the block editor

I found the culprit. I had to change the nonce check in save_custom_post_type() to:

if ( !isset( $_POST['metabox_nonce'] ) || !wp_verify_nonce( $_POST['metabox_nonce'], basename( __FILE__ ) ) ) {
    return $post_id;
}

Related Posts:

  1. How to use wp.hooks.addAction() in React JS/Gutenberg?
  2. Extend core block in Gutenberg
  3. Hooking a callback into the code within a Gutenberg block
  4. What do the args for Gutenberg subpackage “hooks” function “doAction” mean?
  5. Use useSelect/useDispatch instead of withSelect/withDispatch
  6. How to use wp.hooks.addAction() in React JS/Gutenberg?
  7. useSelect second parameter
  8. Get terms of a taxonomy using useSelect
  9. Force-update the meta variable first set using `var [ meta, setMeta = useEntityProp( ‘postType’, postType, ‘meta’ );`
  10. useSelect() plus resolver result is serving cached data incorrectly
  11. Trigger Javascript on Gutenberg (Block Editor) Save
  12. Set default image link target in Gutenberg image block
  13. Gutenberg – remove / add blocks with custom script
  14. What are all the query parameters for getEntityRecords?
  15. How to only enqueue block javascript on the frontend when its needed [duplicate]
  16. Show control conditionally in Gutenberg
  17. Gutenberg custom block plugin with custom image sizes
  18. Get loading state of wp data selector
  19. How to get the ToggleControl Gutenberg component working for a PHP Block
  20. Is there a core Sortable component in Gutenberg?
  21. conditional layout based on if Innerblocks is not empty
  22. getEntityRecord without knowing the post type
  23. Gutenberg extend blocks add new class name
  24. initial open/toggle PluginDocumentSettingPanel panel in document setting block editor gutenberg
  25. Get updated meta data after save_post hook
  26. Is there an equivalent of the PHP function sanitize_key in Gutenberg?
  27. When using the block.getSaveElement hook can you output different markup based on whether or not you are in the edit view or the live page view?
  28. Better post meta efficiency?
  29. How to add extra attributes to the script tag added via wp_localize_script()
  30. Correctly handling WordPress core data retrieval in Gutenberg
  31. Is there a client side API for handling transients or options?
  32. How do I fire a snackbar notice in admin?
  33. Gutenberg Modify core taxonomy panel element via wp.hooks.addFilter
  34. What is “open()” in MediaUpload?
  35. Why is this gutenberg custom format button only available from the toolbar as a dropdown?
  36. Adding a text element in between title and blocks container
  37. Setting HTML properties in a Gutenberg plugin using WordPress settings
  38. Gutenberg RichText
  39. Provide specific example for block variation
  40. How to save a ToggleControl value in a meta field?
  41. How to handle Gutenberg wp.data async errors?
  42. Set current tab on a Gutenberg TabPanel component from outside that component
  43. Block editor: How to check if block editor has initialized and populated the data store?
  44. Load script after block is inserted
  45. Gutenberg block “This block appears to have been modified externally” on save
  46. How to get value of selected page template in Gutenberg editor?
  47. How do I access site and block editor state data and use `useSelect()` or `withSelect()` to bind it to my components?
  48. @wordpress/components Button variants not styled
  49. Block Editor: How to get title and post content within the WordPress admin UI in Javascript?
  50. Custom block SelectControl works but equivalent ComboboxControl gives errors – where’s my mistake?
  51. Gutenberg passing block attributes to component in ES6/ESNext
  52. Can the index.asset.php file be used with the enqueue_block_editor_assets action?
  53. How can I add Block Style support to the core HTML block in Gutenberg?
  54. var is undefined in a Gutenberg block
  55. Gutenberg add extra attributes to custom format
  56. How to update a meta field of type array in Gutenberg
  57. Using wp.data.select get actual tags (not id’s) used in post
  58. event/callback on block update?
  59. can a buttongroup have a label?
  60. How to remove p / br elements from gutenbergs editor
  61. How to disable inline css styles generated by Gutenberg editor?
  62. Programatically update posts in database from one block to another using transform
  63. Gutenberg getMedia() in post query doesn’t return all featured images
  64. InnerBlocks restricting does not work on nested blocks
  65. How to transform a legacy widget into a block
  66. Gutenberg: Block validation Failed Richtext undefined
  67. Add A Tag To A Post Through JavaScript In Gutenberg UI?
  68. Gutenberg select categories
  69. Add custom HTML markup to Gutenberg RichText
  70. Listening change event of taxonomy term checkboxes in Gutenberg editor
  71. Adding nonce or hashes to inline scripts
  72. How to return div with custom attributes(Coding a Gutenberg Block)
  73. Gutenberg get core data – search
  74. What is the correct way to import the blocks-editor?
  75. Open MediaUpload from external component in Gutenberg
  76. Get Block Attributes in JSON REST API
  77. Open Featured Image Modal in WordPress Gutenberg onClick of a button
  78. Gutenberg extend blocks add new class name
  79. How to add classes and events to image in javascript using Gutenberg?
  80. Checks when fetching data from multiple REST API endpoints in Gutenberg
  81. Search for a keyword across post types in a Gutenberg component
  82. Using apiFetch for retrieving post data in Gutenberg
  83. Add custom classes for blocks in editor based on custom attributes
  84. Looping over wordpress meta to create “ ‘s?
  85. How to display post content in the block editor
  86. How to load an additional script for a block in the block editor?
  87. is_front_page() variable not found
  88. How can I allow HTML in Gutenberg UI elements help text?
  89. what is the purpose of the namespace argument when customizing blocks?
  90. Gutenberg consume wp-json data and reflect in frontend the content
  91. Trigger wp-embed via JavaScript to refresh iframe preview?
  92. How can I import one custom block into another?
  93. Gutenberg getBlockIndex in save() function
  94. Gutenberg Blocks: how to determine an index of the current inner block?
  95. Widgets and Post/Page edit/new blank, console errors only, no server errors
  96. Trying to turn the Edit function into a class to be able to use React lifecycle methods
  97. Gutenberg richtext block vaildation failed
  98. UnitControl – Block has encountered an error
  99. Conditional save return on Gutenberg Block
  100. Gutenberg select excerpt, use generated excerpt or use more block excerpt
Categories javascript Tags block-editor, hooks, javascript, post-meta, save-post
“File not found.” appears often while navigating wp-admin
Rewrite rule not working, but only when parameter is text

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
  • Post Navigation Elementor
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • WPFacet multiple loop displaying duplicate content
  • Get the name of the template/*html file used
  • Fix: WordPress.DB.PreparedSQL.NotPrepared Plugin Check (PCP)
  • Removing unnecessary CSS and JS code from wp_head()
  • hexagonal image gallery. Am I on the right track? [closed]
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
© 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