Skip to content

Instantly share code, notes, and snippets.

@rrikesh
Created January 22, 2015 07:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rrikesh/1c2311203b096fb65f29 to your computer and use it in GitHub Desktop.
Save rrikesh/1c2311203b096fb65f29 to your computer and use it in GitHub Desktop.
Turn on the autocomplete tag in WordPress post title. http://wordpress.stackexchange.com/q/175585/17305
<?php
/**
* Plugin Name: Autocomplete Title
* Description: Sets the autocomplete attribute to true on WordPress post titles
* Plugin URI: http://wordpress.stackexchange.com/q/175585/17305
*/
namespace WPSE\AutocompleteTitle;
/**
* Sets autocomplete attribute to true on WordPress post titles
*/
function set_autocomplete_on_title() {
echo '<script>
jQuery(document).ready(function($){
if( $("#title").length ){
$("#title").removeAttr("autocomplete");
}
});
</script>';
}
\add_action( 'admin_footer', __NAMESPACE__ . '\\set_autocomplete_on_title' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment