WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 3 years ago

Last modified 3 years ago

#13650 closed enhancement (worksforme)

Allow filtering of term description in Administration Panels

Reported by: mfields Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Taxonomy Keywords:
Focuses: Cc:

Description

In case where users take full advantage of the taxonomy system by adding descriptions for their terms, the administration panels which display multiple terms can become really messy. It would be great if the $term->description could be filtered. I have attached a diff.

Attachments (1)

wp-admin.template.diff (580 bytes) - added by mfields 4 years ago.

Download all attachments as: .zip

Change History (6)

mfields4 years ago

comment:1 nacin4 years ago

  • Milestone changed from 3.1 to Future Release

You can always remove the description column and add your own.

Seems sensible, but moving to future release, as we'd like to start pulling from there into specific milestones once scope is set. Revisit after 3.1 scope is set.

comment:2 mfields4 years ago

The process for removing the original description and adding your own filtered version adds up to quite a few lines of code as documented [here]http://wordpress.mfields.org/2010/dealing-with-long-taxonomy-descriptions-in-the-wordpress-administration-panels/

Would be awesome to not have to go this route :)

As soon as you have time, it would be great to have this filter added! No pressure.

comment:3 mfields3 years ago

Now that 3.1 has sortable columns in wp-admin/edit-tags.php, removing the description column and adding a custom one breaks this sorting. It would be great to see this filter added so that plugins that alter the description do not break core functionality. I can resubmit a new patch if this is approved.

comment:4 scribu3 years ago

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

No, you can still keep the sorting:

function replace_default_column( $columns ) {
	$columns['my_description'] = $columns['description'];

	unset( $columns['description'] );

	return $columns;
}

add_filter( 'manage_edit-category_columns', 'replace_default_column' );
add_filter( 'manage_edit-category_sortable_columns', 'replace_default_column' );

We just re-use the title and the orderby value from the original column.

comment:5 mfields3 years ago

@scribu - Thank you! This is really awesome and easy :) Really appreciate you posting the solution.

Note: See TracTickets for help on using tickets.