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:
- Proper, exhaustive documentation for wp.editor etc
- Edit srcset and sizes attributes in Gutenberg image, cover and gallery – blocks
- How to sanitize select box values in post meta?
- Strategy to get post meta for use outside the loop
- Add colors to existing color palette without replacing it
- Can you filter posts by meta key with the getEntitityRecords selector?
- Set Expiration Date of a Post from the Frontend with wp_insert_post
- WP Gutenberg custom block – generate theme colors from SASS and use them in the inspector and php callback
- create blocks programmtically on theme activation
- Can I customize any WordPress parent block-based theme template files by child theme like a parent classic theme?
- How to support Lazy Loading Assets in a WordPress Theme?
- WordPress Gutenberg Theme: Structure, Hierarchy and Custom Templates
- Gutenberg Reusable Block as part of WordPress Theme page
- Is there a need for nonce with Post Metabox?
- Custom button block doesn’t work
- How to float an image in Gutenberg
- Gutenberg – editor-font-sizes in functions not working
- Metadata Query when storing data as array possible?
- Can’t select my block by clicking on it
- Which file handles the block latest posts, I want to examine excerpt handling
- create-guten-block in wordpress theme?
- What VSCode extensions are there for working with block themes? [closed]
- What is the “correct” way to add hooks or similar PHP behavior to a blocktheme?
- Not able to select width of blocks inside of cover block
- How to check if a WordPress core block is active in sidebar
- gutenberg add classes to list items
- How do you replace content generated by custom fields with custom blocks in Block Editor?
- Custom Blocks as part of a theme
- Wp Super Cache stops the update of a Post Meta
- How to wrap all titles generated by Gutenberg “Heading” block with tag
- How to show specific post meta?
- How to add InnerBlock multiple times in the same block
- Moving post title down the page / Removing a block from a post
- Running a function on post update with new post meta
- HTML block gutenberg templates
- Gutenberg theme development: how to add “headers” option under styles > colors > elements?
- Is it possible to set a variable for get_post_meta?
- Get attachment meta (I need attachment ID, unsure how to find it)
- How can I sort my loop based on meta data, using a form?
- Change default rel attributes for Image Block & Button Block
- Related Post Category Filter
- How to update mark-up of a gallery block in a custom theme?
- Auto focus RichText field
- How to create nested array attribute
- Show popover with url and option to open in new window
- How to Modify WP_Includes/blocks/latest_posts.php
- How to render block editor in wp-admin custom pages programmatically
- Social-Link block not loading html on page with custom theme
- How to diagnose wp-env environment problem
- Attribute form NumberControl doesn’t update when I update page before it lose its focus
- WP Gutenberg custom block – generate theme colors from SASS and use them in the inspector and php callback
- Posts Page shows Classic Editor interface not Gutenberg
- How can I include custom Gutenberg Blocks in a theme?
- Block validation failed for `core/pullquote` after adding theme support for editor-color-palette
- Is there a way to add classes to a page when using a Gutenberg reusable block as page layout?
- Make a custom field in admin post.php read only
- Change default options on attachment page
- Correct way to make a custom block theme responsive
- Multiple content areas with Gutenberg – Transparent areas mid content
- Insert gutenberg blocks into template
- After a while attachment meta data is missing “sizes” data
- Template for posts of category in block theme?
- Can’t select my block by clicking on it on apiVersion – but using blockProps
- How can I use pre declared blocks in a php file?
- Is there any filter or action hook to remove layout classes from appearing in my templates?
- Full site editing templates folder vs block-templates
- How to set the margin on an innerBlock in a block variation?
- Align images to the left of the content
- Image and font support missing in editor when deploying theme remotely
- When trying to run build script with gutenberg (with SVG import) – Error: Plugin name should be specified
- Block to show posts from same category
- Is wp_is_mobile() effective?
- Display Menu Name using wp_nav_menu
- What questions do you ask when asked to give an estimate on theme development?
- Hide certain pages / posts on wp-admin, show custom filter
- use add_action(‘wp_head’) in a widget for generating dynamic CSS styles
- Displaying wp menus by name without using theme locations
- Do I really need the div class entry?
- Best way to start becoming a wordpress developer
- Redirect Old .php URLs to New WordPress Page
- WordPress navbar with logo in middle [closed]
- Custom form in theme template displaying internal server error upon submission
- Admin: sub menu doesnt display under apperance when activate my themes
- Get data from style.css file and from from users->your profile
- How to dequeue css files?
- How to disable thumbnail filter for a specific template part or image size?
- reduce duplicate code in wordpress
- iPad WordPress theme?
- Adding link post format to theme and permalink to rss feed
- Does single webpage do not need navigation to create a slug in permalink?
- How to get full native language instead of iso?
- Two instances of the theme folder in the URL
- Trouble creating custom sanitization function when uploading video files
- Custom image size doesn’t work
- Paginated WP_Query doesn’t return 404’s, even when posts don’t exist
- The content not wrapped in paragraph tags with get_page_by_title()
- Not Found when using activity stream as front page with BuddyPress
- How customizable is a self-hosted WordPress blog compared to a Blogger blog?
- Why we do need wp_enqueue_script() function?
- WP Customizer get control value on change