[wp-trac] [WordPress Trac] #16064: Cannot update number of items per page for taxonomy with dashes in name
WordPress Trac
wp-trac at lists.automattic.com
Sun Jan 2 12:03:30 UTC 2011
#16064: Cannot update number of items per page for taxonomy with dashes in name
--------------------------+-----------------------------------------------
Reporter: garyc40 | Owner: garyc40
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 3.1
Severity: normal | Keywords: has-patch needs-testing 3.2-early
--------------------------+-----------------------------------------------
Test case:
{{{
add_action( 'init', 'test_register_post_type' );
function test_register_post_type() {
register_taxonomy( 'test-tax', 'post', array(
'label' => 'Test Tax',
'hierarchical' => true,
) );
}
}}}
Try going to {{{edit-tags.php?taxonomy=test-tax}}}, and update the number
of items per page in Screen Options. It won't have any effects.
This is because in various places, dashes in the taxonomy name are
converted into underscores when checking for the user option. I don't know
the rationale behind this, and I'm not sure whether a taxonomy name
mustn't have dashes in it.
If dashes are not allowed in tax name, then in register_taxonomy(), we
should automatically convert all dashes to underscores.
Otherwise, patch attached. The patch still preserve the user option name
(in which only underscores are used). For other parts, the normal tax name
is used.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/16064>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list