You just need to get value from attributes, and set to <select>
In your case it will be like this: <select value={ props.attributes.category_id } onChange={ setCategory }>
Generally, you thinking in a right way, but variable that you declare at 13 row is not available outside of {}, and you set value to undefined.
Related Posts:
- How to Add a Third Level Sub Menu to the WordPress Admin Menu
- How to stop showing admin notice after close button has been clicked
- Is There a WordPress Hook to Filter the Edit Posts View?
- Is there any record of installed plugins in the database?
- Add content to /wp-admin/plugin-install.php admin screens
- Custom admin column disappearing when using Quick Edit [duplicate]
- Plugin Development: WordPress processes twice on post update. How to skip process on the first?
- how to not show plugin in admin area
- Passing select control value to block
- How could I execute my plugin just in frontend (not in backend)
- Passing RichText attributes to function onChange
- How do I store information in a dynamic block in WordPress?
- Custom height/width for thickbox in WP Backend
- Hide Theme options and Customize Admin menu
- How to create custom embed block in gutenberg wordpress
- ‘wp_login’ action hook not working with wp-login.php file
- How to use get_theme_mod in gutenberg editor wordpress?
- All Users > User List > Update User Meta Field Inline
- How to add Internationalization in WordPress using Javascript/React?
- how to disable blockrenderAppender inside all Innerblocks?
- WordPress Gutenberg react make import of __experimentalUseInnerBlocksProps which is no more experimetal
- Using SVN to upload plugin created with gutenberg blocks
- Create tabs in admin options page from custom post type loop
- How to add custom table style for table block in gutenberg editor
- Gutenberg Block Style CSS Class Is Not Applying on Backend
- Why is the ‘Gutenberg’ Plugin generating an ‘Inconsistent File Permissions’ error when other Plugins, with the same permissions, do not?
- How to make multiple admin pages for one plugin?
- Set Multiple Meta Values as an Array Using dispatch( ‘core/editor’ ).editPost() Call in Gutenberg/JS
- WordPress Site is Broken, Cannot see wp-admin page [closed]
- How to remove a CPT Menu from the Root Admin only
- Is there a better way of handling AJAX requests in WordPress?
- I cannot include a file in my plugin settings page
- Use a custom block in another block
- Gutenberg default attributes are empty when accessing in edit
- Set Button in PluginDocumentSettingPanel Content (WordPress Gutenberg)
- force logged in user to stay in the dashboard
- Has blocks gutenberg block multiples registers type in my Plugin
- Fixed: Console.log twice in the edit function
- How can we get this dynamically as this folder may not be by the same name always → wp-admin
- How to resolve warning for `unstableOnSplit` prop on a DOM element in block editor
- How to dynamically add template in Innerblock?
- How to properly enqueue jQuery knob on WordPress without conflict?
- Block content rendering on the top just below body tag
- Admin menu hilighting wrong item for CPT
- Is admin section completely customizable in terms of styling?
- Store admin page into variable
- Add custom fields in the new and edit the site forms without touching the WP core
- Ajax in Plugins: returns the whole page
- Combining JS files to one script
- Create plugin with multiple blocks
- How do I set register_meta for a specific CPT?
- How do I save meta key value in the save function?
- Update Content for a Custom Block Toolbar Button
- Wrong block appender button showing
- How to get custom setting from get_option and pass it in getEntityRecords in gutenberg block?
- The Admin page isn’t showing in the sidebar of the dashboard
- warning wp session
- Submitting form to admin-post.php WordPress
- Vanilla javascript in custom gutenberg block not working
- WordPress custom block: Link saved in database not retrieved when editing post
- Why is my Gutenberg block not saving and rendering the chessboard?
- How can we extent core/group or cover block?
- Force post update with React
- How to change the version of block.js and plugin to the same of Package.json?
- How do I apply different block supports to different parts of my custom block?
- Custom Gutenberg blocks not showing in WP editor
- Update plugin from personal API
- Symlinked plugin directory doesn’t appear in Admin
- How to disable Gutenberg editor?
- Gutenberg: Difference between “import” and “const” for dependencies
- How use %like% in sql statement wordpress
- Can I use a form in a dashboard widget?
- MITM risk of not sanitizing?
- Get IDs of Images from Gallery Block in InnerBlocks of a Custom Gutenberg Block
- Is there any kind of theme on WordPress to sell my own movies?
- Suggestions on Approach to New Plugin I’m Stuck On
- How to redirect users to their profile after they successfully edit their profile
- How can I remove the WordPress-Version (?ver=5.x) from my plugin
- Settings API saved values not getting shown in the dropdownbox
- Why Does The `auto_update_plugin` Hook Disable Management?
- Is there a script to collect all hooks and filters provided by a plugin?
- Post status doesn’t update to ‘future’ every time?
- Unable to give correct path in wordpress
- Disable variations on woo commerce if out of stock
- How to add img into a plugin?
- How to hide plugin submenu title in drop down in admin panel in wordpress?
- Can we hide a certain user in WP?
- Show Custom Post on Frontend
- WordPress Ajax request “Failed to load resource: the server responded with a status of 400 ()”
- Using multi-dimensional array with filter
- WordPress Admin sub-level menu issue
- Why does WordPress use cookies for /wp-admin and /wp-content/plugins for non-admin users [duplicate]
- PHP header() not available to use in my plugin
- How to insert category name above post title in a featured pages plugin?
- Displaying friend’s posts only
- How to add submenu to WordPress plugin in the same Directory of main Plugin?
- Check if user is in a group of another site within multisite network [closed]
- Synch Custom Post Types (and Custom Fields, Cats, etc.) Between WordPress Sites
- Redirect url in plugin to somewhere else?
- Automatically download dependent plugins from WordPress.org?