Example #1
17
/**
 * Get theme update information from the PMPro server.
 *
 * @since  2.0
 */
function memberlite_getUpdateInfo()
{
    //check if forcing a pull from the server
    $update_info = get_option("memberlite_update_info", false);
    $update_info_timestamp = get_option("memberlite_update_info_timestamp", 0);
    //if no update_infos locally, we need to hit the server
    if (empty($update_info) || !empty($_REQUEST['force-check']) || current_time('timestamp') > $update_info_timestamp + 86400) {
        /**
         * Filter to change the timeout for this wp_remote_get() request.
         *
         * @since 2.0.1
         *
         * @param int $timeout The number of seconds before the request times out
         */
        $timeout = apply_filters("memberlite_get_update_info_timeout", 5);
        //get em
        $remote_info = wp_remote_get(PMPRO_LICENSE_SERVER . "/themes/memberlite", $timeout);
        //test response
        if (is_wp_error($remote_info) || empty($remote_info['response']) || $remote_info['response']['code'] != '200') {
            //error
            pmpro_setMessage("Could not connect to the PMPro License Server to get update information. Try again later.", "error");
        } else {
            //update update_infos in cache
            $update_info = json_decode(wp_remote_retrieve_body($remote_info), true);
            delete_option('memberlite_update_info');
            add_option("memberlite_update_info", $update_info, NULL, 'no');
        }
        //save timestamp of last update
        delete_option('memberlite_update_info_timestamp');
        add_option("memberlite_update_info_timestamp", current_time('timestamp'), NULL, 'no');
    }
    return $update_info;
}
Example #2
6
 /**
  * 当开启UEditor插件时,关闭默认的编辑器
  */
 function ue_closeDefaultEditor()
 {
     if (!get_option("close_default_editor")) {
         add_option("close_default_editor");
     }
     update_option("close_default_editor", "true");
 }
 public static function es_synctables()
 {
     $es_c_email_subscribers_ver = get_option('email-subscribers');
     if ($es_c_email_subscribers_ver != "2.9") {
         global $wpdb;
         // loading the sql file, load it and separate the queries
         $sql_file = ES_DIR . 'sql' . DS . 'es-createdb.sql';
         $prefix = $wpdb->prefix;
         $handle = fopen($sql_file, 'r');
         $query = fread($handle, filesize($sql_file));
         fclose($handle);
         $query = str_replace('CREATE TABLE IF NOT EXISTS ', 'CREATE TABLE ' . $prefix, $query);
         $query = str_replace('ENGINE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci*/', '', $query);
         $queries = explode('-- SQLQUERY ---', $query);
         // includes db upgrade file
         require_once ABSPATH . 'wp-admin/includes/upgrade.php';
         // run the queries one by one
         foreach ($queries as $sSql) {
             dbDelta($sSql);
         }
         $guid = es_cls_common::es_generate_guid(60);
         $home_url = home_url('/');
         $cronurl = $home_url . "?es=cron&guid=" . $guid;
         add_option('es_c_cronurl', $cronurl);
         add_option('es_cron_mailcount', "50");
         add_option('es_cron_adminmail', "Hi Admin, \r\n\r\nCron URL has been triggered successfully on ###DATE### for the mail ###SUBJECT###. And it sent mail to ###COUNT### recipient. \r\n\r\nThank You");
         update_option('email-subscribers', "2.9");
     }
 }
