Hook to modify content on a column on the edit.php (list of posts page)?

you can do this customisation by removing the core author column and replace it with a custom one. $post_type = “kea_activity”; add_filter(“manage_{$post_type}_posts_columns”, function ($posts_columns) { $posts_columns[“author_custom”] = “Author”; unset($posts_columns[“author”]); return $posts_columns; }); add_action(“manage_{$post_type}_posts_custom_column”, function ($column_name, $post_ID) { if (“author_custom” === $column_name) { $author = get_the_author(); echo esc_html($author) . ” <strong>information</strong>”; } }, 10, 2);

I have to select text from gutenberg editor. Purpose is to store and replace text

We have to select text from the Gutenberg editor. The purpose is to store and replace text. Please use this code to help us with you const { select } = wp.data; const selectedBlock = select(‘core/block-editor’).getSelectedBlock(); if (selectedBlock) { const selectedText = selectedBlock.attributes.content; console.log(“Selected Text:”, selectedText); // Store the selectedText as needed. } Replacing Text … Read more

disable the post title field after publishing

Use the action hook edit_form_after_title The display:none rule might cause some JS issue so it might be best to use visibility:hidden so the element is still accessible to whatever scripts in the DOM. This condition will hide the form fields and show the title and URL statically. add_action(‘edit_form_after_title’, function($post) { if( !empty($post->post_title) && !current_user_can(‘manage_options’) ) … Read more

How to add placeholder in wp_editor?

Your approach to replace <textarea with <textarea placeholder=” is correct. Just wp_editor function does not returns html code, which you can change. Function just echoes output. You can capture this output with ob_start and ob_get_clean, as described here: $wpEditorPlaceholder=”My Placeholder”; ob_start(); wp_editor( $project_description , ‘project_description’, array( ‘wpautop’ => true, ‘media_buttons’ => false, ‘textarea_name’ => ‘project_description’, … Read more

How to make WP Classic Editor required in jQuery

It looks like you’re trying to validate the content of a WordPress Classic Editor, ensuring it’s not empty, both in HTML and Visual modes. The issue arises with the Visual mode which is powered by TinyMCE. Unlike standard HTML form elements, TinyMCE’s content isn’t directly linked with its underlying textarea element in a way that … Read more