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

Why is my Toggle field not showing in Gutenberg?

You forgot to declare the attributes:

registerPlugin( 'page-layout-plugin', {
    icon: 'smiley',
    attributes: {
      'showSidebarAttribute': {'type': 'boolean', 'default': true}, // <-- and maybe others
    },
    render: ( props ) => {

You can drop the quotes of the properties, of course (they are optional), I keep them because the equivalent statement is copied over from the PHP part where the quotes are necessary:

 'showSidebarAttribute' => ['type' => 'boolean', 'default' => true],

Related Posts:

  1. Proper, exhaustive documentation for wp.editor etc
  2. Edit srcset and sizes attributes in Gutenberg image, cover and gallery – blocks
  3. How to sanitize select box values in post meta?
  4. Strategy to get post meta for use outside the loop
  5. Add colors to existing color palette without replacing it
  6. Can you filter posts by meta key with the getEntitityRecords selector?
  7. Set Expiration Date of a Post from the Frontend with wp_insert_post
  8. WP Gutenberg custom block – generate theme colors from SASS and use them in the inspector and php callback
  9. create blocks programmtically on theme activation
  10. Can I customize any WordPress parent block-based theme template files by child theme like a parent classic theme?
  11. How to support Lazy Loading Assets in a WordPress Theme?
  12. WordPress Gutenberg Theme: Structure, Hierarchy and Custom Templates
  13. Gutenberg Reusable Block as part of WordPress Theme page
  14. Is there a need for nonce with Post Metabox?
  15. Custom button block doesn’t work
  16. How to float an image in Gutenberg
  17. Gutenberg – editor-font-sizes in functions not working
  18. Metadata Query when storing data as array possible?
  19. Can’t select my block by clicking on it
  20. Which file handles the block latest posts, I want to examine excerpt handling
  21. create-guten-block in wordpress theme?
  22. What VSCode extensions are there for working with block themes? [closed]
  23. What is the “correct” way to add hooks or similar PHP behavior to a blocktheme?
  24. Not able to select width of blocks inside of cover block
  25. How to check if a WordPress core block is active in sidebar
  26. gutenberg add classes to list items
  27. How do you replace content generated by custom fields with custom blocks in Block Editor?
  28. Custom Blocks as part of a theme
  29. Wp Super Cache stops the update of a Post Meta
  30. How to wrap all titles generated by Gutenberg “Heading” block with tag
  31. How to show specific post meta?
  32. How to add InnerBlock multiple times in the same block
  33. Moving post title down the page / Removing a block from a post
  34. Running a function on post update with new post meta
  35. HTML block gutenberg templates
  36. Gutenberg theme development: how to add “headers” option under styles > colors > elements?
  37. Is it possible to set a variable for get_post_meta?
  38. Get attachment meta (I need attachment ID, unsure how to find it)
  39. How can I sort my loop based on meta data, using a form?
  40. Change default rel attributes for Image Block & Button Block
  41. Related Post Category Filter
  42. How to update mark-up of a gallery block in a custom theme?
  43. Auto focus RichText field
  44. How to create nested array attribute
  45. Show popover with url and option to open in new window
  46. How to Modify WP_Includes/blocks/latest_posts.php
  47. How to render block editor in wp-admin custom pages programmatically
  48. Social-Link block not loading html on page with custom theme
  49. How to diagnose wp-env environment problem
  50. Attribute form NumberControl doesn’t update when I update page before it lose its focus
  51. WP Gutenberg custom block – generate theme colors from SASS and use them in the inspector and php callback
  52. Posts Page shows Classic Editor interface not Gutenberg
  53. How can I include custom Gutenberg Blocks in a theme?
  54. Block validation failed for `core/pullquote` after adding theme support for editor-color-palette
  55. Is there a way to add classes to a page when using a Gutenberg reusable block as page layout?
  56. Make a custom field in admin post.php read only
  57. Change default options on attachment page
  58. Correct way to make a custom block theme responsive
  59. Multiple content areas with Gutenberg – Transparent areas mid content
  60. Insert gutenberg blocks into template
  61. After a while attachment meta data is missing “sizes” data
  62. Template for posts of category in block theme?
  63. Can’t select my block by clicking on it on apiVersion – but using blockProps
  64. How can I use pre declared blocks in a php file?
  65. Is there any filter or action hook to remove layout classes from appearing in my templates?
  66. Full site editing templates folder vs block-templates
  67. How to set the margin on an innerBlock in a block variation?
  68. Align images to the left of the content
  69. Image and font support missing in editor when deploying theme remotely
  70. When trying to run build script with gutenberg (with SVG import) – Error: Plugin name should be specified
  71. Block to show posts from same category
  72. Unwanted spacing for cover block
  73. Activate Gutenberg group block for theme
  74. How can a theme define which settings for blocks are available in the block editor?
  75. How to add multiple custom blocks in custom WordPress theme using create-block?
  76. How to create a template for a post in Query Loop block?
  77. Force post update with React
  78. WordPress 6.4.2 – can’t load editor style css using ‘after_setup_theme’ or ‘admin_init’ actions
  79. How to add group-row to InnerBlock template?
  80. useBlockProps() nests wrapper with class name inside block wrapper in the editor
  81. Disable interactivity for core navigation
  82. Full Site Editing, Block Theme, Gutenberg, Site Editor
  83. FSE Change Post Template to Something Other Than a List
  84. how to combine wordpress and front framework
  85. How do I access the current post object within a block theme template or pattern?
  86. Get url of thumbnail from the media uploader
  87. How to use logout function on custom menu link?
  88. Hide certain pages / posts on wp-admin, show custom filter
  89. use add_action(‘wp_head’) in a widget for generating dynamic CSS styles
  90. Front End Post Submit Form
  91. Displaying wp menus by name without using theme locations
  92. HTML added to editor when deleting shortcodes in Chrome browser
  93. How to include a file only on dashboard widgets page?
  94. Trouble in creating a custom template on twentyeleven theme
  95. Embedding CodePen Calorie Script – jquery error
  96. Is it possible to echo a woocommerce prouct attribute discription?
  97. Duplicate child theme incl. design changes
  98. Create image with imagepng() (fails at header)
  99. RSS feed url showing page not found. How to solve it?
  100. Search Results not displaying for multiple word search
Categories theme-development Tags block-editor, post-meta, react, theme-development
How to create multiple urls for a same page contents in wordpress
selecting custom post types and taxonomies for hub page listing blocks

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