start_wp

函式
start_wp ( No parameters )
定義位置
相關方法
str_starts_withexport_wptimer_startstart_post_rel_linkstartelement
引入
1.0.1
棄用
1.5.0

start_wp:這個動作鉤子用於發出WordPress開始執行的訊號。這個鉤子在WordPress載入過程的開始被觸發,通常被外掛和主題開發者用來執行初始化任務。

設定WordPress迴圈。

用The Loop代替。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function start_wp() {
global $wp_query;
_deprecated_function( __FUNCTION__, '1.5.0', __('new WordPress Loop') );
// Since the old style loop is being used, advance the query iterator here.
$wp_query->next_post();
setup_postdata( get_post() );
}
function start_wp() { global $wp_query; _deprecated_function( __FUNCTION__, '1.5.0', __('new WordPress Loop') ); // Since the old style loop is being used, advance the query iterator here. $wp_query->next_post(); setup_postdata( get_post() ); }
function start_wp() {
	global $wp_query;

	_deprecated_function( __FUNCTION__, '1.5.0', __('new WordPress Loop') );

	// Since the old style loop is being used, advance the query iterator here.
	$wp_query->next_post();

	setup_postdata( get_post() );
}

常見問題

FAQs
檢視更多 >