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
- Loading external page template and enqueue script from plugin causes 403 forbidden error
- Gutenberg disallow certain custom blocks but keep all core blocks?
- WordPress plugin from own server
- How to avoid plugin name conflicts from the upgrade notifier?
- Is their any way to Extend WPDB class and Overwrite the Default Query Function
- How do I only load a plugin js on it’s settings pages?
- Use functionality of 2 wordpress plugins
- Autoload via composer in plugin interference
- Can WordPress plugins “Talk to each other”?
- Plugin exceeds memory limit
- How can sanitize $_FILES[‘haq_slider’] field
- Woocommerce plugin for minimum order and add-to-card-step
- How to apply a patch via plugin?
- wp_remote_get() returns 403 while file_get_contents() does not
- How to set add question capability for author role in wp pro quiz plugin
- Unable to delete custom post types, confusion around capabilities
- Getting wp.me shortlink for wordpress custom post type
- where is the main file in this plugin?
- How can i force wp-admin to use 2-column dashboard layout? [closed]
- First plugin, problem with get_pages
- Plugin onclick button activate other plugin
- Structuring function with registration_errors hook
- Yoast SEO Plug In and my Theme duplicating code. Need some feedback on what to do? [closed]
- Should I use the action in the plugin’s main file?
- wp_query ‘s’ parameter does not work with WC_AJAX
- Monitor all the queriers executed by my website
- How to remove WordPress Default Comment? not Facebook
- Create survey that redirects to sidebar menu customized to answers
- Uploading images to custom table
- Changing author slug for a custom role without using plugin
- How can I customize Easy Appointment plugin?
- how to add custom css at top above all css file for specific url
- Web Application Framework Compatibility with WP Plugin
- Plugin loaded, but not running
- Merge custom plugins in one folder
- Filter EVERY category link with my plugin
- Undefined variable _POST
- map urls to plugins
- Embed php code in custom field of a plugin [closed]
- How to Enfroce Domain Licensing Limits? [closed]