CodeExplorer get_weekstartend example
if ( !
$results ) { $results =
$wpdb->
get_results( $query );
wp_cache_set( $key,
$results, 'post-queries'
);
} $arc_w_last = '';
if ( $results ) { $after =
$parsed_args['after'
];
foreach ( (array) $results as $result ) { if ( $result->week !=
$arc_w_last ) { $arc_year =
$result->yr;
$arc_w_last =
$result->week;
$arc_week =
get_weekstartend( $result->yyyymmdd,
get_option( 'start_of_week'
) );
$arc_week_start =
date_i18n( get_option( 'date_format'
),
$arc_week['start'
] );
$arc_week_end =
date_i18n( get_option( 'date_format'
),
$arc_week['end'
] );
$url =
add_query_arg( array
( 'm' =>
$arc_year,
'w' =>
$result->week,
),
home_url( '/'
) );
if ( 'post' !==
$parsed_args['post_type'
] ) { $url =
add_query_arg( 'post_type',
$parsed_args['post_type'
],
$url );
}