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
- Form submission issue in wordpress admin (custom plugin) using $_GET for searching & filtering
- Editing a block to add a button to have a drop cap
- Zip using “wp-scripts plugin-zip” with custom “build” folder and subfolders?
- redirect logged users to custom front-end insetad of wp-admin
- How to list latest 5 posts from each author from a custom CPT? I want to create a custom Gutenberg block
- Custom block padding control (via support) initialization
- WordPress custom block: How to treat each button as a separate block?
- Custom block based off core block using filter
- 403 forbidden error in the admin panel as well as on the admin-ajax.php file
- How to change the version of block.js and plugin to the same of Package.json?
- media_sideload_image only works on localhost and without return id or src
- How do I apply different block supports to different parts of my custom block?
- Prevent WordPress Link Editor from Automatically Adding “http://”
- Where should I save an API key of my user when installing my plugin?
- Plugin upload to install
- How to make a customize role and view a specific plugins base on that role?
- Reusable functions and tools (Framework)
- Is Wrapping intval() Around esc_attr() Redundant for Escaping Input?
- Programatically download a plugin
- WordPress plugin – Error “Plugin generate 2890 characters of unexpected output when activated”
- React JSX in WordPress Plugin Development
- My plugin wants to update another plugin
- Redirecting to home page after login as custom role WordPress
- Add keywords meta to index.php page
- Custom form action to handle data inside a plugin
- Where (or when) should I register a new taxonomy?
- Plugin echos text from shortcode function in gutenberg page editor
- How do I prevent the link from using url of the image in Block Editor?
- Woocommerce plugin for minimum order and add-to-card-step
- Self deactivate plugins after an action occurs
- How to get current post user id
- UnInstallation of a Plugin from a developers perspective – The correct and clean method
- Issue with adding count to “subsubsub” aka quick links on custom_post_type
- Pulling data from custom plugin settings using PHP shortcode and Javascript
- How to slice an array using posts_per_page? [closed]
- WordPress takes too much time (100 seconds) to load – Front end and back end
- White page on custom plugin option submit