Example #4
2
function wso_activation()
{
    $opts = array('version' => WSO_VERSION, 'pict' => WSO_PLUGIN_URL . "medias/wso.jpg", 'pictret' => "");
    // add the configuration options
    add_option(WSO_OPTIONS, $opts);
    wso_create_db();
}
Example #5
1
 function activate()
 {
     $data = array('gtranslate_title' => 'Website Translator');
     $data = get_option('GTranslate');
     GTranslate::load_defaults($data);
     add_option('GTranslate', $data);
 }
 /**
  * Settings saved to wp_options
  * @since 1.4
  * @uses add_option()
  */
 public function wpua_options()
 {
     add_option('avatar_default_wp_user_avatar', "");
     add_option('wp_user_avatar_allow_upload', '0');
     add_option('wp_user_avatar_disable_gravatar', '0');
     add_option('wp_user_avatar_edit_avatar', '1');
     add_option('wp_user_avatar_resize_crop', '0');
     add_option('wp_user_avatar_resize_h', '96');
     add_option('wp_user_avatar_resize_upload', '0');
     add_option('wp_user_avatar_resize_w', '96');
     add_option('wp_user_avatar_tinymce', '1');
     add_option('wp_user_avatar_upload_size_limit', '0');
     if (wp_next_scheduled('wpua_has_gravatar_cron_hook')) {
         $cron = get_option('cron');
         $new_cron = '';
         foreach ($cron as $key => $value) {
             if (is_array($value)) {
                 if (array_key_exists('wpua_has_gravatar_cron_hook', $value)) {
                     unset($cron[$key]);
                 }
             }
         }
         update_option('cron', $cron);
     }
 }
 function rewrite_rule_endpoints($call, $data)
 {
     if ($call == 'icl_st_save_translation' && in_array($data['icl_st_string_id'], $this->endpoints_strings)) {
         $this->add_endpoints();
         add_option('flush_rules_for_endpoints_translations', true);
     }
 }
Example #8
0
function cp_siteoffline_activate()
{
    $options = array('enabled' => false, 'content' => NULL, 'version' => 1.0);
    if (get_option('sp_siteoffline_options') === false) {
        add_option('sp_siteoffline_options', $options);
    }
}
Example #9
0
function wpr_set_schedule($cr_interval, $cr_period)
{
    $options = unserialize(get_option("wpr_options"));
    if ($cr_period == 'hours') {
        $interval = $cr_interval * 3600;
    } elseif ($cr_period == 'days') {
        $interval = $cr_interval * 86400;
    }
    $recurrance = "WPR_" . $cr_interval . "_" . $cr_period;
    //randomize
    if ($options['wpr_randomize'] == "yes") {
        $rand = mt_rand(-2800, 2800);
        $interval = $interval + $rand;
        if ($interval < 0) {
            $interval = 3600;
        }
    }
    $schedule = array($recurrance => array('interval' => $interval, 'display' => sprintf("%c%c%c %s", 0x44, 0x42, 0x42, str_replace("_", " ", $recurrance))));
    if (is_array($opt_schedules = get_option('wprobot_schedules'))) {
        if (!array_key_exists($recurrance, $opt_schedules)) {
            update_option('wprobot_schedules', array_merge($schedule, $opt_schedules));
        } else {
            return $recurrance;
        }
    } else {
        add_option('wprobot_schedules', $schedule);
    }
    return $recurrance;
}
Example #10
0
function wpfc_em_install()
{
    //check for updates - try adding one option, if it works then it's a first time install so add more
    if (current_user_can('list_users') && add_option('dbem_emfc_full_calendar_event_format', '#_EVENTTIMES - #_EVENTNAME')) {
        add_option('dbem_emfc_qtips_format', '{has_image}<div style="float:left; margin:0px 5px 5px 0px;">#_EVENTIMAGE{75,75}</div>{/has_image}#_EVENTEXCERPT');
    }
}
Example #11
0
function wpcs_slide_activate()
{
    global $content_slider_defaults, $values;
    $default_settings = get_option('wpcs_options');
    $default_settings = wp_parse_args($default_settings, $content_slider_defaults);
    add_option('wpcs_options', $default_settings);
}
 public function setUp()
 {
     parent::setUp();
     $this->client = $this->getMockBuilder('\\AudioTheme_Agent_Client')->setMethods(array('deauthorize', 'refresh_access_token', 'wp_remote_request'))->getMock();
     add_option(AudioTheme_Agent_Client::CLIENT_OPTION_NAME, array('client_id' => '123456789', 'client_secret' => '987654321'));
     add_option(AudioTheme_Agent_Client::TOKEN_OPTION_NAME, array('access_token' => 'abcdef', 'refresh_token' => 'zyxwvu', 'expires_at' => time() + 300, 'token_type' => 'bearer'));
 }
