[wp-trac] [WordPress Trac] #16282: PHP catchable error with get_term_link and WP3.1RC2

WordPress Trac wp-trac at lists.automattic.com
Sun Jan 23 16:44:48 UTC 2011


#16282: PHP catchable error with get_term_link and WP3.1RC2
--------------------------------------+-----------------------
 Reporter:  illutic                   |       Owner:
     Type:  defect (bug)              |      Status:  reopened
 Priority:  normal                    |   Milestone:  3.1
Component:  Multisite                 |     Version:  3.1
 Severity:  major                     |  Resolution:
 Keywords:  needs-patch dev-feedback  |
--------------------------------------+-----------------------

Comment (by scribu):

 The problem was caused by the new sanitize_title_for_query().

 I replaced this:

 {{{
 echo get_term_link( __( 'België', 'wpo' ),'provincie' );
 }}}

 with this:

 {{{
 echo get_term_link( get_term_by( 'name', __( 'België', 'wpo' ),
 'provincie' ) );
 }}}

 and it works.

 The {{{__()}}} is used in order for the WPML plugin to work.

 Even if sanitize_title_for_query() weren't introduced,
 {{{get_term_by('slug', ...)}}} could still return incorrect results, if
 the slug was modified manually, for example.

 Suggest closing as 'worksforme'.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16282#comment:15>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list