Make WordPress Core

Opened 5 years ago

Last modified 20 months 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: Future Release Priority: normal
Severity: minor Version: 3.0
Component: Posts, Post Types Keywords: has-patch
Focuses: Cc:


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 (6)

14077.diff (971 bytes) - added by Utkarsh 5 years ago.
14077_2.diff (975 bytes) - added by edwardw 4 years ago.
Update of Utkarsh's previous patch
14077.3.diff (1.0 KB) - added by jeremyfelt 3 years ago.
Refreshed patch
14077.4.diff (2.3 KB) - added by SergeyBiryukov 3 years ago.
Brings similar formatting cleanup to add_post_type_support() for consistency
remove-post-type-support-array.14077.diff (963 bytes) - added by wycks 20 months ago.
14077.5.diff (963 bytes) - added by wycks 20 months ago.
Fixed diff file name, not sure if it matters

Download all attachments as: .zip

Change History (14)

@Utkarsh5 years ago

comment:1 @Utkarsh5 years ago

  • Cc admin@… added
  • Keywords needs-testing added; needs removed

comment:2 @nacin5 years ago

  • Milestone changed from Unassigned to 3.1

comment:3 @nacin4 years ago

  • Keywords needs-refresh added; needs-testing removed
  • Milestone changed from Awaiting Triage to Future Release

Patch doesn't adhere to coding standards. Needs whitespace, also, the cast should probably be within the foreach directly.

@edwardw4 years ago

Update of Utkarsh's previous patch

comment:4 @edwardw4 years ago

  • Keywords has-patch dev-feedback added; needs-refresh removed

Updated Utkarsh's previous patch to current SVN and formatted.

comment:5 @nacin3 years ago

  • Component changed from General to Post Types
  • Keywords dev-feedback removed
  • Type changed from defect (bug) to enhancement

comment:6 @DrewAPicture3 years ago

Closed #21224 as duplicate. Would be nice to get some traction on this in 3.5.

@jeremyfelt3 years ago

Refreshed patch

comment:7 @jeremyfelt3 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.

@SergeyBiryukov3 years ago

Brings similar formatting cleanup to add_post_type_support() for consistency

comment:8 @wycks20 months 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'));

@wycks20 months ago

Fixed diff file name, not sure if it matters

Note: See TracTickets for help on using tickets.