Skip to content

Using custom taxonomy filter for the story-budget screen #679

@darelrho

Description

@darelrho

Hi guys!

Expected/Desired Behavior

When I try to define a custom taxonomy to be used by the story budget like this:

add_filter( 'ef_story_budget_taxonomy_used', 'story_budget_taxonomy_used' );

function story_budget_taxonomy_used(){
    return 'custom-taxonomy';
}

Actual Behavior

It works just fine for the postboxes, but the select filter still use the "category" taxonomy because it seems to be hardcoded here:

L766

if ( taxonomy_exists('category') ) {
	$category_dropdown_args = array(
	'show_option_all' => __( 'View all categories', 'edit-flow' ),
	'hide_empty' => 0,
	'hierarchical' => 1,
	'show_count' => 0,
	'orderby' => 'name',
	'selected' => $this->user_filters['cat']
);

wp_dropdown_categories( $category_dropdown_args );

Is this expected or could be changed to use the $taxonomy_used variable?

$category_dropdown_args = array(
	'show_option_all' => __( 'View all categories', 'edit-flow' ),
	'hide_empty' => 0,
	'hierarchical' => 1,
	'show_count' => 0,
	'orderby' => 'name',
	'selected' => $this->user_filters['cat'],
        'taxonomy' => $this->taxonomy_used ?? 'category'
);

wp_dropdown_categories( $category_dropdown_args );

Please tell me what's the best way to archive this. Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions