Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
darelrho opened this issue Jan 27, 2022 · 0 comments
Open

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

darelrho opened this issue Jan 27, 2022 · 0 comments

Comments

@darelrho
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant