#16064 closed defect (bug) (duplicate)
Cannot update number of items per page for taxonomy with dashes in name
Reported by: | garyc40 | Owned by: | garyc40 |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.1 |
Component: | General | Keywords: | has-patch needs-testing 3.2-early |
Focuses: | Cc: |
Description
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.
Attachments (1)
Change History (5)
#1
@
14 years ago
I should add that there might be existing developers who are already using dashes in their taxonomy name. As a result, automatically convert dashes to underscores in register_taxonomy() would probably break those plugins / themes.
there's a patch for that