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


PHP update_option函数代码示例

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


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

示例1: _wprp_upgrade_plugin

/**
 * Update a plugin
 *
 * @access private
 * @param mixed $plugin
 * @return array
 */
function _wprp_upgrade_plugin($plugin)
{
    include_once ABSPATH . 'wp-admin/includes/admin.php';
    if (!_wprp_supports_plugin_upgrade()) {
        return array('status' => 'error', 'error' => 'WordPress version too old for plugin upgrades');
    }
    $skin = new WPRP_Plugin_Upgrader_Skin();
    $upgrader = new Plugin_Upgrader($skin);
    $is_active = is_plugin_active($plugin);
    // Do the upgrade
    ob_start();
    $result = $upgrader->upgrade($plugin);
    $data = ob_get_contents();
    ob_clean();
    if (!$result && !is_null($result) || $data) {
        return array('status' => 'error', 'error' => 'file_permissions_error');
    } elseif (is_wp_error($result)) {
        return array('status' => 'error', 'error' => $result->get_error_code());
    }
    if ($skin->error) {
        return array('status' => 'error', 'error' => $skin->error);
    }
    // If the plugin was activited, we have to re-activate it
    // @todo Shouldn't this use activate_plugin?
    if ($is_active) {
        $current = get_option('active_plugins', array());
        $current[] = plugin_basename(trim($plugin));
        sort($current);
        update_option('active_plugins', $current);
    }
    return array('status' => 'success');
}
开发者ID:redferriswheel,项目名称:ZachFonville,代码行数:39,代码来源:wprp.plugins.php

示例2: mytheme_add_admin

function mytheme_add_admin()
{
    global $themename, $shortname, $options;
    if ($_GET['page'] == basename(__FILE__)) {
        if ('save' == $_REQUEST['action']) {
            foreach ($options as $value) {
                if ($value['type'] != 'header') {
                    update_option($value['id'], $_REQUEST[$value['id']]);
                }
            }
            foreach ($options as $value) {
                if (isset($_REQUEST[$value['id']])) {
                    update_option($value['id'], $_REQUEST[$value['id']]);
                } else {
                    delete_option($value['id']);
                }
            }
            header("Location: themes.php?page=settings.php&saved=true");
            die;
        } else {
            if ('reset' == $_REQUEST['action']) {
                foreach ($options as $value) {
                    delete_option($value['id']);
                }
                header("Location: themes.php?page=settings.php&reset=true");
                die;
            }
        }
    }
    add_theme_page($themename . " Settings", "Theme Settings", 'edit_themes', basename(__FILE__), 'mytheme_admin');
}
开发者ID:erka,项目名称:wp-blog,代码行数:31,代码来源:settings.php

示例3: load

 public function load($parent)
 {
     $this->parent = $parent;
     //delete_option('redux-framework-tracking');
     $this->options = get_option('redux-framework-tracking');
     $this->options['dev_mode'] = $parent->args['dev_mode'];
     if (!isset($this->options['hash']) || !$this->options['hash'] || empty($this->options['hash'])) {
         $this->options['hash'] = md5(site_url() . '-' . $_SERVER['REMOTE_ADDR']);
         update_option('redux-framework-tracking', $this->options);
     }
     if (isset($_GET['redux_framework_disable_tracking']) && !empty($_GET['redux_framework_disable_tracking'])) {
         $this->options['allow_tracking'] = false;
         update_option('redux-framework-tracking', $this->options);
     }
     if (isset($_GET['redux_framework_enable_tracking']) && !empty($_GET['redux_framework_enable_tracking'])) {
         $this->options['allow_tracking'] = true;
         update_option('redux-framework-tracking', $this->options);
     }
     if (isset($_GET['page']) && $_GET['page'] == $this->parent->args['page_slug']) {
         if (!isset($this->options['allow_tracking'])) {
             add_action('admin_enqueue_scripts', array($this, '_enqueue_tracking'));
         } else {
             if (!isset($this->options['tour']) && ($this->parent->args['dev_mode'] == "true" || $this->parent->args['page_slug'] == "redux_demo")) {
                 add_action('admin_enqueue_scripts', array($this, '_enqueue_newsletter'));
             }
         }
     }
     if (isset($this->options['allow_tracking']) && $this->options['allow_tracking'] == true) {
         // The tracking checks daily, but only sends new data every 7 days.
         if (!wp_next_scheduled('redux_tracking')) {
             wp_schedule_event(time(), 'daily', 'redux_tracking');
         }
         add_action('redux_tracking', array($this, 'tracking'));
     }
 }
开发者ID:dreadfra,项目名称:superba,代码行数:35,代码来源:tracking.php

示例4: mashsb_install

/**
 * Install
 *
 * Runs on plugin install to populates the settings fields for those plugin
 * pages. After successful install, the user is redirected to the MASHSB Welcome
 * screen.
 *
 * @since 2.0
 * @global $wpdb
 * @global $mashsb_options
 * @global $wp_version
 * @return void
 */
function mashsb_install()
{
    global $wpdb, $mashsb_options, $wp_version;
    // Add Upgraded From Option
    $current_version = get_option('mashsb_version');
    if ($current_version) {
        update_option('mashsb_version_upgraded_from', $current_version);
    }
    // Update the current version
    update_option('mashsb_version', MASHSB_VERSION);
    // Add plugin installation date and variable for rating div
    add_option('mashsb_installDate', date('Y-m-d h:i:s'));
    add_option('mashsb_RatingDiv', 'no');
    if (!get_option('mashsb_update_notice')) {
        add_option('mashsb_update_notice', 'no');
    }
    /* Setup some default options
     * Store our initial social networks in separate option row.
     * For easier modification and to prevent some trouble
     */
    $networks = array('Facebook', 'Twitter', 'Subscribe');
    if (is_plugin_inactive('mashshare-networks/mashshare-networks.php')) {
        update_option('mashsb_networks', $networks);
    }
    // Bail if activating from network, or bulk
    if (is_network_admin() || isset($_GET['activate-multi'])) {
        return;
    }
    // Add the transient to redirect / not for multisites
    set_transient('_mashsb_activation_redirect', true, 30);
}
开发者ID:Nguyenkain,项目名称:Elearning,代码行数:44,代码来源:install.php

示例5: renova_setup

function renova_setup()
{
    //Feed links
    add_theme_support('automatic-feed-links');
    //Nav menu
    register_nav_menu('primary', __('Primary Menu', 'renovalang'));
    //Sidebar
    $args = array('name' => __('renova_side', 'renovalang'), 'id' => 'renova01', 'description' => '', 'class' => '', 'before_widget' => '<section id="%1$s"  class="blog-side-panel %2$s">', 'after_widget' => '</section>', 'before_title' => '<h2>', 'after_title' => '</h2>');
    register_sidebar($args);
    //Content width
    if (!isset($content_width)) {
        $content_width = 900;
    }
    //Initiate custom post types
    add_action('init', 'renova_post_types');
    add_action('init', 'renova_post_gallery');
    //Load the text domain
    load_theme_textdomain('renovalang', get_template_directory() . '/languages');
    //Post Thumbnails
    add_theme_support('post-thumbnails', array('portfolio_item', 'gallery_item', 'post'));
    //Post formats
    add_theme_support('post-formats', array('image', 'audio', 'link', 'quote', 'video'));
    set_post_thumbnail_size(300, 300, true);
    // Standard Size Thumbnails
    //Function to crop all thumbnails
    if (false === get_option("thumbnail_crop")) {
        add_option("thumbnail_crop", "1");
    } else {
        update_option("thumbnail_crop", "1");
    }
}
开发者ID:solsticehc,项目名称:citadel,代码行数:31,代码来源:functions.php

