Skip to content

Instantly share code, notes, and snippets.

@rahularyan
Created February 17, 2021 18:05
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 rahularyan/ea63057eb6e6ccac287a6bba4b31af21 to your computer and use it in GitHub Desktop.
Save rahularyan/ea63057eb6e6ccac287a6bba4b31af21 to your computer and use it in GitHub Desktop.
Allow question title to be more than 100 characters
<?php
/**
* This hook will make question title to be more than 100 characters.
*
* @param array $form Form arguments.
* @return array
*/
function my_ap_make_question_description_optional( $form ) {
$validate = $form['fields']['post_title']['validate'];
$validate['max_length'] = 200;
// Update existing value.
$form['fields']['post_title']['validate'] = $validate;
return $form;
}
add_filter( 'ap_question_form_fields', 'my_ap_question_title_more_than_100' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment