*
* @param string $redirect Optional path to redirect to on login/logout.
* @param boolean $echo Default to echo and not return the link.
*
* @param string $redirect Optional path to redirect to on login/logout.
* @param boolean $echo Default to echo and not return the link.
*/
function wp_loginout($redirect = '', $echo = true) {
if ( ! is_user_logged_in() )
*/
function wp_loginout($redirect = '', $echo = true) {
if ( ! is_user_logged_in() )
* @uses apply_filters() calls 'logout_url' hook on final logout url
*
* @param string $redirect Path to redirect to on logout.
* @uses apply_filters() calls 'logout_url' hook on final logout url
*
* @param string $redirect Path to redirect to on logout.
*
* @param string $redirect Path to redirect to on login.
* @param bool $force_reauth Whether to force reauthorization, even if a cookie is present. Default is false.
*
* @param string $redirect Path to redirect to on login.
* @param bool $force_reauth Whether to force reauthorization, even if a cookie is present. Default is false.
*/
function wp_login_url($redirect = '', $force_reauth = false) {
$login_url = site_url('wp-login.php', 'login');
*/
function wp_login_url($redirect = '', $force_reauth = false) {
$login_url = site_url('wp-login.php', 'login');
- * @param array $args Configuration options to modify the form output
- * @return Void, or string containing the form
+ * @param array $args Configuration options to modify the form output.
+ * @return string|null String when retrieving, null when displaying.
*/
function wp_login_form( $args = array() ) {
$defaults = array( 'echo' => true,
*/
function wp_login_form( $args = array() ) {
$defaults = array( 'echo' => true,
' . apply_filters( 'login_form_top', '', $args ) . '
<p class="login-username">
<label for="' . esc_attr( $args['id_username'] ) . '">' . esc_html( $args['label_username'] ) . '</label>
' . apply_filters( 'login_form_top', '', $args ) . '
<p class="login-username">
<label for="' . esc_attr( $args['id_username'] ) . '">' . esc_html( $args['label_username'] ) . '</label>
</p>
<p class="login-password">
<label for="' . esc_attr( $args['id_password'] ) . '">' . esc_html( $args['label_password'] ) . '</label>
</p>
<p class="login-password">
<label for="' . esc_attr( $args['id_password'] ) . '">' . esc_html( $args['label_password'] ) . '</label>
<input type="hidden" name="redirect_to" value="' . esc_url( $args['redirect'] ) . '" />
</p>
' . apply_filters( 'login_form_bottom', '', $args ) . '
<input type="hidden" name="redirect_to" value="' . esc_url( $args['redirect'] ) . '" />
</p>
' . apply_filters( 'login_form_bottom', '', $args ) . '
* @uses apply_filters() calls 'lostpassword_url' hook on the lostpassword url
*
* @param string $redirect Path to redirect to on login.
* @uses apply_filters() calls 'lostpassword_url' hook on the lostpassword url
*
* @param string $redirect Path to redirect to on login.
* @param string $before Text to output before the link (defaults to <li>).
* @param string $after Text to output after the link (defaults to </li>).
* @param boolean $echo Default to echo and not return the link.
* @param string $before Text to output before the link (defaults to <li>).
* @param string $after Text to output after the link (defaults to </li>).
* @param boolean $echo Default to echo and not return the link.
*/
function wp_get_archives($args = '') {
global $wpdb, $wp_locale;
*/
function wp_get_archives($args = '') {
global $wpdb, $wp_locale;
'type' => 'monthly', 'limit' => '',
'format' => 'html', 'before' => '',
'after' => '', 'show_post_count' => false,
'type' => 'monthly', 'limit' => '',
'format' => 'html', 'before' => '',
'after' => '', 'show_post_count' => false,
- $query = "SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC $limit";
+ $query = "SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date $order $limit";
$key = md5($query);
$cache = wp_cache_get( 'wp_get_archives' , 'general');
if ( !isset( $cache[ $key ] ) ) {
$key = md5($query);
$cache = wp_cache_get( 'wp_get_archives' , 'general');
if ( !isset( $cache[ $key ] ) ) {
$key = md5($query);
$cache = wp_cache_get( 'wp_get_archives' , 'general');
if ( !isset( $cache[ $key ] ) ) {
$key = md5($query);
$cache = wp_cache_get( 'wp_get_archives' , 'general');
if ( !isset( $cache[ $key ] ) ) {
- $query = "SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, DAYOFMONTH(post_date) AS `dayofmonth`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date), DAYOFMONTH(post_date) ORDER BY post_date DESC $limit";
+ $query = "SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, DAYOFMONTH(post_date) AS `dayofmonth`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date), DAYOFMONTH(post_date) ORDER BY post_date $order $limit";
$key = md5($query);
$cache = wp_cache_get( 'wp_get_archives' , 'general');
if ( !isset( $cache[ $key ] ) ) {
$key = md5($query);
$cache = wp_cache_get( 'wp_get_archives' , 'general');
if ( !isset( $cache[ $key ] ) ) {
- $query = "SELECT DISTINCT $week AS `week`, YEAR( `post_date` ) AS `yr`, DATE_FORMAT( `post_date`, '%Y-%m-%d' ) AS `yyyymmdd`, count( `ID` ) AS `posts` FROM `$wpdb->posts` $join $where GROUP BY $week, YEAR( `post_date` ) ORDER BY `post_date` DESC $limit";
+ $query = "SELECT DISTINCT $week AS `week`, YEAR( `post_date` ) AS `yr`, DATE_FORMAT( `post_date`, '%Y-%m-%d' ) AS `yyyymmdd`, count( `ID` ) AS `posts` FROM `$wpdb->posts` $join $where GROUP BY $week, YEAR( `post_date` ) ORDER BY `post_date` $order $limit";
$key = md5($query);
$cache = wp_cache_get( 'wp_get_archives' , 'general');
if ( !isset( $cache[ $key ] ) ) {
$key = md5($query);
$cache = wp_cache_get( 'wp_get_archives' , 'general');
if ( !isset( $cache[ $key ] ) ) {
*
* @param bool $initial Optional, default is true. Use initial calendar names.
* @param bool $echo Optional, default is true. Set to false for return.
*
* @param bool $initial Optional, default is true. Use initial calendar names.
* @param bool $echo Optional, default is true. Set to false for return.
*/
function get_calendar($initial = true, $echo = true) {
global $wpdb, $m, $monthnum, $year, $wp_locale, $posts;
*/
function get_calendar($initial = true, $echo = true) {
global $wpdb, $m, $monthnum, $year, $wp_locale, $posts;
* @return string|null Null if displaying, string if retrieving.
*/
function get_the_date( $d = '' ) {
* @return string|null Null if displaying, string if retrieving.
*/
function get_the_date( $d = '' ) {
- global $wp_locale, $post;
- $the_weekday = $wp_locale->get_weekday(mysql2date('w', $post->post_date, false));
+ global $wp_locale;
+ $the_weekday = $wp_locale->get_weekday( mysql2date( 'w', get_post()->post_date, false ) );
* @param string $after Optional Output after the date.
*/
function the_weekday_date($before='',$after='') {
* @param string $after Optional Output after the date.
*/
function the_weekday_date($before='',$after='') {
'authortitle' => __('%1$s %2$s Posts by %3$s Feed'),
/* translators: 1: blog name, 2: separator(raquo), 3: search phrase */
'searchtitle' => __('%1$s %2$s Search Results for “%3$s” Feed'),
'authortitle' => __('%1$s %2$s Posts by %3$s Feed'),
/* translators: 1: blog name, 2: separator(raquo), 3: search phrase */
'searchtitle' => __('%1$s %2$s Search Results for “%3$s” Feed'),
);
$args = wp_parse_args( $args, $defaults );
if ( is_single() || is_page() ) {
$id = 0;
);
$args = wp_parse_args( $args, $defaults );
if ( is_single() || is_page() ) {
$id = 0;
if ( comments_open() || pings_open() || $post->comment_count > 0 ) {
$title = sprintf( $args['singletitle'], get_bloginfo('name'), $args['separator'], esc_html( get_the_title() ) );
if ( comments_open() || pings_open() || $post->comment_count > 0 ) {
$title = sprintf( $args['singletitle'], get_bloginfo('name'), $args['separator'], esc_html( get_the_title() ) );
} elseif ( is_search() ) {
$title = sprintf( $args['searchtitle'], get_bloginfo('name'), $args['separator'], get_search_query( false ) );
$href = get_search_feed_link();
} elseif ( is_search() ) {
$title = sprintf( $args['searchtitle'], get_bloginfo('name'), $args['separator'], get_search_query( false ) );
$href = get_search_feed_link();
+ } elseif ( is_post_type_archive() ) {
+ $title = sprintf( $args['posttypetitle'], get_bloginfo('name'), $args['separator'], post_type_archive_title( '', false ) );
+ $href = get_post_type_archive_feed_link( get_queried_object()->name );
if ( get_user_option( 'rich_editing' ) == 'true' || ! is_user_logged_in() ) { // default to 'true' for logged out users
if ( $is_safari ) {
$wp_rich_edit = ! wp_is_mobile() || ( preg_match( '!AppleWebKit/(\d+)!', $_SERVER['HTTP_USER_AGENT'], $match ) && intval( $match[1] ) >= 534 );
if ( get_user_option( 'rich_editing' ) == 'true' || ! is_user_logged_in() ) { // default to 'true' for logged out users
if ( $is_safari ) {
$wp_rich_edit = ! wp_is_mobile() || ( preg_match( '!AppleWebKit/(\d+)!', $_SERVER['HTTP_USER_AGENT'], $match ) && intval( $match[1] ) >= 534 );
* Find out which editor should be displayed by default.
*
* Works out which of the two editors to display as the current editor for a
* Find out which editor should be displayed by default.
*
* Works out which of the two editors to display as the current editor for a
if ( $lang = get_bloginfo('language') ) {
if ( get_option('html_type') == 'text/html' || $doctype == 'html' )
if ( $lang = get_bloginfo('language') ) {
if ( get_option('html_type') == 'text/html' || $doctype == 'html' )
- wp_admin_css_color( 'classic', _x( 'Blue', 'admin color scheme' ), admin_url( 'css/colors-classic.css' ),
+ wp_admin_css_color( 'classic', _x( 'Blue', 'admin color scheme' ), admin_url( 'css/colors-classic.min.css' ),
array( '#5589aa', '#cfdfe9', '#d1e5ee', '#eff8ff' ) );
array( '#5589aa', '#cfdfe9', '#d1e5ee', '#eff8ff' ) );
- wp_admin_css_color( 'fresh', _x( 'Gray', 'admin color scheme' ), admin_url( 'css/colors-fresh.css' ),
+ wp_admin_css_color( 'fresh', _x( 'Gray', 'admin color scheme' ), admin_url( 'css/colors-fresh.min.css' ),
array( '#555', '#a0a0a0', '#ccc', '#f1f1f1' ) );
}
array( '#555', '#a0a0a0', '#ccc', '#f1f1f1' ) );
}
- * @param any $helper One of the values to compare
- * @param any $current (true) The other value to compare if not just true
+ * @param mixed $helper One of the values to compare
+ * @param mixed $current (true) The other value to compare if not just true
* @param bool $echo Whether to echo or just return the string
* @param string $type The type of checked|selected|disabled we are doing
* @return string html attribute or empty string
* @param bool $echo Whether to echo or just return the string
* @param string $type The type of checked|selected|disabled we are doing
* @return string html attribute or empty string