How to disable page title in wp-admin from editing?

I have a wp network installed with users who can create pages on each site.

Each of these pages gets a place in the main menu, and only one user has permission to create this entire menu.

I want to create a user only for editing the contents of the pages, but not for the title.

How to disable the page title for editing from the admin menu for a specific user or (much better) for the opportunity?

I was only thinking about the possibility that editing admin css to hide the header text box, but I have two problems:

  • I don't like css-hide things.
    • I do not know where admin css is located.
    • I know php, but I don’t know how to add css hide to an element for possibility.

How do I want it to be

+5
2

CSS, div # tencediv. , , , .. .

, :

, , , , functions.php . , :

<?php

add_action('admin_head', 'maybe_modify_admin_css');

function maybe_modify_admin_css() {

    if (current_user_can('specific_capability') {
        ?>
        <style>
            div#titlediv {
                display: none;
            }
        </style>
        <?php
    }
}
?>
+8

, - , .

, , , , , .

, , /wp -admin/edit-form-advanced.php.

if ( post_type_supports($post_type, 'title') )

if ( post_type_supports($post_type, 'title') and current_user_can('edit_title') )

, , "edit_title"

IF , :

else echo "<h2>".esc_attr( htmlspecialchars( $post->post_title ) )."</h2>";

, , "edit_title".

, (edit_title) , .

0

All Articles