WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 7 weeks ago

#20359 closed enhancement (invalid)

wp_list_categories - Diff to make use_desc_for_title parameter more flexible

Reported by: 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 2 years ago.
Enhances $use_desc_for_title in 'category-template.php' and 'deprecated.php'

Download all attachments as: .zip

Change History (6)

comment:1 Marventus2 years ago

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

Marventus2 years ago

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

comment:2 Marventus2 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.

comment:3 nacin6 months ago

  • Component changed from General to Taxonomy

comment:4 wonderboymusic7 weeks ago

  • Milestone changed from Awaiting Review to 4.0

comment:5 SergeyBiryukov7 weeks 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.