WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#14161 closed enhancement (fixed)

Taxonomy Titles

Reported by: ramiy Owned by:
Priority: low Milestone: 3.1
Component: Template Version: 3.0
Severity: normal Keywords: has-patch
Cc: r_a_m_i@…, kevinB

Description

in category.php we use the category_description() and single_cat_title() functions.

in tag.php we use the tag_description() and single_tag_title() functions.

in taxonomy.php we use term_description() function BUT the is no title function.

Attachments (2)

14161.patch (3.0 KB) - added by ramiy 3 years ago.
single_term_title() function
14161.2.patch (6.6 KB) - added by scribu 3 years ago.
cleaned up wp_title(), single_cat_title() & single_tag_title()

Download all attachments as: .zip

Change History (26)

comment:1 markmcwilliams3 years ago

Wouldn't it be a lot easier, and simplier to just have term_description() and single_term_title() if anything and an option to state which (if any) term we are talking about? :) It would make a lot more logic to me...!

comment:2 follow-up: nacin3 years ago

Indeed, term_description() is used by both category_ and tag_.

comment:3 in reply to: ↑ 2 markmcwilliams3 years ago

Replying to nacin:

Indeed, term_description() is used by both category_ and tag_.

On a closer inspection (well actually I found the right PHP file to look at) I can see that they both use term_description() like you say!

comment:4 ramiy3 years ago

Yes, both category_description() and tag_description() use the main term_description() function. I think cat/tag functions were not deleted for backwards compatibility.

We need to do the same with single_term_title().

comment:5 scribu3 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release
  • Priority changed from normal to low
  • Severity changed from major to normal

comment:6 kevinB3 years ago

  • Cc kevinB added

ramiy3 years ago

single_term_title() function

comment:7 ramiy3 years ago

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

comment:8 follow-up: scribu3 years ago

ramiy, your patch introduces single_term_title(), but it doesn't use it anywhere in Core, like in single_tag_title().

comment:9 in reply to: ↑ 8 ramiy3 years ago

Replying to scribu:

ramiy, your patch introduces single_term_title(), but it doesn't use it anywhere in Core, like in single_tag_title().

WP v3.0 introduced taxonomy-{taxonomy}-{term}.php template file. i need it for my theme to show the taxonomy title.

We can add the taxonomy.php file to "Twenty Ten" theme for better suport of custom taxonomies.

comment:10 follow-up: scribu3 years ago

  • Keywords changed from has-patch, dev-feedback to has-patch dev-feedback

No, I thought single_term_title() could be used in single_tag_title(), in the same way term_description() is used in tag_description().

comment:11 in reply to: ↑ 10 ramiy3 years ago

scribu, i think you right, but i will need your help with the code.

comment:12 ramiy3 years ago

scribu, see also the wp_title() function. it uses single_cat_title() and single_tag_title(). we need to insert the new single_term_title() to wp_title() when taxonomy archive is being used.

comment:13 scribu3 years ago

  • Component changed from Taxonomy to Template
  • Keywords dev-feedback removed
  • Milestone changed from Future Release to 3.1

No, I thought single_term_title() could be used in single_tag_title(), in the same way term_description() is used in tag_description().

scribu, see also the wp_title() function. it uses single_cat_title() and single_tag_title(). we need to insert the new single_term_title() to wp_title() when taxonomy archive is being used.

Done and done. See 14161.2.patch

scribu3 years ago

cleaned up wp_title(), single_cat_title() & single_tag_title()

comment:14 ramiy3 years ago

looks good.

comment:15 ramiy3 years ago

wp 3.1 is planned for late 2010/early 2011. can you change the milestone to 3.0.1 ?

comment:16 scribu3 years ago

WP 3.0.1 is only for security fixes or blockers (bugs that would have blocked 3.0 from shipping, if they were known).

comment:17 ramiy3 years ago

But without the single_term_title() function we can't insert titles to taxonomy.php tamplate file (or to archive.php).

We forgot to deal this issue in v3.0 and users that use custom taxonomies can't wait another 6 monts for v3.1, especially when there is a working solution.

Please, add this to 3.0.1.

comment:18 scribu3 years ago

Support for custom taxonomies was introduced way back in WP 2.8 and I haven't heard any complaints about a lack of single_term_title() until this ticket.

Anyway, until WP 3.1, users can just add this to their functions.php file:

if ( !function_exists('single_term_title') ) :
function single_term_title(...) {
   ...
}

comment:19 scribu3 years ago

Forgot an endif; at the end.

comment:20 follow-up: ramiy3 years ago

taxonomy.php tamplate files where introduced in WP 3.0.

comment:21 in reply to: ↑ 20 nacin3 years ago

Replying to ramiy:

Please, add this to 3.0.1.

That's not how it works.

Replying to ramiy:

taxonomy.php tamplate files where introduced in WP 3.0.

They were introduced in 2.5.

comment:22 ramiy3 years ago

ok. 3.1 it is.

comment:23 scribu3 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [15598]) Clean up single_cat_title(), single_tag_title() and wp_title(). Fixes #14161

comment:24 scribu3 years ago

(In [15599]) Replace is_term() with is_tax(). See #14161

Note: See TracTickets for help on using tickets.