_wp_mysql_week [ WordPress Function ]
_wp_mysql_week ( $column )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Returns a MySQL expression for selecting the week number based on the start_of_week option.
Source
<?php
function _wp_mysql_week( $column ) {
switch ( $start_of_week = (int) get_option( 'start_of_week' ) ) {
default :
case 0 :
return "WEEK( $column, 0 )";
case 1 :
return "WEEK( $column, 1 )";
case 2 :
case 3 :
case 4 :
case 5 :
case 6 :
return "WEEK( DATE_SUB( $column, INTERVAL $start_of_week DAY ), 0 )";
}
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- #10397 (Start of week and WEEK mysql date function) – WordPress ...
Introduces _wp_mysql_week() to output the appropriate MySQL WEEK() expression given the start_of_week value. Fixes the w parameter of WP_Query to ...
core.trac.wordpress.org - _wp_mysql_week | A HitchHackers guide through WordPress
Feb 12, 2011 ... function _wp_mysql_week( $column ) { switch ( $start_of_week = (int) get_option ( 'start_of_week' ) ) { default : case 0 : return "WEEK( $column, ...
hitchhackerguide.com - _wp_mysql_week() WordPress function reference, arguments and ...
Returns a MySQL expression for selecting the week number based on the start_of_week option.
queryposts.com - [WordPress] element index
_wp_footer_scripts. _wp_footer_scripts() in script-loader.php. Private, for use in * _footer_scripts hooks. _wp_mysql_week. _wp_mysql_week() in functions.php ...
phpdoc.ftwr.co.uk