upgrade_101() - WordPress 函数参考中文文档

返回介绍

upgrade_101()

发布于 2017-09-11 字数1030 浏览 835 评论 0

upgrade_101()

Execute changes made in WordPress 1.0.1.


描述


源代码

File: wp-admin/includes/upgrade.php

	if ($allposts) :
		foreach ($allposts as $post) {
			// Check to see if it's already been imported
			$cat = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->post2cat WHERE post_id = %d AND category_id = %d", $post->ID, $post->post_category) );
			if (!$cat && 0 != $post->post_category) { // If there's no result
				$wpdb->insert( $wpdb->post2cat, array('post_id' => $post->ID, 'category_id' => $post->post_category) );
			}
		}
	endif;
}

/**

更新日志

Version 描述
1.0.1 Introduced.

User Contributed Notes

上一篇:upgrade_100()

下一篇:upgrade_110()

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!