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

Solved5.66K 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

You are viewing 1 out of 2 answers, click here to view all answers.