Make WordPress Core

Opened 14 years ago

Last modified 4 years ago

#14077 new enhancement

Add support for removal of multiple features from a post type in remove_post_type_support

Reported by: utkarsh's profile 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)

14077.diff (971 bytes) - added by Utkarsh 14 years ago.
14077_2.diff (975 bytes) - added by edwardw 12 years ago.
Update of Utkarsh's previous patch
14077.3.diff (1.0 KB) - added by jeremyfelt 12 years ago.
Refreshed patch
14077.4.diff (2.3 KB) - added by SergeyBiryukov 12 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 11 years ago.
14077.5.diff (963 bytes) - added by wycks 11 years ago.
Fixed diff file name, not sure if it matters
14077.2.diff (1.1 KB) - added by paulwilde 9 years ago.
14077.6.diff (2.1 KB) - added by paulwilde 9 years ago.
Alternative patch which cleans up add_post_type_support() and changes $feature to $features
14077.7.diff (2.1 KB) - added by paulwilde 9 years ago.
14077.8.diff (2.5 KB) - added by paulwilde 9 years ago.

Download all attachments as: .zip

Change History (24)

@Utkarsh
14 years ago

#1 @Utkarsh
14 years ago

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

#2 @nacin
14 years ago

  • Milestone changed from Unassigned to 3.1

#3 @nacin
13 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.

@edwardw
12 years ago

Update of Utkarsh's previous patch

#4 @edwardw
12 years ago

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

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

#5 @nacin
12 years ago

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

#6 @DrewAPicture
12 years ago

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

@jeremyfelt
12 years ago

Refreshed patch

#7 @jeremyfelt
12 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.

@SergeyBiryukov
12 years ago

Brings similar formatting cleanup to add_post_type_support() for consistency

#8 @wycks
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'));
}

@wycks
11 years ago

Fixed diff file name, not sure if it matters

@paulwilde
9 years ago

#9 @paulwilde
9 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.

@paulwilde
9 years ago

Alternative patch which cleans up add_post_type_support() and changes $feature to $features

@paulwilde
9 years ago

#10 @paulwilde
9 years ago

Refreshed patch.

This would be a nice easy win for 4.4.

#11 @DrewAPicture
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.

@paulwilde
9 years ago

#12 @paulwilde
9 years ago

  • Keywords needs-docs removed

Added changelog entries as suggested by @DrewAPicture. Also refreshed patch to apply on trunk (post.php was rearranged into post-functions.php).

Last edited 9 years ago by paulwilde (previous) (diff)

#13 @paulwilde
8 years ago

Patch still applies cleanly - Any interest in this going into 4.4?

#14 @chrisvanpatten
4 years ago

I just came looking for this as well; would love to see it land in 5.4. I'm happy to refresh the patch if needed (cc @paulwilde)

Note: See TracTickets for help on using tickets.