WordPress.org

Make WordPress Core

Opened 9 years ago

Last modified 7 weeks ago

#14077 reopened enhancement

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

Reported by: Utkarsh Owned by:
Milestone: Awaiting Review Priority: normal
Severity: minor Version: 3.0
Component: Posts, Post Types Keywords: has-patch, dev-feedback, bulk-reopened
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 9 years ago.
14077_2.diff (975 bytes) - added by edwardw 8 years ago.
Update of Utkarsh's previous patch
14077.3.diff (1.0 KB) - added by jeremyfelt 7 years ago.
Refreshed patch
14077.4.diff (2.3 KB) - added by SergeyBiryukov 7 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 6 years ago.
14077.5.diff (963 bytes) - added by wycks 6 years ago.
Fixed diff file name, not sure if it matters
14077.2.diff (1.1 KB) - added by paulwilde 4 years ago.
14077.6.diff (2.1 KB) - added by paulwilde 4 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 4 years ago.
14077.8.diff (2.5 KB) - added by paulwilde 4 years ago.

Download all attachments as: .zip

Change History (25)

@Utkarsh
9 years ago

#1 @Utkarsh
9 years ago

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

#2 @nacin
9 years ago

  • Milestone changed from Unassigned to 3.1

#3 @nacin
8 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
8 years ago

Update of Utkarsh's previous patch

#4 @edwardw
8 years ago

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

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

#5 @nacin
7 years ago

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

#6 @DrewAPicture
7 years ago

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

@jeremyfelt
7 years ago

Refreshed patch

#7 @jeremyfelt
7 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
7 years ago

Brings similar formatting cleanup to add_post_type_support() for consistency

#8 @wycks
6 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
6 years ago

Fixed diff file name, not sure if it matters

@paulwilde
4 years ago

#9 @paulwilde
4 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
4 years ago

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

@paulwilde
4 years ago

#10 @paulwilde
4 years ago

Refreshed patch.

This would be a nice easy win for 4.4.

#11 @DrewAPicture
4 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
4 years ago

#12 @paulwilde
4 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 4 years ago by paulwilde (previous) (diff)

#13 @paulwilde
4 years ago

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

#14 @iseulde
4 months ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed

This ticket has not seen any activity in over *two* years, so I'm closing it as "wontfix".

The ticket may lack decisiveness, may have become irrelevant, or may not have gathered enough interest.

If you think this ticket does deserve some attention again, feel free to reopen.

For bugs, it would be great if you could provide updated steps to reproduce against the latest version of WordPress (5.0.2 at the time of writing). Remember images or a video can be superior to explain a problem. At the very least, quickly test again to make sure the bug still exists.

If it’s an enhancement or feature, some extra motivation may help.

Thank you for your contributions to WordPress! <3

#15 @JeffPaul
7 weeks ago

  • Keywords bulk-reopened added
  • Milestone set to Awaiting Review
  • Resolution wontfix deleted
  • Status changed from closed to reopened

A decision was made to reopen tickets that were closed in the bulk edit that this ticket was affected by. This ticket is being placed back into the Awaiting Review milestone so it can be individually evaluated and verified to determine if it is still relevant/valid or reproducible.

Note: See TracTickets for help on using tickets.