1

I'm creating a new custom post type. But I need to limit the max length for the title. This is how I'm creating the field in my code:

array(
    'key' => 'title',
    'label' => 'Title',
    'name' => 'title',
    'type' => 'text',
    'required' => 1,
    'maxlength' => 65,
)

But the maxlength property isn't working. Is there a way to set this limit from code (not using a plugin) and only for this post type?

1

1 Answer 1

0
array(
    'key' => 'custom_post_title',
    'label' => 'Title',
    'name' => 'title',
    'type' => 'text',
    'required_over' => 1,
    'maxlength_set' => 65,
)
1
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented May 26 at 11:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.