示例6: init

 public static function init()
 {
     if (!is_admin()) {
         return;
     }
     if (!isset($_FILES['podlove_import_tracking'])) {
         return;
     }
     set_time_limit(10 * MINUTE_IN_SECONDS);
     // allow xml+gz uploads
     add_filter('upload_mimes', function ($mimes) {
         return array_merge($mimes, array('xml' => 'application/xml', 'gz|gzip' => 'application/x-gzip'));
     });
     require_once ABSPATH . '/wp-admin/includes/file.php';
     $file = wp_handle_upload($_FILES['podlove_import_tracking'], array('test_form' => false));
     if ($file && (!isset($file['error']) || !$file['error'])) {
         update_option('podlove_import_tracking_file', $file['file']);
         if (!($file = get_option('podlove_import_tracking_file'))) {
             return;
         }
         $importer = new \Podlove\Modules\ImportExport\Import\TrackingImporter($file);
         $importer->import();
     } else {
         echo '<div class="error"><p>' . $file['error'] . '</p></div>';
     }
 }
开发者ID:johannes-mueller,项目名称:podlove-publisher,代码行数:26,代码来源:tracking_importer.php

示例7: wss_plugin_activation_action

 function wss_plugin_activation_action()
 {
     $defaults = array('twitter_username' => "", 'auto_add_post_types' => array('post'), 'social_options' => array('facebook', 'twitter', 'googleplus'), 'social_icon_position' => 'after', 'load_static' => array('load_css', 'load_js'), 'facebook_text' => "Share on Facebook", 'twitter_text' => "Share on Twitter", 'googleplus_text' => "Share on Google+", 'linkedin_text' => "Share on Linkedin", 'pinterest_text' => "Share on Pinterest", 'pinterest_image' => "", 'show_icons' => '0', 'before_button_text' => '', 'text_position' => 'left');
     update_option('wp_social_sharing', $defaults);
     update_option('wss_wp_social_sharing', 'f,t,g,l,p');
     update_option('wss_pluign_version ', SS_VERSION);
 }
开发者ID:bunnywong,项目名称:freshlinker,代码行数:7,代码来源:class-admin.php

示例8: InitClass

 static function InitClass()
 {
     wp_enqueue_style(WPFB . '-admin', WPFB_PLUGIN_URI . 'css/admin.css', array(), WPFB_VERSION, 'all');
     wp_register_script('jquery-deserialize', WPFB_PLUGIN_URI . 'bower_components/jquery-deserialize/dist/jquery.deserialize.min.js', array('jquery'), WPFB_VERSION);
     if (isset($_GET['page'])) {
         $page = $_GET['page'];
         if ($page == 'wpfilebase_files') {
             wp_enqueue_script('postbox');
             wp_enqueue_style('dashboard');
         } elseif ($page == 'wpfilebase' && isset($_GET['action']) && $_GET['action'] == 'sync') {
             do_action('wpfilebase_sync');
             wp_die("Filebase synced.");
         }
     }
     add_action('wp_dashboard_setup', array(__CLASS__, 'AdminDashboardSetup'));
     //wp_register_widget_control(WPFB_PLUGIN_NAME, "[DEPRECATED]".WPFB_PLUGIN_NAME .' '. __('File list','wp-filebase'), array(__CLASS__, 'WidgetFileListControl'), array('description' => __('DEPRECATED','wp-filebase')));
     add_action('admin_print_scripts', array('WPFB_AdminLite', 'AdminPrintScripts'));
     self::CheckChangedVer();
     if (basename($_SERVER['PHP_SELF']) === "plugins.php") {
         if (isset($_GET['wpfb-uninstall']) && current_user_can('edit_files')) {
             update_option('wpfb_uninstall', !empty($_GET['wpfb-uninstall']) && $_GET['wpfb-uninstall'] != "0");
         }
         if (get_option('wpfb_uninstall')) {
             function wpfb_uninstall_warning()
             {
                 echo "\n\t\t\t\t<div id='wpfb-warning' class='updated fade'><p><strong>" . __('WP-Filebase will be uninstalled completely when deactivating the Plugin! All settings and File/Category Info will be deleted. Actual files in the upload directory will not be removed.', 'wp-filebase') . ' <a href="' . add_query_arg('wpfb-uninstall', '0') . '">' . __('Cancel') . "</a></strong></p></div>\n\t\t\t\t";
             }
             add_action('admin_notices', 'wpfb_uninstall_warning');
         }
     }
 }
开发者ID:noxian,项目名称:WP-Filebase,代码行数:31,代码来源:AdminLite.php

示例9: optionsframework_option_name

/**
 * The theme option name is set as 'options-theme-customizer' here.
 * In your own project, you should use a different option name.
 * I'd recommend using the name of your theme.
 *
 * This option name will be used later when we set up the options
 * for the front end theme customizer.
 */
function optionsframework_option_name()
{
    $optionsframework_settings = get_option('optionsframework');
    // Edit 'options-theme-customizer' and set your own theme name instead
    $optionsframework_settings['id'] = 'options_theme_customizer';
    update_option('optionsframework', $optionsframework_settings);
}
开发者ID:brainverb,项目名称:options-framework-plugin,代码行数:15,代码来源:options.php

示例10: optionsframework_options

/**
 * Defines an array of options that will be used to generate the settings page and be saved in the database.
 * When creating the "id" fields, make sure to use all lowercase and no spaces.
 *  
 */
function optionsframework_options()
{
    $themename = function_exists('wp_get_theme') ? wp_get_theme() : get_current_theme();
    $themename = $themename['Name'];
    $shortname = "of";
    //Stylesheet Reader
    $alt_stylesheets = array("black" => "black", "brown" => "brown", "blue" => "blue", "green" => "green", "pink" => "pink", "purple" => "purple", "red" => "red", "yellow" => "yellow");
    // Test data
    $test_array = array("one" => "One", "two" => "Two", "three" => "Three", "four" => "Four", "five" => "Five");
    // Multicheck Array
    $multicheck_array = array("one" => "French Toast", "two" => "Pancake", "three" => "Omelette", "four" => "Crepe", "five" => "Waffle");
    // Multicheck Defaults
    $multicheck_defaults = array("one" => "1", "five" => "1");
    // Background Defaults
    $background_defaults = array('color' => '', 'image' => '', 'repeat' => 'repeat', 'position' => 'top center', 'attachment' => 'scroll');
    // Pull all the categories into an array
    $options_categories = array();
    $options_categories_obj = get_categories();
    foreach ($options_categories_obj as $category) {
        $options_categories[$category->cat_ID] = $category->cat_name;
    }
    // Pull all the pages into an array
    $options_pages = array();
    $options_pages_obj = get_pages('sort_column=post_parent,menu_order');
    $options_pages[''] = 'Select a page:';
    foreach ($options_pages_obj as $page) {
        $options_pages[$page->ID] = $page->post_title;
    }
    // If using image radio buttons, define a directory path
    $imagepath = get_stylesheet_directory_uri() . '/images/';
    $options = array(array("name" => "General Settings", "type" => "heading"), array("name" => "Custom Logo", "desc" => "Choose your own logo. Optimal Size: 215px Wide by 55px Height", "id" => "colorway_logo", "type" => "upload"), array("name" => "Custom Favicon", "desc" => "Specify a 16px x 16px image that will represent your website's favicon.", "id" => "colorway_favicon", "type" => "upload"), array("name" => "Tracking Code", "desc" => "Paste your Google Analytics (or other) tracking code here.", "id" => "colorway_analytics", "std" => "", "type" => "textarea"), array("name" => "Body Background Image", "desc" => "Select image to change your website background", "id" => "inkthemes_bodybg", "std" => "", "type" => "upload"), array("name" => "Home Top Feature", "type" => "heading"), array("name" => "Home Top Feature Image", "desc" => "Choose Image for your Home Top Feature. Optimal Size: 900px x 350px", "id" => "colorway_slideimage1", "type" => "upload"), array("name" => "Home Top Feature Heading", "desc" => "Enter the Heading for Home Top Feature", "id" => "colorway_slideheading1", "std" => "", "type" => "text"), array("name" => "Home Top Feature Heading Link", "desc" => "Enter the Link URL in Heading for Home Top Feature", "id" => "colorway_slidelink1", "std" => "", "type" => "text"), array("name" => "Home Top Feature Description", "desc" => "Description for Home Top Feature", "id" => "colorway_slidedescription1", "std" => "", "type" => "textarea"), array("name" => "Home Page Settings", "type" => "heading"), array("name" => "Home Page Intro", "desc" => "Enter your heading text for home page", "id" => "inkthemes_mainheading", "std" => "", "type" => "text"), array("name" => "First Feature Image", "desc" => "Choose image for your feature column first. Optimal size 198px x 115px", "id" => "inkthemes_fimg1", "std" => "", "type" => "upload"), array("name" => "First Feature Heading", "desc" => "Enter your heading line for first column", "id" => "inkthemes_headline1", "std" => "", "type" => "text"), array("name" => "First Feature Link", "desc" => "Enter your link for feature column first", "id" => "inkthemes_link1", "std" => "", "type" => "text"), array("name" => "First Feature Content", "desc" => "Enter your feature content for column first", "id" => "inkthemes_feature1", "std" => "", "type" => "textarea"), array("name" => "Second Feature Image", "desc" => "Choose image for your feature column second. Optimal size 198px x 115px", "id" => "inkthemes_fimg2", "std" => "", "type" => "upload"), array("name" => "Second Feature Heading", "desc" => "Enter your heading line for second column", "id" => "inkthemes_headline2", "std" => "", "type" => "text"), array("name" => "Second Feature Link", "desc" => "Enter your link for feature column second", "id" => "inkthemes_link2", "std" => "", "type" => "text"), array("name" => "Second Feature Content", "desc" => "Enter your feature content for column second", "id" => "inkthemes_feature2", "std" => "", "type" => "textarea"), array("name" => "Third Feature Image", "desc" => "Choose image for your feature column thrid. Optimal size 198px x 115px", "id" => "inkthemes_fimg3", "std" => "", "type" => "upload"), array("name" => "Third Feature Heading", "desc" => "Enter your heading line for third column", "id" => "inkthemes_headline3", "std" => "", "type" => "text"), array("name" => "Third Feature Link", "desc" => "Enter your link for feature column third", "id" => "inkthemes_link3", "std" => "", "type" => "text"), array("name" => "Third Feature Content", "desc" => "Enter your feature content for third column", "id" => "inkthemes_feature3", "std" => "", "type" => "textarea"), array("name" => "Fourth Feature Image", "desc" => "Choose image for your feature column fourth. Optimal size 198px x 115px", "id" => "inkthemes_fimg4", "std" => "", "type" => "upload"), array("name" => "Fourth Feature Heading", "desc" => "Enter your heading line for fourth column", "id" => "inkthemes_headline4", "std" => "", "type" => "text"), array("name" => "Fourth Feature link", "desc" => "Enter your link for feature column fourth", "id" => "inkthemes_link4", "std" => "", "type" => "text"), array("name" => "Fourth Feature Content", "desc" => "Enter your feature content for fourth column", "id" => "inkthemes_feature4", "std" => "", "type" => "textarea"), array("name" => "Home Page Testimonial", "desc" => "Enter your text for homepage testimonial in short paragraph.", "id" => "inkthemes_testimonial", "std" => "", "type" => "textarea"), $options[] = array("name" => "Styling Options", "type" => "heading"), array("name" => "Custom CSS", "desc" => "Quickly add some CSS to your theme by adding it to this block.", "id" => "inkthemes_customcss", "std" => "", "type" => "textarea"), array("name" => "Footer Settings", "type" => "heading"), array("name" => "Facebook URL", "desc" => "Enter your Facebook URL if you have one", "id" => "colorway_facebook", "std" => "", "type" => "text"), array("name" => "Twitter URL", "desc" => "Enter your Twitter URL if you have one", "id" => "colorway_twitter", "std" => "", "type" => "text"), array("name" => "RSS Feed URL", "desc" => "Enter your RSS Feed URL if you have one", "id" => "colorway_rss", "std" => "", "type" => "text"), array("name" => "Linked In URL", "desc" => "Enter your Linkedin URL if you have one", "id" => "colorway_linkedin", "std" => "", "type" => "text"), array("name" => "Stumble Upon URL", "desc" => "Enter your Stumble Upon URL if you have one", "id" => "colorway_stumble", "std" => "", "type" => "text"), array("name" => "Digg URL", "desc" => "Enter your Stumble Upon URL if you have one", "id" => "colorway_digg", "std" => "", "type" => "text"));
    update_option('of_themename', $themename);
    return $options;
}
开发者ID:bettinasir88,项目名称:feriaeldesvan,代码行数:39,代码来源:theme-options.php

