本文整理汇总了PHP中wpmu_update_blogs_date函数的典型用法代码示例。如果您正苦于以下问题:PHP wpmu_update_blogs_date函数的具体用法?PHP wpmu_update_blogs_date怎么用?PHP wpmu_update_blogs_date使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wpmu_update_blogs_date函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: _update_blog_date_on_post_delete
/**
* Handler for updating the blog date when a published post is deleted.
*
* @since 3.4.0
*
* @param int $post_id Post ID
*/
function _update_blog_date_on_post_delete($post_id)
{
$post = get_post($post_id);
$post_type_obj = get_post_type_object($post->post_type);
if (!$post_type_obj || !$post_type_obj->public) {
return;
}
if ('publish' != $post->post_status) {
return;
}
wpmu_update_blogs_date();
}
开发者ID:trinoamez,项目名称:WordpressPlatzi,代码行数:19,代码来源:ms-blogs.php
示例2: _update_blog_date_on_post_publish
/**
* Handler for updating the blog date when a post is published or an already published post is changed.
*
* @since 3.3.0
*
* @param string $new_status The new post status
* @param string $old_status The old post status
* @param object $post Post object
*/
function _update_blog_date_on_post_publish($new_status, $old_status, $post)
{
$post_type_obj = get_post_type_object($post->post_type);
if (!$post_type_obj->public) {
return;
}
if ('publish' != $new_status && 'publish' != $old_status) {
return;
}
// Post was freshly published, published post was saved, or published post was unpublished.
wpmu_update_blogs_date();
}
开发者ID:Esleelkartea,项目名称:asociacion-tecnicos-artes-escenicas-ATAE-,代码行数:21,代码来源:ms-blogs.php
示例3: test_wpmu_update_blogs_date
function test_wpmu_update_blogs_date() {
global $wpdb;
wpmu_update_blogs_date();
// compare the update time with the current time, allow delta < 2
$blog = get_blog_details( $wpdb->blogid );
$current_time = time();
$time_difference = $current_time - strtotime( $blog->last_updated );
$this->assertLessThan( 2, $time_difference );
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:11,代码来源:ms.php
示例4: _e
@unlink($dir_to_copy_into . '/sitemap.xml');
}
} else {
_e("<span class=\"error\">Was unable to copy images and uploads!</span>", 'acswpmu_trdom');
}
}
}
//reset permalink structure
if (!$error) {
switch_to_blog($new_blog_id);
//_e("Switched from here to $new_blog_id to reset permalinks<br>", 'acswpmu_trdom' );
global $wp_rewrite;
$wp_rewrite->init();
$wp_rewrite->flush_rules();
//now that we are here, update the date of the new site
wpmu_update_blogs_date();
//go back to admin
restore_current_blog();
_e("Permalinks updated.<br>", 'acswpmu_trdom');
}
// count succesfull and failed sites
if (!$error) {
_e("Job done, sucesfully created {$fulldomain} with site id: {$new_blog_id}<br>", 'acswpmu_trdom');
if ($domainmap) {
_e("and mapped the site to: <a href=\"http://{$siteurl}\" target=\"test\">{$siteurl}</a>.<br>", 'acswpmu_trdom');
}
// count succesfull cloned sites
$cloned[] = $siteurl;
} else {
// count failed sites
$failed[] = $siteurl;
开发者ID:priscillamc,项目名称:add-cloned-sites-for-wpmu-batch,代码行数:31,代码来源:magic-add-cloned-sites.php
注:本文中的wpmu_update_blogs_date函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论