Opened 7 years ago
Closed 7 years ago
#45756 closed defect (bug) (fixed)
Fix parameter name typo in 'taxonomy_meta_box_sanitize_cb_checkboxes'
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 5.1 | Priority: | normal |
| Severity: | normal | Version: | 5.0 |
| Component: | Taxonomy | Keywords: | has-patch good-first-bug dev-feedback |
| Focuses: | Cc: |
Description
Changed parameter $taxonmy to $taxonomy in 'taxonomy_meta_box_sanitize_cb_checkboxes'
Attachments (2)
Change History (9)
#1
follow-up:
↓ 6
@
7 years ago
- Component changed from General to Taxonomy
- Keywords good-first-bug dev-feedback added
#2
@
7 years ago
As per @mukesh27 's suggestion, the $taxonmy is not used in the function, which is removed in the https://core.trac.wordpress.org/attachment/ticket/45756/45756_2.diff patch
#3
@
7 years ago
- Version set to 5.0
@mukesh27 @faisal03 , I don't think it's that simple! where this function is getting called, both arguments are being passed, If we want to remove the first argument, then those places should also be updated. Otherwise your proposed fix will create new issue by trying to fix a non-existent problem!
#4
@
7 years ago
@itowhid06 You are correct. I have checked the trunk and not able to find any calls for that function. Maybe I missed somewhere? Can you please look at your end too?
#5
@
7 years ago
@faisal03 , taxonomy_meta_box_sanitize_cb_checkboxes has been used as a sanitization callback in class-wp-taxonomy.php - line 364. I've not got time to delve into that code yet, may be I'll give it a go when I get some time.
#6
in reply to:
↑ 1
@
7 years ago
- Milestone changed from Awaiting Review to 5.1
- Owner set to SergeyBiryukov
- Status changed from new to reviewing
Replying to mukesh27:
Do not understood why function used 2 arguments as
$taxonmyis not used in function
<?php function taxonomy_meta_box_sanitize_cb_checkboxes( $taxonmy, $terms ) { return array_map( 'intval', $terms ); }
Both the $taxonomy and $terms arguments are passed to the callback in edit_post().
Even though taxonomy_meta_box_sanitize_cb_checkboxes() does not use the $taxonomy argument, we cannot remove it as the function signature needs to remain compatible with taxonomy_meta_box_sanitize_cb_input(), which does use the argument. Other (custom) callbacks might use it as well.
Nice cache @itowhid06.
Do not understood why function used 2 arguments as
$taxonmyis not used in functionIf system not used
$taxonmythen need to remove first argument from the function like below.