As a priority i need to just display some custom html inside the Title(h1.wp-heading-inline) in the Post Edit Screen (Top Left Corner). While trying various methods i found that all html is filtered only text is displayed.
If there is no way to prevent the filtering of html of H1 title in admin page then i would like to remove it for Custom Post Type's posts.
Here is what i tried:
add_action( 'edit_form_top', [$this, 'customPostTitle' ] );
function customPostTitle($title) {
global $post;
if ($post->post_type == $this::POST_TYPE['id']) {
$custom_post_title = $post->post_title;
$custom_title_fin = __( 'Custom post title: ', 'custom-plugin' ) . '<span class="custom-class">'. $custom_post_title . '</a>';
$title = $custom_title_fin;
}
return $title;
}
Is there any actions/filters i can do to achieve this ?
I don't want to use js/css - i am looking for a native/php way ?
edit_form_top
hook is an action, not a filter, soreturn
does nothing.