Make WordPress Core


Ignore:
Timestamp:
12/30/2009 04:23:39 PM (14 years ago)
Author:
westi
Message:

Updates and improvements to _depreceated_argument. See #11386 props nacin.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/comment-template.php

    r12537 r12584  
    504504 * @since 0.71
    505505 *
    506  * @param string $deprecated_1 Not Used
    507  * @param bool $deprecated_2 Not Used
    508  */
    509 function comments_link( $deprecated_1 = '', $deprecated_2 = '' ) {
    510     if ( !empty( $deprecated_1 ) )
    511         _deprecated_argument(__FUNCTION__, 'deprecated_1', '0.0');
    512     if ( !empty( $deprecated_2 ) )
    513         _deprecated_argument(__FUNCTION__, 'deprecated_2', '0.0');
    514 
     506 * @param string $deprecated Not Used
     507 * @param bool $deprecated Not Used
     508 */
     509function comments_link( $deprecated = '', $deprecated = '' ) {
     510    if ( !empty( $deprecated ) )
     511        _deprecated_argument( __FUNCTION__, '0.0' );
    515512    echo get_comments_link();
    516513}
     
    555552function comments_number( $zero = false, $one = false, $more = false, $deprecated = '' ) {
    556553    global $id;
     554
     555    if ( !empty( $deprecated ) )
     556        _deprecated_argument( __FUNCTION__, '0.0' );
     557
    557558    $number = get_comments_number($id);
    558559
     
    697698 * @uses get_trackback_url() Gets the trackback url for the current post
    698699 *
    699  * @param bool $deprecated Remove backwards compat in 2.5
     700 * @param bool $deprecated_echo Remove backwards compat in 2.5
    700701 * @return void|string Should only be used to echo the trackback URL, use get_trackback_url() for the result instead.
    701702 */
    702 function trackback_url($deprecated = true) {
    703     if ($deprecated) echo get_trackback_url();
    704     else return get_trackback_url();
     703function trackback_url( $deprecated_echo = true ) {
     704    if ( $deprecated_echo !== true )
     705        _deprecated_argument( __FUNCTION__, '2.5', __('Use get_trackback_url() instead if you do not want the value echoed.') );
     706    if ( $deprecated_echo )
     707        echo get_trackback_url();
     708    else
     709        return get_trackback_url();
    705710}
    706711
     
    713718 */
    714719function trackback_rdf($deprecated = '') {
     720    if ( !empty( $deprecated ) )
     721        _deprecated_argument( __FUNCTION__, '2.5' );
     722
    715723    if (stripos($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator') === false) {
    716724        echo '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
Note: See TracChangeset for help on using the changeset viewer.