I am trying to hook a function on the entire wordpress backend for a user custom role, just that when the user is accessing the edit posts page post.php?post=xxxx0&action=edit
, the function is no more available, printed message disappears.
if ( is_user_logged_in() ) {
echo 'here';
function contributor_posts() {
echo 'here2';
}
add_action( 'admin_init', 'contributor_posts' );
}
echo here
- disappears - though it doesn't go on the else
echo 'here2
- disappears also