#14061 closed defect (bug) (fixed)
Bugs in edit-tags and edit columns regarding post_type vars
Reported by: | nacin | Owned by: | |
---|---|---|---|
Milestone: | 3.0.1 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Taxonomy | Keywords: | has-patch |
Focuses: | Cc: |
Description
Originally reported by Frumph on wp-testers. I additionally found the count column issue.
To reproduce the two things fixed by the patch:
- Add a 'tags' or 'categories' column to pages or a custom post type using the manage.*columns filters. The tag links to edit.php but it will not include the post type.
- Add a tag/term to edit-tags.php, and inspect the link in the post count column for the row added via AJAX. This is due to _tag_row() relying on a $post_type global that is set in edit-tags.php but not in admin-ajax.php. This part is a regression, but it's arguably minor.
Setting to 3.0.1 for now. There may be more bugs here based on Frumph's reports.
Attachments (1)
Change History (8)
#2
@
14 years ago
In general, I would agree, but I like using !empty()
however, as it functions kind of like ?:
(omitting the middle, PHP 5.3+), with the middle being if the variable is indeed provided, and the end being the alternative if it is not. In fact we use this pattern throughout core and it is far easier to read/understand.
#3
@
14 years ago
According to the WordPress Coding Standards:
Ternary operators are fine, but always have them test if the statement is true, not false. Otherwise it just gets confusing.
#4
@
14 years ago
I've seen that, and I'd argue that !empty()
should be an exception, as it's testing something, if true uses something, if false uses an alternative. Checking for passed variables using isset()
or !empty()
is very common. Does anyone find the second example above less confusing than the first?
Instead of
I'd use
There's no need for the NOT, and ternary operator doesn't necessarily means
:P