示例11: twitterWidgetAdmin

function twitterWidgetAdmin()
{
    $settings = get_option('widget_twitterwidget');
    if (!is_array($settings)) {
        $settings = array('account' => 'silesia', 'title' => __('Twitter Updates', 'silesia'), 'show' => '3');
    }
    // form posted?
    if (isset($_POST['Twitter-submit'])) {
        // Remember to sanitize and format use input appropriately.
        $settings['account'] = strip_tags(stripslashes($_POST['Twitter-account']));
        $settings['title'] = strip_tags(stripslashes($_POST['Twitter-title']));
        $settings['show'] = strip_tags(stripslashes($_POST['Twitter-show']));
        update_option('widget_twitterwidget', $settings);
    }
    // Get options for form fields to show
    $account = htmlspecialchars($settings['account'], ENT_QUOTES);
    $title = htmlspecialchars($settings['title'], ENT_QUOTES);
    $show = htmlspecialchars($settings['show'], ENT_QUOTES);
    // The form fields
    echo '<p>
				<label for="Twitter-account">' . __('Account:', 'silesia') . '
				<input style="width: 200px;" id="Twitter-account" name="Twitter-account" type="text" value="' . $account . '" />
				</label></p>';
    echo '<p>
				<label for="Twitter-title">' . __('Title:', 'silesia') . '
				<input style="width: 200px;" id="Twitter-title" name="Twitter-title" type="text" value="' . $title . '" />
				</label></p>';
    echo '<p>
				<label for="Twitter-show">' . __('Show:', 'silesia') . '
				<input style="width: 200px;" id="Twitter-show" name="Twitter-show" type="text" value="' . $show . '" />
				</label></p>';
    echo '<input type="hidden" id="Twitter-submit" name="Twitter-submit" value="1" />';
}
开发者ID:vinayshuklasourcefuse,项目名称:sareez,代码行数:33,代码来源:twitter.php

示例12: speedymarket_tables

function speedymarket_tables()
{
    //Get the table name with the WP database prefix
    global $wpdb;
    $speedymarket_table_version = "1.0";
    $installed_ver = get_option("speedymarket_table_version");
    //Check if the table already exists and if the table is up to date, if not create it
    if ($wpdb->get_var("SHOW TABLES LIKE '{$wpc_cat_table}'") != $wpc_cat_table || $installed_ver != $speedymarket_table_version) {
        $sql = "CREATE TABLE `tb_article` (\r\n  `id_article` int(11) NOT NULL,\r\n  `a_designation` varchar(100) NOT NULL,\r\n  `a_pht` float(6,2) DEFAULT NULL,\r\n  `a_description` text,\r\n  `a_quantite_stock` int(11) DEFAULT NULL,\r\n  `a_visible` tinyint(1) NOT NULL,\r\n  `id_categorie` int(11) DEFAULT NULL,\r\n  `url_image` varchar(200) DEFAULT NULL,\r\n  `id_tva` int(11) DEFAULT NULL\r\n   UNIQUE KEY id_article (id)\r\n            )";
        $sql1 = "CREATE TABLE `tb_categorie` (\r\n`id_categorie` int(11) NOT NULL,\r\n  `c_libelle` varchar(100) NOT NULL,\r\n  `id_categorie_mere` int(11) DEFAULT NULL,\r\n  `url_image` varchar(200) DEFAULT NULL\r\n  )";
        $sql2 = "CREATE TABLE `tb_client` (\r\n  `id_personne` int(11) NOT NULL,\r\n  UNIQUE KEY id_personne()\r\n)";
        $sql3 = "CREATE TABLE `tb_commande` (\r\n`id_commande` int(11) NOT NULL,\r\n  `c_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\r\n  `c_dateretrait` date DEFAULT NULL,\r\n  `id_statut` int(11) DEFAULT NULL,\r\n  `client_id_pers` int(11) DEFAULT NULL,\r\n  `prepa_id_pers` int(11) DEFAULT NULL\r\n)";
        $sql4 = "CREATE TABLE `tb_image` (\r\n  `url_image` varchar(200) NOT NULL,\r\n  `i_nom` varchar(100) NOT NULL,\r\n  `i_libelle` varchar(100) DEFAULT NULL\r\n)";
        $sql5 = "CREATE TABLE IF NOT EXISTS `tb_ligne_commande` (\r\n  `id_article` int(11) NOT NULL,\r\n  `id_commande` int(11) NOT NULL,\r\n  `qte_cmde` int(11) NOT NULL\r\n)";
        $sql6 = "CREATE TABLE IF NOT EXISTS `tb_personne` (\r\n`id_personne` int(11) NOT NULL,\r\n  `p_nom` varchar(100) NOT NULL,\r\n  `p_prenom` varchar(100) NOT NULL,\r\n  `p_arue` varchar(100) DEFAULT NULL,\r\n  `p_aville` varchar(100) NOT NULL,\r\n  `p_acp` int(11) NOT NULL,\r\n  `p_tel` int(11) DEFAULT NULL,\r\n  `p_mail` varchar(100) NOT NULL,\r\n  `p_mdp` varchar(128) NOT NULL\r\n)";
        $sql7 = "CREATE TABLE IF NOT EXISTS `tb_preparateur` (\r\n  `id_personne` int(11) NOT NULL\r\n)";
        $sql8 = "CREATE TABLE IF NOT EXISTS `tb_statut` (\r\n`id_statut` int(11) NOT NULL,\r\n  `s_libelle` varchar(50) NOT NULL\r\n)";
        $sql9 = "CREATE TABLE IF NOT EXISTS `tb_tva` (\r\n`id_tva` int(11) NOT NULL,\r\n  `t_libelle` varchar(100) NOT NULL,\r\n  `t_taux` float(4,3) NOT NULL\r\n)";
        require_once ABSPATH . 'wp-admin/includes/upgrade.php';
        dbDelta($sql);
        update_option("speedymarket_table_version", $speedymarket_table_version);
    }
    //Add database table versions to options
    add_option("wpc_cat_table_version", $speedymarket_table_version);
}
开发者ID:sebastienlafon,项目名称:wordpresspc,代码行数:25,代码来源:db-settings.php

示例13: set_theme_option

 /**
  * Sets option defaults
  *
  * @since 1.7.0
  */
 function set_theme_option()
 {
     // Load settings
     $optionsframework_settings = get_option('optionsframework');
     // Updates the unique option id in the database if it has changed
     if (function_exists('optionsframework_option_name')) {
         optionsframework_option_name();
     } elseif (has_action('optionsframework_option_name')) {
         do_action('optionsframework_option_name');
     } else {
         $default_themename = get_option('stylesheet');
         $default_themename = preg_replace("/\\W/", "_", strtolower($default_themename));
         $default_themename = 'optionsframework_' . $default_themename;
         if (isset($optionsframework_settings['id'])) {
             if ($optionsframework_settings['id'] == $default_themename) {
                 // All good, using default theme id
             } else {
                 $optionsframework_settings['id'] = $default_themename;
                 update_option('optionsframework', $optionsframework_settings);
             }
         } else {
             $optionsframework_settings['id'] = $default_themename;
             update_option('optionsframework', $optionsframework_settings);
         }
     }
 }
开发者ID:onenonlycasper,项目名称:infinitum,代码行数:31,代码来源:class-options-framework.php

示例14: sendContact

 public function sendContact()
 {
     $res = new responseGmp();
     $time = time();
     $prevSendTime = (int) get_option(GMP_CODE . '_last__time_contact_send');
     if ($prevSendTime && $time - $prevSendTime < 5 * 60) {
         // Only one message per five minutes
         $res->pushError(__('Please don\'t send contact requests so often - wait for response for your previous requests.'));
         $res->ajaxExec();
     }
     $data = reqGmp::get('post');
     $fields = $this->getModule()->getContactFormFields();
     foreach ($fields as $fName => $fData) {
         $validate = isset($fData['validate']) ? $fData['validate'] : false;
         $data[$fName] = isset($data[$fName]) ? trim($data[$fName]) : '';
         if ($validate) {
             $error = '';
             foreach ($validate as $v) {
                 if (!empty($error)) {
                     break;
                 }
                 switch ($v) {
                     case 'notEmpty':
                         if (empty($data[$fName])) {
                             $error = $fData['html'] == 'selectbox' ? __('Please select %s', GMP_LANG_CODE) : __('Please enter %s', GMP_LANG_CODE);
                             $error = sprintf($error, $fData['label']);
                         }
                         break;
                     case 'email':
                         if (!is_email($data[$fName])) {
                             $error = __('Please enter valid email address', GMP_LANG_CODE);
                         }
                         break;
                 }
                 if (!empty($error)) {
                     $res->pushError($error, $fName);
                 }
             }
         }
     }
     if (!$res->error()) {
         $msg = 'Message from: ' . get_bloginfo('name') . ', Host: ' . $_SERVER['HTTP_HOST'] . '<br />';
         $msg .= 'Plugin: ' . GMP_WP_PLUGIN_NAME . '<br />';
         foreach ($fields as $fName => $fData) {
             if (in_array($fName, array('name', 'email', 'subject'))) {
                 continue;
             }
             if ($fName == 'category') {
                 $data[$fName] = $fData['options'][$data[$fName]];
             }
             $msg .= '<b>' . $fData['label'] . '</b>: ' . nl2br($data[$fName]) . '<br />';
         }
         if (frameGmp::_()->getModule('mail')->send('support@supsystic.team.zendesk.com', $data['subject'], $msg, $data['name'], $data['email'])) {
             update_option(GMP_CODE . '_last__time_contact_send', $time);
         } else {
             $res->pushError(frameGmp::_()->getModule('mail')->getMailErrors());
         }
     }
     $res->ajaxExec();
 }
开发者ID:Vibeosys,项目名称:VibeosysWeb,代码行数:60,代码来源:controller.php

示例15: mystique_setup_options

function mystique_setup_options()
{
    mystique_remove_options();
    $default_settings = mystique_default_settings();
    update_option('mystique', $default_settings);
    do_action('mystique_setup_options');
}
开发者ID:nottombrown,项目名称:vlab,代码行数:7,代码来源:settings.php


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