Created
January 5, 2019 08:49
-
-
Save Tsunamijaan/1058377c28ec79f2f68fa6eb5edc9652 to your computer and use it in GitHub Desktop.
Set maximum post title length
This file contains hidden or 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
| function JebamaxWord($title){ | |
| global $post; | |
| $title = $post->post_title; | |
| if (str_word_count($title) >= 10 ) //set this to the maximum number of words | |
| wp_die( __('Error: your post title is over the maximum word count.') ); | |
| } | |
| add_action('publish_post', 'JebamaxWord'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment