Make WordPress Core

Ticket #3450: wp_return2.diff

File wp_return2.diff, 3.9 KB (added by Viper007Bond, 19 years ago)

Was missing a tab

  • wp-includes/post-template.php

     
    2020        $title = get_the_title();
    2121        if ( strlen($title) > 0 ) {
    2222                $title = apply_filters('the_title', $before . $title . $after, $before, $after);
    23                 if ( $echo )
    24                         echo $title;
    25                 else
    26                         return $title;
     23                return wp_return($title, $echo);
    2724        }
    2825}
    2926
     
    187184                }
    188185        }
    189186
    190         if ( $echo )
    191                 echo $output;
    192 
    193         return $output;
     187        return wp_return($output, $echo);
    194188}
    195189
    196190
     
    256250
    257251        $output = apply_filters('wp_dropdown_pages', $output);
    258252
    259         if ( $echo )
    260                 echo $output;
    261 
    262         return $output;
     253        return wp_return($output, $echo);
    263254}
    264255
    265256function wp_list_pages($args = '') {
  • wp-includes/general-template.php

     
    661661                $previousday = $day;
    662662        }
    663663        $the_date = apply_filters('the_date', $the_date, $d, $before, $after);
    664         if ( $echo )
    665                 echo $the_date;
    666         else
    667                 return $the_date;
     664
     665        return wp_return($the_date, $echo);
    668666}
    669667
    670668
  • wp-includes/deprecated.php

     
    4444        $categories = get_the_category();
    4545        $cat = $categories[0]->cat_ID;
    4646
    47         if ( $echo )
    48                 echo $cat;
    49 
    50         return $cat;
     47        return wp_return($cat, $echo);
    5148}
    5249
    5350// Deprecated.
     
    481478function get_author_link($echo = false, $author_id, $author_nicename = '') {
    482479        $link = get_author_posts_url($author_id, $author_nicename);
    483480
    484         if ( $echo )
    485                 echo $link;
    486         return $link;
     481        return wp_return($link, $echo);
    487482}
    488483
    489484function link_pages($before='<br />', $after='<br />', $next_or_number='number', $nextpagelink='next page', $previouspagelink='previous page', $pagelink='%', $more_file='') {
  • wp-includes/feed.php

     
    120120
    121121        $link = apply_filters('author_feed_link', $link);
    122122
    123         if ( $echo )
    124                 echo $link;
    125         return $link;
     123        return wp_return($link, $echo);
    126124}
    127125
    128126
     
    138136
    139137        $link = apply_filters('category_feed_link', $link);
    140138
    141         if ( $echo )
    142                 echo $link;
    143         return $link;
     139        return wp_return($link, $echo);
    144140}
    145141
    146142
  • wp-includes/functions.php

     
    498498        return $headers;
    499499}
    500500
     501// Implementation within function:  return wp_return($func_data, $echo_flag);
     502function wp_return($data, $echo = true) {
     503        echo ( $echo ) ? $data : '';
     504        return $data;
     505}
     506
    501507function is_new_day() {
    502508        global $day, $previousday;
    503509        if ( $day != $previousday ) {
  • wp-includes/bookmark-template.php

     
    140140                $output .= "$after\n";
    141141        } // end while
    142142
    143         if ( !$echo )
    144                 return $output;
    145         echo $output;
     143        return wp_return($output, $echo);
    146144}
    147145
    148146function get_linkrating($link) {
     
    351349                }
    352350        }
    353351
    354         if ( !$echo )
    355                 return $output;
    356         echo $output;
     352        return wp_return($output, $echo);
    357353}
    358354
    359355?>
  • wp-includes/category-template.php

     
    203203
    204204        $output = apply_filters('wp_dropdown_cats', $output);
    205205
    206         if ( $echo )
    207                 echo $output;
    208 
    209         return $output;
     206        return wp_return($output, $echo);
    210207}
    211208
    212209function wp_list_categories($args = '') {