Make title not limited to 100 characters, and authorize empty description ?
Hello, for QUESTIONS, is there a way I can make the characters limit higher for the title (like 9999 or no limit) + authorize empty descriptions ?
Question is closed for new answers.
Rahul Aryan Selected answer as best
Make title limit higher :
function my_custom_title_field( $form )
{
$form['fields']['post_title'] = array(
'max_length' => 999,
);
return $form;
}
add_filter( 'ap_question_form_fields', 'my_custom_title_field' );Enable empty description :
function my_ap_make_question_description_optional( $form )
{
$validate = $form['fields']['post_content']['validate'];
//remove required from validation.
if ( is_array( $validate ) ) {
if ( ( $key = array_search( 'required', $validate ) ) !== false ) {
unset( $validate[ $key ] );
}
} else {
$validate = str_replace( 'required', '', $validate );
}
// Update existing value.
$form['fields']['post_content']['validate'] = $validate;
return $form;
}
add_filter( 'ap_question_form_fields', 'my_ap_make_question_description_optional' );plzcome bck Posted new comment
plzcome bck commented
how to add this code and where?? help me
Found this in the FAQ : https://anspress.io/resources/faq/how-to-make-question-description-field-optional/
Baptiste Legrand Answered question
Awesome.