Set custom post title to read only by user

For gain result custom post titles read-only for all users except the admin, you can use the edit_post capability along with the admin_init hook. add_action(‘admin_init’, ‘restrict_custom_post_title_editing’); function restrict_custom_post_title_editing() { // Check if the current user is not an admin if (!current_user_can(‘administrator’)) { // Get the post types for which you want to restrict title editing … Read more

How do I filter/modify the updated content on save using javascript?

You could start by adding: // What to do here? wp.data.dispatch(‘core/block-editor’).insertDefaultBlock({content:’xxxxxx’}); This will insert a block with the specified text to the end of the blocks list when the user will hit the update button. Once, and then it will self-unsubscribe. To run it every time the user hits the update button, you don’t want … Read more