Make WordPress Core

Opened 13 years ago

Closed 11 years ago

#20359 closed enhancement (invalid)

wp_list_categories - Diff to make use_desc_for_title parameter more flexible

Reported by: marventus's profile Marventus Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.2.1
Component: Taxonomy Keywords: has-patch
Focuses: Cc:

Description

Right now, the @use_desc_for_title is defined as a boolean parameter which outputs category link title attributes containing either:

  • Category descriptions by default (bool 1);
  • 'View all posts filed under [category-name]'.

Now, since the title attribute is not required for <a> tags in any HTML spec, I made a patch to turn this parameter into a string, with the following supported values:

  • 'desc' => (default) Outputs category descriptions;
  • 'viewall' => Same output as bool 0 (false) before: 'View all posts filed under [category-name]';
  • 'none' => Does not output any title attributes.

I have tested this thoroughly, but additional testing would not hurt.

Attachments (1)

category-template-#20359.php.diff (3.0 KB) - added by Marventus 13 years ago.
Enhances $use_desc_for_title in 'category-template.php' and 'deprecated.php'

Download all attachments as: .zip

Change History (6)

#1 @Marventus
13 years ago

I forgot to mention that the proposed patch also introduces small changes to deprecated.php.

@Marventus
13 years ago

Enhances $use_desc_for_title in 'category-template.php' and 'deprecated.php'

#2 @Marventus
13 years ago

  • Keywords needs-codex added
  • Version changed from 3.4 to 2.2.1

It seems this had already been reported in #4596 but the fix was discarded by darkdragon. Since I already created this ticket, and the other one is very old and is closed now, I'll keep posting here.
Added the needs-codex Keyword to update the wp_list_categories Codex entry if this gets implemented.

#3 @nacin
11 years ago

  • Component changed from General to Taxonomy

#4 @wonderboymusic
11 years ago

  • Milestone changed from Awaiting Review to 4.0

#5 @SergeyBiryukov
11 years ago

  • Keywords needs-testing needs-codex removed
  • Milestone 4.0 deleted
  • Resolution set to invalid
  • Status changed from new to closed

'View all posts filed under %s' string was removed in [28359].

You can now just set 'use_desc_for_title' => false to remove the title attribute.

Note: See TracTickets for help on using tickets.