Opened 16 years ago
Last modified 7 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: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Posts, Post Types | Version: | 3.0 |
| Severity: | minor | Keywords: | has-patch dev-feedback |
| Cc: | Focuses: |
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
@
16 years ago
- Keywords needs-refresh added; needs-testing removed
- Milestone Awaiting Triage → Future Release
#4
@
15 years ago
- Keywords has-patch dev-feedback added; needs-refresh removed
Updated Utkarsh's previous patch to current SVN and formatted.
#5
@
15 years ago
- Component General → Post Types
- Keywords dev-feedback removed
- Type defect (bug) → enhancement
#7
@
14 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
@
13 years ago
- Cc 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
@
11 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.
@
11 years ago
Alternative patch which cleans up add_post_type_support() and changes $feature to $features
#11
@
11 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Patch doesn't adhere to coding standards. Needs whitespace, also, the cast should probably be within the foreach directly.