Opened 15 years ago
Last modified 5 years ago
#14077 new enhancement
Add support for removal of multiple features from a post type in remove_post_type_support
Reported by: | Utkarsh | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | minor | Version: | 3.0 |
Component: | Posts, Post Types | Keywords: | has-patch dev-feedback |
Focuses: | Cc: |
Description
From this thread
add_post_type_support allows an array to be passed as the 2nd parameter, but remove_post_type_support doesn't.
The patch attached adds the functionality.
Attachments (10)
Change History (24)
#3
@
14 years ago
- Keywords needs-refresh added; needs-testing removed
- Milestone changed from Awaiting Triage to Future Release
#4
@
13 years ago
- Keywords has-patch dev-feedback added; needs-refresh removed
Updated Utkarsh's previous patch to current SVN and formatted.
#5
@
13 years ago
- Component changed from General to Post Types
- Keywords dev-feedback removed
- Type changed from defect (bug) to enhancement
#7
@
13 years ago
Refreshed previous patch with additional code formatting in 14077.3.diff.
Tested remove_post_type_support()
with both a single string and an array of features and works.
#8
@
11 years ago
- Cc bob.ellison@… added
Patch update for 3.6, seems add_post_type_support
got an array but remove_post_type_support
didn't.
Can test with:
function init_remove_support(){ $post_type = 'post'; remove_post_type_support( $post_type, array('editor', 'title', 'thumbnail')); }
#9
@
10 years ago
- Keywords dev-feedback added
Was about to create a new ticket with a patch until I found this one.
I've attached a patch that fixes this in trunk.
@
10 years ago
Alternative patch which cleans up add_post_type_support() and changes $feature to $features
#11
@
9 years ago
- Keywords needs-docs added
Both function changes would warrant adding a changelog entry to the @since block in the DocBlocks. Something along the lines of
@since 4.4.0 The `$feature` parameter was renamed to `$features` and changed to also accept an array of features.
Note the backticks in the description (this is for formatting purposes in the code reference after being parsed.
Patch doesn't adhere to coding standards. Needs whitespace, also, the cast should probably be within the foreach directly.