the_weekday

函式
the_weekday ( No parameters )
定義位置
相關方法
the_weekday_datethe_datethe_metathe_idthe_generator
引入
0.71
棄用
-

the_weekday: 這個函式檢索給定日期的工作日名稱或WordPress時區中的當前日期。

顯示寫文章的工作日。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function the_weekday() {
global $wp_locale;
$post = get_post();
if ( ! $post ) {
return;
}
$the_weekday = $wp_locale->get_weekday( get_post_time( 'w', false, $post ) );
/**
* Filters the weekday on which the post was written, for display.
*
* @since 0.71
*
* @param string $the_weekday
*/
echo apply_filters( 'the_weekday', $the_weekday );
}
function the_weekday() { global $wp_locale; $post = get_post(); if ( ! $post ) { return; } $the_weekday = $wp_locale->get_weekday( get_post_time( 'w', false, $post ) ); /** * Filters the weekday on which the post was written, for display. * * @since 0.71 * * @param string $the_weekday */ echo apply_filters( 'the_weekday', $the_weekday ); }
function the_weekday() {
	global $wp_locale;

	$post = get_post();

	if ( ! $post ) {
		return;
	}

	$the_weekday = $wp_locale->get_weekday( get_post_time( 'w', false, $post ) );

	/**
	 * Filters the weekday on which the post was written, for display.
	 *
	 * @since 0.71
	 *
	 * @param string $the_weekday
	 */
	echo apply_filters( 'the_weekday', $the_weekday );
}

常見問題

FAQs
檢視更多 >