Create custom tab in WordPress 5 media upload

The only way I could get this to work in WP 5 was to install the Classic Editor. Then I could use media_view_settings to add the tab. add_filter(‘media_view_settings’, ‘addMediaTab’); function addMediaTab($settings) { $settings[‘tabs’] = array(‘mymediatab’ => ‘My Media Tab’); return $settings; } BUT it appears the new UI doesn’t include those sections in Gutenberg, you … Read more

Adding a custom PanelColorSettings control to a core block, and using the color slug in a custom className

Your code looks ok and would work in any other component other than colors, because colors need the higher-order-component withColors. In the past I struggled also dealing with the behaviour, that your are describing and found these two solutions: If you want to insert your own color component, check the second example from here https://awhitepixel.com/blog/add-custom-settings-to-existing-wordpress-gutenberg-blocks/. … Read more

Gutenberg blocks – processing server data within a block

There are multiple better ways to get a list of posts in a Gutenberg block, other than rendering serverside. First is to use the Wrodpress wrapper around Redux and select posts exactly like in the Gutenberg Handbook: edit: withSelect( function( select ) { return { posts: select( ‘core’ ).getEntityRecords( ‘postType’, ‘post’ ) }; } )( … Read more