• Resolved Markus Wiesenhofer

    (@markusfroehlich)


    Hello, thank you for your awesome plugin.
    When i create / update a custom taxomomy i miss the argument “publicly_queryable”.

    Is it possible to add it?

    Thank you
    Markus

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Looks like that’s a new parameter that snuck in on us a few releases back and we didn’t realize it.

    I’ve added an issue to get that taken care of in the next major version of CPTUI. Issue found at https://github.com/WebDevStudios/custom-post-type-ui/issues/705

    That said, in the meantime you’ll need to use this available filter, to get it in now.

    https://github.com/WebDevStudios/custom-post-type-ui/blob/master/custom-post-type-ui.php#L611-L623

    Some quick example code to read over and such, this would go in your functions.php file for your active theme. I left some inline comments to consider. Feel free to ask questions as needed.

    function markus_publicly_queryable_taxes( $args, $taxonomy_slug ) {
    	// This will set them all to be publicly queryable.
    	$args['publicly_queryable'] = true;
    
    	// This if check can be used to conditionally set it.
    	if ( 'actor' === $taxonomy_slug ) {
    		$args['publicly_queryable'] = true;
    	}
    
    	// Since it defaults to the status of the "public" setting, you maybe want to set to false.
    	if ( 'status' === $taxonomy_slug ) {
    		$args['publicly_queryable'] = false;
    	}
    
    	return $args;
    }
    add_filter( 'cptui_pre_register_taxonomy', 'markus_publicly_queryable_taxes' );
    
    Thread Starter Markus Wiesenhofer

    (@markusfroehlich)

    Thank you very much, for your quick anwer and workaround.

    Best regards
    Markus

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Welcome.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Missing argument publicly_queryable’ is closed to new replies.