Created
December 28, 2020 09:38
-
-
Save rahularyan/f7ca4e36ecb027e8923503e1ce080e12 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Override AnsPress form category field selection list. | |
* | |
* @param mixed $form | |
* @return mixed | |
*/ | |
function anspress_override_category_field( $form ){ | |
$form['fields']['category'] = array( | |
'label' => __( 'Category', 'anspress-question-answer' ), | |
'desc' => __( 'Select a topic that best fits your question.', 'anspress-question-answer' ), | |
'type' => 'select', | |
'options' => 'terms', | |
'order' => 2, | |
'validate' => 'required,not_zero', | |
'terms_args' => array( | |
'' | |
) | |
); | |
return $form; | |
} | |
add_action( 'ap_question_form_fields', 'anspress_override_category_field', 99999 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment