• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP populate_roles_210函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中populate_roles_210函数的典型用法代码示例。如果您正苦于以下问题:PHP populate_roles_210函数的具体用法?PHP populate_roles_210怎么用?PHP populate_roles_210使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了populate_roles_210函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: populate_roles

/**
 * Execute WordPress role creation for the various WordPress versions.
 *
 * @since 2.0.0
 */
function populate_roles()
{
    populate_roles_160();
    populate_roles_210();
    populate_roles_230();
    populate_roles_250();
    populate_roles_260();
    populate_roles_270();
    populate_roles_280();
    populate_roles_300();
}
开发者ID:x3mgroup,项目名称:wordpress-mod,代码行数:16,代码来源:schema.php


示例2: populate_roles

function populate_roles()
{
    populate_roles_160();
    populate_roles_210();
    populate_roles_230();
}
开发者ID:helmonaut,项目名称:owb-mirror,代码行数:6,代码来源:schema.php


示例3: upgrade_210

/**
 * Execute changes made in WordPress 2.1.
 *
 * @since 2.1.0
 */
function upgrade_210()
{
    global $wpdb, $wp_current_db_version;
    if ($wp_current_db_version < 3506) {
        // Update status and type.
        $posts = $wpdb->get_results("SELECT ID, post_status FROM {$wpdb->posts}");
        if (!empty($posts)) {
            foreach ($posts as $post) {
                $status = $post->post_status;
                $type = 'post';
                if ('static' == $status) {
                    $status = 'publish';
                    $type = 'page';
                } else {
                    if ('attachment' == $status) {
                        $status = 'inherit';
                        $type = 'attachment';
                    }
                }
                $wpdb->query($wpdb->prepare("UPDATE {$wpdb->posts} SET post_status = %s, post_type = %s WHERE ID = %d", $status, $type, $post->ID));
            }
        }
    }
    if ($wp_current_db_version < 3845) {
        populate_roles_210();
    }
    if ($wp_current_db_version < 3531) {
        // Give future posts a post_status of future.
        $now = gmdate('Y-m-d H:i:59');
        $wpdb->query("UPDATE {$wpdb->posts} SET post_status = 'future' WHERE post_status = 'publish' AND post_date_gmt > '{$now}'");
        $posts = $wpdb->get_results("SELECT ID, post_date FROM {$wpdb->posts} WHERE post_status ='future'");
        if (!empty($posts)) {
            foreach ($posts as $post) {
                wp_schedule_single_event(mysql2date('U', $post->post_date, false), 'publish_future_post', array($post->ID));
            }
        }
    }
}
开发者ID:beaucollins,项目名称:wp,代码行数:43,代码来源:upgrade.php


示例4: upgrade_210

function upgrade_210()
{
    global $wpdb, $wp_current_db_version;
    if ($wp_current_db_version < 3506) {
        // Update status and type.
        $posts = $wpdb->get_results("SELECT ID, post_status FROM {$wpdb->posts}");
        if (!empty($posts)) {
            foreach ($posts as $post) {
                $status = $post->post_status;
                $type = 'post';
                if ('static' == $status) {
                    $status = 'publish';
                    $type = 'page';
                } else {
                    if ('attachment' == $status) {
                        $status = 'inherit';
                        $type = 'attachment';
                    }
                }
                $wpdb->query("UPDATE {$wpdb->posts} SET post_status = '{$status}', post_type = '{$type}' WHERE ID = '{$post->ID}'");
            }
        }
    }
    if ($wp_current_db_version < 3845) {
        populate_roles_210();
    }
    if ($wp_current_db_version < 3531) {
        // Give future posts a post_status of future.
        $now = gmdate('Y-m-d H:i:59');
        $wpdb->query("UPDATE {$wpdb->posts} SET post_status = 'future' WHERE post_status = 'publish' AND post_date_gmt > '{$now}'");
        $posts = $wpdb->get_results("SELECT ID, post_date FROM {$wpdb->posts} WHERE post_status ='future'");
        if (!empty($posts)) {
            foreach ($posts as $post) {
                wp_schedule_single_event(mysql2date('U', $post->post_date), 'publish_future_post', array($post->ID));
            }
        }
    }
    if ($wp_current_db_version < 3570) {
        // Create categories for link categories if a category with the same
        // name doesn't exist.  Create a map of link cat IDs to cat IDs.
        $link_cat_id_map = array();
        $link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM " . $wpdb->prefix . 'linkcategories');
        foreach ($link_cats as $link_cat) {
            if ($cat_id = category_exists($link_cat->cat_name)) {
                $link_cat_id_map[$link_cat->cat_id] = $cat_id;
                $default_link_cat = $cat_id;
            } else {
                $link_cat_id_map[$link_cat->cat_id] = wp_create_category($link_cat->cat_name);
                $default_link_cat = $link_cat_id_map[$link_cat->cat_id];
            }
        }
        // Associate links to cats.
        $links = $wpdb->get_results("SELECT link_id, link_category FROM {$wpdb->links}");
        if (!empty($links)) {
            foreach ($links as $link) {
                if (0 == $link->link_category) {
                    continue;
                }
                if (!isset($link_cat_id_map[$link->link_category])) {
                    continue;
                }
                $link_cat = $link_cat_id_map[$link->link_category];
                $cat = $wpdb->get_row("SELECT * FROM {$wpdb->link2cat} WHERE link_id = '{$link->link_id}' AND category_id = '{$link_cat}'");
                if (!$cat) {
                    $wpdb->query("INSERT INTO {$wpdb->link2cat} (link_id, category_id)\n\t\t\t\t\tVALUES ('{$link->link_id}', '{$link_cat}')");
                }
            }
        }
        // Set default to the last category we grabbed during the upgrade loop.
        update_option('default_link_category', $default_link_cat);
        // Count links per category.
        if (0 == $wpdb->get_var("SELECT SUM(link_count) FROM {$wpdb->categories}")) {
            $categories = $wpdb->get_col("SELECT cat_ID FROM {$wpdb->categories}");
            foreach ($categories as $cat_id) {
                $count = $wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->link2cat}, {$wpdb->links} WHERE {$wpdb->links}.link_id = {$wpdb->link2cat}.link_id AND category_id = '{$cat_id}'");
                $wpdb->query("UPDATE {$wpdb->categories} SET link_count = '{$count}' WHERE cat_ID = '{$cat_id}'");
            }
        }
    }
    if ($wp_current_db_version < 4772) {
        // Obsolete linkcategories table
        $wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'linkcategories');
    }
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:84,代码来源:upgrade-functions.php



注:本文中的populate_roles_210函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP populate_roles_230函数代码示例发布时间:2022-05-15
下一篇:
PHP populate_roles_160函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap