Make WordPress Core

Opened 21 months ago

Closed 21 months ago

Last modified 20 months ago

#44902 closed defect (bug) (duplicate)

Update codex doc for function register_taxonomy

Reported by: ercartman Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.9.8
Component: Taxonomy Keywords: needs-docs needs-dev-note
Focuses: docs Cc:


I registered a new taxonomy.

And added post_categories_meta_box to my post type.

But if I saved the post with a taxonomy, an error occurred.

Created new taxonomy with name = id of selected taxonomy.

I checked the errors and found that on my server the $_POST data is transmitted with the type string

But custom taxonomy does not sanitize values by default.

I found param meta_box_sanitize_cb in WordPress source and added to attr when I call a function register_taxonomy:

'meta_box_sanitize_cb' => 'taxonomy_meta_box_sanitize_cb_checkboxes'

After that, the save works without errors.

Please, add this param to documentation.

Change History (2)

#1 @mukesh27
21 months ago

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #36514.

#2 @netweb
20 months ago

  • Milestone Awaiting Review deleted

Just to note, the docs added in #36514/r42211 will be shipped in WordPress 5.0, when 5.0 is released the documentation will be updated with this info.

Note: See TracTickets for help on using tickets.