Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This can be accomplished with some simple JavaScript/jQuery. Create a file called admin_title_disable.js, and queue it up within functions.php. For example:</p> <p>functions.php:</p> <pre><code>wp_register_script('admin_title_disable', '/path/to/admin_title_disable.js'); function disableAdminTitle () { wp_enqueue_script('admin_title_disable'); } add_action('admin_enqueue_scripts', 'disableAdminTitle'); </code></pre> <p>Now, in your js file:</p> <pre><code>jQuery(document).ready(function ($) { $('#title').attr('disabled','disabled'); }); </code></pre> <p>This will set both post and page title input fields with a <code>disabled</code> attribute. Hope this helps!</p> <p>If you want to restrict this script to a particular admin page, wrap the <code>add_action</code> hook in a conditional that compares <code>$_GET['page']</code>. You can also take advantage of the <code>$hook</code> parameter that is available when using <code>admin_enqueue_scripts</code> to check for the page. <a href="http://codex.wordpress.org/Plugin_API/Action_Reference/admin_enqueue_scripts" rel="nofollow">See here</a>.</p> <p><strong>Update::</strong></p> <p>WordPress makes it a little tricky to tell between post and page edit screens, but there is a hidden input that you can take advantage of. :) Here's an updated version of the jQuery that will only run on page edit screens:</p> <pre><code>jQuery(document).ready(function ($) { //find the hidden post type input, and grab the value if($('#post_type').val() === 'page'){ $('#title').attr('disabled','disabled'); } }); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload