Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




get_day_link [ WordPress Function ]

get_day_link ( $year, $month, $day )
Parameters:
  • (bool|int) $year False for current year. Integer of year.
  • (bool|int) $month False for current month. Integer of month.
  • (bool|int) $day False for current day. Integer of day.
Returns:
  • (string)
Defined at:



Retrieve the permalink for the day archives with year and month.

Source


<?php
function get_day_link($year$month$day) {
    global 
$wp_rewrite;
    if ( !
$year )
        
$year gmdate('Y'current_time('timestamp'));
    if ( !
$month )
        
$month gmdate('m'current_time('timestamp'));
    if ( !
$day )
        
$day gmdate('j'current_time('timestamp'));

    
$daylink $wp_rewrite->get_day_permastruct();
    if ( !empty(
$daylink) ) {
        
$daylink str_replace('%year%'$year$daylink);
        
$daylink str_replace('%monthnum%'zeroise(intval($month), 2), $daylink);
        
$daylink str_replace('%day%'zeroise(intval($day), 2), $daylink);
        return 
apply_filters('day_link'home_urluser_trailingslashit($daylink'day') ), $year$month$day);
    } else {
        return 
apply_filters('day_link'home_url'?m=' $year zeroise($month2) . zeroise($day2) ), $year$month$day);
    }
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics