Created
January 22, 2015 07:30
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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