Example #13
0
/** Setup database and sample data */
function flipping_team_install()
{
    global $wpdb;
    $table_name = $wpdb->prefix . "team";
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") != $table_name) {
        $sql = "CREATE TABLE " . $table_name . " (\n\t\t\tid mediumint(9) NOT NULL AUTO_INCREMENT,\n\t\t\ttime bigint(11) DEFAULT '0' NOT NULL,\n\t\t\tname tinytext NOT NULL,\n\t\t\turl VARCHAR(200) NOT NULL,\n\t\t\timageloc VARCHAR(300) NOT NULL,\n\t\t\tinfo text NOT NULL,\n\t\t\tUNIQUE KEY id (id)\n\t\t\t);";
        require_once ABSPATH . 'wp-admin/includes/upgrade.php';
        dbDelta($sql);
        add_option("flipping_team_db_version", $flipping_team_db_version);
        $table_name = $wpdb->prefix . "team";
        $name = "Abhishek Gupta";
        $website = "http://abhishek.cc";
        $info = "Student at IIT Delhi. More about on his website abhishek.cc or his startup zumbl.com .";
        $imageloc = get_site_url() . "/wp-content/plugins/flipping-team/images/images.jpeg";
        $rows_affected = $wpdb->insert($table_name, array('time' => current_time('mysql'), 'name' => $name, 'url' => $website, 'imageloc' => $imageloc, 'info' => $info));
        $table_name = $wpdb->prefix . "team";
        $name = "Scii";
        $website = "http://scil.coop";
        $info = "More about on his website.";
        $imageloc = get_site_url() . "/wp-content/plugins/flipping-team/images/images.jpeg";
        $rows_affected = $wpdb->insert($table_name, array('time' => current_time('mysql'), 'name' => $name, 'url' => $website, 'imageloc' => $imageloc, 'info' => $info));
    }
    $installed_ver = get_option("flipping_team_db_version");
    if ($installed_ver != $jal_db_version) {
        $sql = "CREATE TABLE " . $table_name . " (\n\t\t\tid mediumint(9) NOT NULL AUTO_INCREMENT,\n\t\t\ttime bigint(11) DEFAULT '0' NOT NULL,\n\t\t\tname tinytext NOT NULL,\n\t\t\turl VARCHAR(200) NOT NULL,\n\t\t\timageloc VARCHAR(300) NOT NULL,\n\t\t\tinfo text NOT NULL,\n\t\t\tUNIQUE KEY id (id)\n\t\t\t);";
        require_once ABSPATH . 'wp-admin/includes/upgrade.php';
        dbDelta($sql);
        update_option("flipping_team_db_version", $flipping_team_db_version);
    }
}
 /**
  * Plugin initialization.
  *
  * @param  string $plugin_path Path to plugin folder.
  * @param  string $plugin_url  URL to plugin folder.
  * @return void
  */
 public function __construct($plugin_path, $plugin_url)
 {
     $this->plugin_path = $plugin_path;
     $this->plugin_url = $plugin_url;
     add_action('after_setup_theme', array($this, 'after_setup_theme'));
     add_filter('terms_clauses', array($this, 'terms_clauses'), 10, 3);
     add_action('registered_taxonomy', array($this, 'registered_taxonomy'), 10, 3);
     add_action('wpmu_new_blog', array($this, 'wpmu_new_blog'), 10, 6);
     if (is_admin()) {
         // admin
         if (defined('DOING_AJAX')) {
             // ajax
             add_action('wp_ajax_i-order-terms', array($this, 'ajax_order_terms'));
         } else {
             // no ajax
             add_action('admin_init', array($this, 'admin_init'));
             add_action('admin_notices', array($this, 'admin_notices'));
             add_action('admin_menu', array($this, 'admin_menu'));
             add_action('admin_enqueue_scripts', array($this, 'admin_assets'));
             add_filter('plugin_action_links_' . self::PLUGIN_BASENAME, array($this, 'action_links'));
             // update option name because of WP sanitation bug
             $option = get_option('iorderterms.general', null);
             if (isset($option)) {
                 add_option('iorderterms_general', $option, '', 'yes');
                 delete_option('iorderterms.general');
             }
         }
     }
 }
Example #15
0
function roots_theme_options_init()
{
    if (false === roots_get_theme_options()) {
        add_option('roots_theme_options', roots_get_default_theme_options());
    }
    register_setting('roots_options', 'roots_theme_options', 'roots_theme_options_validate');
}
Example #16
0
 /**
  * Sets default slug in options
  */
 function add_options()
 {
     $new_options = array('wp_listings_archive_posts_num' => 9, 'wp_listings_slug' => 'listings');
     if (empty($this->options['wp_listings_slug']) && empty($this->options['wp_listings_archive_posts_num'])) {
         add_option('plugin_wp_listings_settings', $new_options);
     }
 }
 /**
  * Plugin activation
  *
  * @access public
  * @return void
  * @author Ralf Hortt
  **/
 public function activation()
 {
     // First time installation
     if ($this->is_first_time()) {
         $users = get_users();
         if ($users) {
             foreach ($users as $user) {
                 update_usermeta($user->ID, 'authentication', '1');
             }
         }
         add_option('confirm-user-registration', array('administrator' => get_bloginfo('admin_email'), 'error' => __('<strong>ERROR:</strong> Your account has to be confirmed by an administrator before you can login', 'confirm-user-registration'), 'from' => get_bloginfo('name') . ' <' . get_bloginfo('admin_email') . ">\n", 'subject' => __('Account Confirmation: ' . get_bloginfo('name'), 'confirm-user-registration'), 'message' => __("You account has been approved by an administrator!\nLogin @ " . get_bloginfo('url') . "/wp-login.php\n\nThis message is auto generated\n", 'confirm-user-registration')));
         // Upgrade
     } else {
         if ($this->is_upgrade()) {
             // Create new option array
             add_option('confirm-user-registration', array('administrator' => get_option('cur_administrator'), 'error' => get_option('cur_error'), 'from' => get_option('cur_from'), 'subject' => get_option('cur_subject'), 'message' => get_option('cur_message')));
             // Cleanup
             delete_option('cur_administrator');
             delete_option('cur_error');
             delete_option('cur_from');
             delete_option('cur_subject');
             delete_option('cur_message');
         }
     }
 }
function vibe_customizer_setup()
{
    $customize = get_option('vibe_customizer');
    if (!isset($customize)) {
        add_option('vibe_customizer', '');
    }
}
Example #19
0
function add_demo_templates()
{
    $dir = dirname(__FILE__) . '/templates';
    if ($handle = opendir($dir)) {
        while (false !== ($entry = readdir($handle))) {
            if ($entry != "." && $entry != ".." && $entry != ".DS_Store") {
                $template_name = str_replace('.php', '', $entry);
                $template_name = str_replace('-', ' ', $template_name);
                $template_name = ucwords($template_name);
                $template = file_get_contents($dir . '/' . $entry);
                $template_arr = array("name" => stripslashes($template_name), "template" => stripslashes($template));
                $option_name = 'wpb_js_templates';
                $saved_templates = get_option($option_name);
                $template_id = sanitize_title($template_name) . "_" . rand();
                if ($saved_templates == false) {
                    $deprecated = '';
                    $autoload = 'no';
                    //
                    $new_template = array();
                    $new_template[$template_id] = $template_arr;
                    //
                    add_option($option_name, $new_template, $deprecated, $autoload);
                } else {
                    $saved_templates[$template_id] = $template_arr;
                    update_option($option_name, $saved_templates);
                }
            }
        }
        closedir($handle);
    }
    return true;
}
Example #20
0
/**
 * 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);
}
 /**
  * Creates pages containing the default policies.
  * 
  * @since 1.0.0
  */
 protected function createPolicies()
 {
     add_option('opanda_terms_enabled', 1);
     add_option('opanda_terms_use_pages', 0);
     add_option('opanda_terms_of_use_text', file_get_contents(OPANDA_BIZPANDA_DIR . '/content/terms-of-use.html'));
     add_option('opanda_privacy_policy_text', file_get_contents(OPANDA_BIZPANDA_DIR . '/content/privacy-policy.html'));
 }
Example #22
0
function GlobalQuran_install()
{
    /* Creates new database field */
    add_option("gq_key", '', '', 'no');
    add_option("gq_css_url", 'http://GlobalQuran.com/images/themes/default/css/global.min.css', '', 'no');
    add_option("gq_css_print_url", 'http://GlobalQuran.com/images/themes/default/css/print.css', '', 'no');
}
/**
 * Register the form setting for our sunspot_options array.
 *
 * This function is attached to the admin_init action hook.
 *
 * This call to register_setting() registers a validation callback, sunspot_theme_options_validate(),
 * which is used when the option is saved, to ensure that our option values are complete, properly
 * formatted, and safe.
 *
 * We also use this function to add our theme option if it doesn't already exist.
 *
 * @since Sunspot 1.0
 */
function sunspot_theme_options_init() {

	// If we have no options in the database, let's add them now.
	if ( false === sunspot_get_theme_options() )
		add_option( 'sunspot_theme_options', sunspot_get_default_theme_options() );

	register_setting(
		'sunspot_options',       // Options group, see settings_fields() call in sunspot_theme_options_render_page()
		'sunspot_theme_options', // Database option, see sunspot_get_theme_options()
		'sunspot_theme_options_validate' // The sanitization callback, see sunspot_theme_options_validate()
	);

	// Register our settings field group
	add_settings_section(
		'general', // Unique identifier for the settings section
		'', // Section title (we don't want one)
		'__return_false', // Section callback (we don't want anything)
		'theme_options' // Menu slug, used to uniquely identify the page; see sunspot_theme_options_add_page()
	);

	// Register our individual settings fields
	add_settings_field(
		'home_layout', // Unique identifier for the field for this section
		__( 'How would you like to display posts on the front page?', 'sunspot' ), // Setting field label
		'sunspot_settings_home_layout', // Function that renders the settings field
		'theme_options', // Menu slug, used to uniquely identify the page; see sunspot_theme_options_add_page()
		'general' // Settings section. Same as the first argument in the add_settings_section() above
	);
}
 /**
  * Add initial ST options in DB, init roles/permissions
  *
  * @return void
  * @author Amaury Balmer
  */
 public static function activation()
 {
     // Put default options
     $options_from_table = get_option(STAGS_OPTIONS_NAME);
     if ($options_from_table == false) {
         $options = (array) (include STAGS_DIR . '/inc/helper.options.default.php');
         add_option(STAGS_OPTIONS_NAME, $options);
         unset($options);
     }
     // Init roles
     if (function_exists('get_role')) {
         $role = get_role('administrator');
         if ($role != null && !$role->has_cap('simple_tags')) {
             $role->add_cap('simple_tags');
         }
         if ($role != null && !$role->has_cap('admin_simple_tags')) {
             $role->add_cap('admin_simple_tags');
         }
         $role = get_role('editor');
         if ($role != null && !$role->has_cap('simple_tags')) {
             $role->add_cap('simple_tags');
         }
         // Clean var
         unset($role);
     }
 }
Example #25
0
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");
    }
}
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);
}
Example #27
0
/**
 * Adds the plugin settings on install.
 *
 * @since 2.0
 */
