Changing the category for existing Gutenberg blocks

Try this, it changes the core Spacer block from the Design to the Media category in the insertor: function myprefixFilterSpacerCategory(settings, name) { if (name === “core/spacer”) { // Object.assign can also be used instead of lodash.assign return lodash.assign({}, settings, { category: “media”, }); } return settings; } wp.hooks.addFilter( “blocks.registerBlockType”, “myprefix/filter-spacer-category”, myprefixFilterSpacerCategory );

Redirect an archive page to its relevant URL-friendly filtered page

Welcome aboard, This should be made with the PHP rewrite rule in WordPress functions, but if you don’t want to use PHP, you can use the .htaccess redirection. RewriteRule ^blog/category/(.*)$ /blog/?_tag_thoughts=$1 [R=301,NC,L] Change WordPress .htaccess code with code below # BEGIN WordPress RewriteEngine On RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteRule ^blog/category/(.*)$ /blog/?_tag_thoughts=$1 [R=301,NC,L] RewriteBase / RewriteRule … Read more

How can I filter the comment action links so that I can display the actions links based on user capabilities?

Yes, there is a hook you can use to filter the action links: comment_row_actions. E.g. add_filter( ‘comment_row_actions’, ‘my_comment_row_actions’, 10, 2 ); function my_comment_row_actions( $actions, $comment ) { // Filter the actions by user role. $roles = (array) wp_get_current_user()->roles; if ( in_array( ‘administrator’, $roles ) ) { $actions[‘foo’] = ‘<a href=”#”>Foo action</a>’; } // Filter the … Read more