I have a file in a plugin named form.php
. I know that to make what I want to work I just need to change 1 line of code at $taxonomies = wp_dropdown_categories
in this function below and add a parameter of depth => 1
into that line of code in this function.
private function taxonomy_select_field($field = array()) {
if ( isset( $field['label'] ) ) {
$this->label();
}
$this->output .= '<div class="ap-form-fields-in">';
$taxonomies = wp_dropdown_categories( array(
'taxonomy' => $field['taxonomy'],
'orderby' => @$field['orderby'],
'hide_empty' => 0,
'hierarchical' => 1,
'selected' => @$field['value'],
'name' => @$field['name'],
'class' => 'ap-form-control',
'id' => @$field['name'],
'echo' => false
) );
$this->output .= $taxonomies;
$this->error_messages();
if ( ! $this->field['show_desc_tip'] ) {
$this->desc();
}
$this->output .= '</div>';
}
But I do NOT want to be manually changing this line of code. How do I specifically override this using code snippets plugin or functions.php
? with add_action
or remove_action
combination?