wpmu_update_blogs_date

函式
wpmu_update_blogs_date ( No parameters )

wpmu_update_blogs_date: 這個函式在WordPress多站點(WPMU)安裝中用來更新網路中一個部落格的日期。它把部落格ID作為一個引數,並更新部落格表中的日期。每當網路中的部落格有新的文章時,這個函式就會被執行。

更新當前站點的last_updated欄位。

function wpmu_update_blogs_date() {
	$site_id = get_current_blog_id();

	update_blog_details( $site_id, array( 'last_updated' => current_time( 'mysql', true ) ) );
	/**
	 * Fires after the blog details are updated.
	 *
	 * @since MU (3.0.0)
	 *
	 * @param int $blog_id Site ID.
	 */
	do_action( 'wpmu_blog_updated', $site_id );
}

常見問題

FAQs
檢視更多 >