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. useSelect() plus resolver result is serving cached data incorrectly
  10. Trigger Javascript on Gutenberg (Block Editor) Save
  11. Gutenberg – remove / add blocks with custom script
  12. Show control conditionally in Gutenberg
  13. Gutenberg custom block plugin with custom image sizes
  14. How to get the ToggleControl Gutenberg component working for a PHP Block
  15. Is there a core Sortable component in Gutenberg?
  16. conditional layout based on if Innerblocks is not empty
  17. getEntityRecord without knowing the post type
  18. Gutenberg extend blocks add new class name
  19. initial open/toggle PluginDocumentSettingPanel panel in document setting block editor gutenberg
  20. Get updated meta data after save_post hook
  21. Is there an equivalent of the PHP function sanitize_key in Gutenberg?
  22. 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?
  23. How do I fire a snackbar notice in admin?
  24. Gutenberg Modify core taxonomy panel element via wp.hooks.addFilter
  25. What is “open()” in MediaUpload?
  26. Why is this gutenberg custom format button only available from the toolbar as a dropdown?
  27. Provide specific example for block variation
  28. How to save a ToggleControl value in a meta field?
  29. How to handle Gutenberg wp.data async errors?
  30. Set current tab on a Gutenberg TabPanel component from outside that component
  31. Block editor: How to check if block editor has initialized and populated the data store?
  32. Load script after block is inserted
  33. Gutenberg block “This block appears to have been modified externally” on save
  34. How do I access site and block editor state data and use `useSelect()` or `withSelect()` to bind it to my components?
  35. Gutenberg passing block attributes to component in ES6/ESNext
  36. Can the index.asset.php file be used with the enqueue_block_editor_assets action?
  37. How can I add Block Style support to the core HTML block in Gutenberg?
  38. var is undefined in a Gutenberg block
  39. Gutenberg add extra attributes to custom format
  40. How to update a meta field of type array in Gutenberg
  41. Using wp.data.select get actual tags (not id’s) used in post
  42. How to remove p / br elements from gutenbergs editor
  43. Programatically update posts in database from one block to another using transform
  44. Gutenberg getMedia() in post query doesn’t return all featured images
  45. How to transform a legacy widget into a block
  46. Gutenberg: Block validation Failed Richtext undefined
  47. Gutenberg select categories
  48. Add custom HTML markup to Gutenberg RichText
  49. Listening change event of taxonomy term checkboxes in Gutenberg editor
  50. Gutenberg get core data – search
  51. What is the correct way to import the blocks-editor?
  52. Gutenberg extend blocks add new class name
  53. How to add classes and events to image in javascript using Gutenberg?
  54. Checks when fetching data from multiple REST API endpoints in Gutenberg
  55. Using apiFetch for retrieving post data in Gutenberg
  56. Looping over wordpress meta to create “ ‘s?
  57. How to display post content in the block editor
  58. How to load an additional script for a block in the block editor?
  59. is_front_page() variable not found
  60. what is the purpose of the namespace argument when customizing blocks?
  61. Gutenberg consume wp-json data and reflect in frontend the content
  62. How can I import one custom block into another?
  63. Gutenberg Blocks: how to determine an index of the current inner block?
  64. Gutenberg select excerpt, use generated excerpt or use more block excerpt
  65. Gutenberg dependencies in package.json
  66. find out reason of “Updating failed” in Post-editor
  67. Gutenberg RangeControl
  68. Hook a script as the very last one before the closing body tag
  69. Problem extending a core block
  70. Cannot read properties of undefined (reading ‘show_ui’) Error on WordPress Post Editor
  71. Add a Page Screen is Visually Blank
  72. Refresh Gutenberg with JS for it show updated post
  73. Including dependencies using @wordpress/dependency-extraction-webpack-plugin
  74. Gutenberg sidebar show input field on toggle
  75. Get the ID of a page in Parent combobox in editor
  76. Uncaught TypeError: r is not a function
  77. Update block once an API request returns with a value
  78. How do I make a savable preview like Youtube Gutenberg block?
  79. iFrame onLoad in custom Gutenberg block
  80. Custom Media Meta fields to alter the generated image HTML that is inserted into a post for my animated GIF image player?
  81. WordPress Gutenberg: Attribute overwritten by block duplicate
  82. Table block variation with header section activated
  83. Filtering Gutenberg Components, not Blocks
  84. Where to include JS library in gutenberg blocks
  85. Passing object to FormTokenField suggestions
  86. Is it possible to add javascript to template parts
  87. How to add a new attribute to core wp block editor without npm?
  88. How do i get an Inline style in Gutenberg Block show up in front end?
  89. Gutenberg core/file add style support in js/ json
  90. Working with a non-React external library in a custom block
  91. Create Youtube embed block with createBlock
  92. Masonry gallery block is working in the block editor but not the template editor
  93. How to change the selected Template using javascript?
  94. How to import the imagesLoaded and Masonry libs that come with WP in a Gutenberg block?
  95. How to use useSelect to retrieve the currently default fontFamily?
  96. How to build BOTH non-block components and blocks present in the /src directory using @wordpress/scripts
  97. Metabox conditionals depending on post format and template in Gutenberg
  98. How to re-render Gutenberg component when object instance is available
  99. How to access current discussion settings in gutenberg via JS?
  100. Gutenberg DatePicker component with time set to zero
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
  • 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