当前位置: 首页>>代码示例>>PHP>>正文


PHP wp_cache_postload函数代码示例

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


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

示例1: ssr_plugin_install

function ssr_plugin_install()
{
    global $wpdb;
    $table_name = $wpdb->prefix . 'ssr_studentinfo';
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") != $table_name) {
        $charset_collate = $wpdb->get_charset_collate();
        $sql = "CREATE TABLE {$table_name} (\r\n\t\t\trid varchar(100) NOT NULL,\r\n\t\t\troll text NULL,\r\n\t\t\tstdname text NULL,\r\n\t\t\tfathersname text NULL,\r\n\t\t\tpyear text NULL,\r\n\t\t\tcgpa text NULL,\r\n\t\t\tsubject text NULL,\r\n\t\t\timage text NULL,\r\n\t\t\tdob text NULL,\r\n\t\t\tgender text NULL,\r\n\t\t\taddress text NULL,\r\n\t\t\tmnam text NULL,\r\n\t\t\tc1 text NULL,\r\n\t\t\tc2 text NULL,\r\n\t\t\tUNIQUE KEY id (rid)\r\n) {$charset_collate};";
        require_once ABSPATH . 'wp-admin/includes/upgrade.php';
        dbDelta($sql);
        add_option('jal_db_version', $jal_db_version);
        if (WP_CACHE && function_exists('wp_cache_postload')) {
            wp_cache_postload();
        }
        wp_functionality_constants();
        $wp_the_query = new WP_Query();
        $wp_query =& $wp_the_query;
        $GLOBALS['wp_rewrite'] = new WP_Rewrite();
        $i = 1;
        while ($i <= 3) {
            $my_post = array('post_type' => 'ssr_subjects', 'post_title' => 'Subject ' . $i . '', 'post_content' => 'This is Subject ' . $i . '', 'post_status' => 'publish', 'post_author' => 1);
            wp_insert_post($my_post);
            $i++;
        }
        $i = 1;
        $cgpa = 2.5;
        number_format($cgpa, 2);
        while ($cgpa <= 5.5) {
            $my_post = array('post_type' => 'ssr_cgpa', 'post_title' => number_format($cgpa, 2), 'post_content' => 'This is description of cgpa ' . number_format($cgpa, 2) . '', 'post_status' => 'publish', 'post_author' => 1);
            wp_insert_post($my_post);
            $i++;
            $cgpa = $cgpa + 0.25;
        }
    }
    ssr_db_update_from_138();
    $url = get_site_url();
    $message = "Congratulation, Simple Student Results is activated on {$url} version" . SSR_VERSION;
    $message = wordwrap($message, 70, "\r\n");
    wp_mail('saadvi@gmail.com', 'SSR activated url : ' . $url . ' version: ' . SSR_VERSION, $message);
    do_action('plugins_loaded');
}
开发者ID:razilsalam,项目名称:simple-student-result,代码行数:40,代码来源:activation.php

示例2: create_initial_post_types

create_initial_post_types();
// Register the default theme directory root
register_theme_directory(get_theme_root());
// Load active plugins.
foreach (wp_get_active_and_valid_plugins() as $plugin) {
    include_once $plugin;
}
unset($plugin);
// Load pluggable functions.
require ABSPATH . WPINC . '/pluggable.php';
require ABSPATH . WPINC . '/pluggable-deprecated.php';
// Set internal encoding.
wp_set_internal_encoding();
// Run wp_cache_postload() if object cache is enabled and the function exists.
if (WP_CACHE && function_exists('wp_cache_postload')) {
    wp_cache_postload();
}
do_action('plugins_loaded');
// Define constants which affect functionality if not already defined.
wp_functionality_constants();
// Add magic quotes and set up $_REQUEST ( $_GET + $_POST )
wp_magic_quotes();
do_action('sanitize_comment_cookies');
/**
 * WordPress Query object
 * @global object $wp_the_query
 * @since 2.0.0
 */
$wp_the_query = new WP_Query();
/**
 * Holds the reference to @see $wp_the_query
开发者ID:openify,项目名称:wordpress-composer,代码行数:31,代码来源:wp-settings.php


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