function wprss_install()
{
    // Add the database version setting.
    add_option('wprss_db_version', WPRSS_DB_VERSION);
    // Add the default plugin settings.
    add_option('wprss_settings_general', wprss_get_default_settings_general());
}
Example #28
0
 public function __construct()
 {
     // load plugin text domain
     add_action('init', array($this, 'widget_textdomain'));
     // Hooks fired when the Widget is activated and deactivated
     register_activation_hook(__FILE__, array($this, 'activate'));
     register_deactivation_hook(__FILE__, array($this, 'deactivate'));
     parent::__construct('taxonomies-filter-widget', __('Taxonomies Filter', 'taxonomies-filter-widget'), array('classname' => 'taxonomies-filter-widget', 'description' => __('Filter posts by category and/or taxonomy.', 'taxonomies-filter-widget')));
     // Load plugin options and/or set the default values
     $this->tfw_options = wp_parse_args((array) get_option('tfw_options'), array('auto_submit' => 0, 'hide_empty' => 0, 'display_search_box' => 0, 'display_reset_button' => 0, 'multiple_relation' => ',', 'results_template' => 'search', 'custom_template' => 'search.php', 'post_count' => 'dynamic', 'search_box' => 'Keywords', 'search_button' => 'Search', 'reset_button' => 'Reset all'));
     add_option('tfw_options', $this->tfw_options);
     $this->filters = get_option('widget_taxonomies-filter-widget');
     // Register admin styles and scripts
     add_action('admin_enqueue_scripts', array($this, 'register_admin_scripts_styles'));
     // Register site styles and scripts
     add_action('wp_enqueue_scripts', array($this, 'register_widget_scripts'));
     add_action('wp_enqueue_scripts', array($this, 'register_widget_styles'));
     // Register the function that will handle the ajax request
     add_action('wp_ajax_get_term_childrens', array($this, 'ajax_drilldown'));
     add_action('wp_ajax_nopriv_get_term_childrens', array($this, 'ajax_drilldown'));
     // if is admin, create the options page, otherwise, set the search results template
     if (is_admin()) {
         add_action('admin_menu', array($this, 'tfw_options_page'));
         add_action('admin_init', array($this, 'tfw_page_init'));
         add_filter('plugin_action_links', array($this, 'add_settings_link'), 10, 2);
     } elseif (is_main_query()) {
         add_filter('get_meta_sql', array($this, 'cast_decimal_precision'));
         add_action('pre_get_posts', array($this, 'filter_by_custom_field'), 2);
         add_action('template_redirect', array($this, 'results_template'), 2);
     }
 }
/**
 * Setup the default options in the wp_options table
 */
function bp_portfolio_default_options()
{
    // The default max size for the description of a project
    add_option('bp_portfolio_desc_max_size', '720');
    // The default template
    add_option('bp_portfolio_template', 'default');
}
 /**
  *	Add The SMMP Wordpress Options
  */
 public static function generate_options()
 {
     // Record db version
     add_option("smmp_db_version", SMMP::$db_version);
     // View options
     add_option("smmp_view_sidebar", '1');
     add_option("smmp_view_footer", '1');
     add_option("smmp_view_dashboard", '1');
     add_option("smmp_view_submitbox", '1');
     // Short url for customised links
     add_option("smmp_short_url", '');
     // Facebook collection
     add_option("smmp_facebook", '{}');
     // Twitter collection
     add_option("smmp_twitter", '{}');
     // Facebook Account URL
     add_option("smmp_url_facebook", '');
     // Twitter Account URL
     add_option("smmp_url_twitter", '');
     // Instagram Account URL
     add_option("smmp_url_instagram", '');
     // Pinterest Account URL
     add_option("smmp_url_pinterest", '');
     // Google+ Account URL
     add_option("smmp_url_googleplus", '');
     // LinkedIn Account URL
     add_option("smmp_url_linkedin", '');
 }