Make title not limited to 100 characters, and authorize empty description ?

Solved5.76K viewsGeneral
0

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.
Selected answer as best
1

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' );

Posted new comment

how to add this code and where?? help me

1

Found this in the FAQ : https://anspress.io/resources/faq/how-to-make-question-description-field-optional/

Answered question