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


PHP pmpro_setOption函数代码示例

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


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

示例1: pmpro_upgrade_1_8_7

function pmpro_upgrade_1_8_7()
{
    //fix cron jobs
    $jobs = _get_cron_array();
    // Remove all pmpro cron jobs (for now).
    foreach ($jobs as $when => $job_array) {
        foreach ($job_array as $name => $job) {
            //delete pmpro cron
            if (false !== stripos($name, 'pmpro_cron')) {
                unset($jobs[$when][$name]);
            }
        }
        //delete empty cron time slots
        if (empty($jobs[$when])) {
            unset($jobs[$when]);
        }
    }
    // Save the data
    _set_cron_array($jobs);
    //add the three we want back
    pmpro_maybe_schedule_event(current_time('timestamp'), 'daily', 'pmpro_cron_expire_memberships');
    pmpro_maybe_schedule_event(current_time('timestamp') + 1, 'daily', 'pmpro_cron_expiration_warnings');
    pmpro_maybe_schedule_event(current_time('timestamp'), 'monthly', 'pmpro_cron_credit_card_expiring_warnings');
    pmpro_setOption("db_version", "1.87");
    return 1.87;
}
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:26,代码来源:upgrade_1_8_7.php

示例2: pmpro_upgrade_1_7

function pmpro_upgrade_1_7()
{
    pmpro_db_delta();
    //just a db delta
    pmpro_setOption("db_version", "1.7");
    return 1.7;
}
开发者ID:aaronfrey,项目名称:PepperLillie-TAT,代码行数:7,代码来源:upgrade_1_7.php

示例3: pmpro_upgrade_1_8_6_9

function pmpro_upgrade_1_8_6_9()
{
    global $wpdb;
    $orders = $wpdb->get_results("SELECT id, user_id, membership_id, subscription_transaction_id FROM {$wpdb->pmpro_membership_orders} WHERE gateway = 'stripe' AND subscription_transaction_id LIKE 'cus_%'");
    if (!empty($orders)) {
        if (count($orders) > 100) {
            //if more than 100 orders, we'll need to do this via AJAX
            pmpro_addUpdate('pmpro_upgrade_1_8_6_9_ajax');
        } else {
            //less than 100, let's just do them now
            $subids = array();
            foreach ($orders as $order) {
                if (!empty($subids[$order->subscription_transaction_id])) {
                    $wpdb->query("UPDATE {$wpdb->pmpro_membership_orders} SET subscription_transaction_id = '" . esc_sql($subids[$order->subscription_transaction_id]) . "' WHERE id = '" . $order->id . "' LIMIT 1");
                    //echo "Updating subid for #" . $order->id . " " . $order->subscription_transaction_id . ".<br />";
                } elseif (isset($subids[$order->subscription_transaction_id])) {
                    //no sub id found, so let it go
                    //echo "No subid found for #" . $order->id . " " . $order->subscription_transaction_id . " in cache.<br />";
                } else {
                    //need to look for a sub id in the database
                    $subid = $wpdb->get_var("SELECT subscription_transaction_id FROM {$wpdb->pmpro_membership_orders} WHERE membership_id = '" . $order->membership_id . "' AND user_id = '" . $order->user_id . "' AND subscription_transaction_id LIKE 'sub_%' LIMIT 1");
                    $subids[$order->subscription_transaction_id] = $subid;
                    if (!empty($subid)) {
                        $wpdb->query("UPDATE {$wpdb->pmpro_membership_orders} SET subscription_transaction_id = '" . esc_sql($subid) . "' WHERE id = '" . $order->id . "' LIMIT 1");
                        //echo "Updating subid for #" . $order->id . " " . $order->subscription_transaction_id . ".<br />";
                    } else {
                        //echo "No subid found for #" . $order->id . " " . $order->subscription_transaction_id . ".<br />";
                    }
                }
            }
        }
    }
    pmpro_setOption("db_version", "1.869");
    return 1.869;
}
开发者ID:aaronfrey,项目名称:PepperLillie-TAT,代码行数:35,代码来源:upgrade_1_8_6_9.php

示例4: pmpro_upgrade_1_2_3

function pmpro_upgrade_1_2_3()
{
    global $wpdb;
    $wpdb->hide_errors();
    $wpdb->pmpro_membership_levels = $wpdb->prefix . 'pmpro_membership_levels';
    $wpdb->pmpro_memberships_users = $wpdb->prefix . 'pmpro_memberships_users';
    $wpdb->pmpro_memberships_categories = $wpdb->prefix . 'pmpro_memberships_categories';
    $wpdb->pmpro_memberships_pages = $wpdb->prefix . 'pmpro_memberships_pages';
    $wpdb->pmpro_membership_orders = $wpdb->prefix . 'pmpro_membership_orders';
    $wpdb->pmpro_discount_codes = $wpdb->prefix . 'pmpro_discount_codes';
    $wpdb->pmpro_discount_codes_levels = $wpdb->prefix . 'pmpro_discount_codes_levels';
    $wpdb->pmpro_discount_codes_uses = $wpdb->prefix . 'pmpro_discount_codes_uses';
    //expiration number and period for levels
    $sqlQuery = "\r\n\t\tALTER TABLE  `" . $wpdb->pmpro_membership_levels . "` ADD  `expiration_number` INT UNSIGNED NOT NULL ,\r\nADD  `expiration_period` ENUM(  'Day',  'Week',  'Month',  'Year' ) NOT NULL\r\n\t";
    $wpdb->query($sqlQuery);
    //expiration number and period for discount code levels
    $sqlQuery = "\r\n\t\tALTER TABLE  `" . $wpdb->pmpro_discount_codes_levels . "` ADD  `expiration_number` INT UNSIGNED NOT NULL ,\r\nADD  `expiration_period` ENUM(  'Day',  'Week',  'Month',  'Year' ) NOT NULL\r\n\t";
    $wpdb->query($sqlQuery);
    //end date for members
    $sqlQuery = "\r\n\t\tALTER TABLE  `" . $wpdb->pmpro_memberships_users . "` ADD  `enddate` DATETIME NULL AFTER  `startdate`\r\n\t";
    $wpdb->query($sqlQuery);
    $sqlQuery = "\r\n\t\tALTER TABLE  `" . $wpdb->pmpro_memberships_users . "` ADD INDEX (  `enddate` )\r\n\t";
    $wpdb->query($sqlQuery);
    pmpro_setOption("db_version", "1.23");
    return 1.23;
}
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:26,代码来源:upgrade_1_2_3.php

示例5: pmproet_save_template_data

function pmproet_save_template_data()
{
    //update this template's settings
    pmpro_setOption($_REQUEST['template'] . '_subject', stripslashes($_REQUEST['subject']));
    pmpro_setOption($_REQUEST['template'] . '_body', stripslashes($_REQUEST['body']));
    echo 'Template Saved';
    exit;
}
开发者ID:audiblePi,项目名称:fccTest,代码行数:8,代码来源:pmpro-email-templates.php

示例6: pmpro_upgrade_1_1_15

function pmpro_upgrade_1_1_15()
{
    /*
    	DB table setup	
    */
    global $wpdb;
    $wpdb->hide_errors();
    $wpdb->pmpro_membership_levels = $wpdb->prefix . 'pmpro_membership_levels';
    $wpdb->pmpro_memberships_users = $wpdb->prefix . 'pmpro_memberships_users';
    $wpdb->pmpro_memberships_categories = $wpdb->prefix . 'pmpro_memberships_categories';
    $wpdb->pmpro_memberships_pages = $wpdb->prefix . 'pmpro_memberships_pages';
    $wpdb->pmpro_membership_orders = $wpdb->prefix . 'pmpro_membership_orders';
    $wpdb->pmpro_discount_codes = $wpdb->prefix . 'pmpro_discount_codes';
    $wpdb->pmpro_discount_codes_levels = $wpdb->prefix . 'pmpro_discount_codes_levels';
    $wpdb->pmpro_discount_codes_uses = $wpdb->prefix . 'pmpro_discount_codes_uses';
    /*
    	Changing some id columns to unsigned.			
    */
    $sqlQuery = "\r\n\t\tALTER TABLE  `" . $wpdb->pmpro_membership_levels . "` CHANGE  `id`  `id` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT\r\n\t";
    $wpdb->query($sqlQuery);
    $sqlQuery = "\r\n\t\tALTER TABLE  `" . $wpdb->pmpro_memberships_categories . "` CHANGE  `membership_id`  `membership_id` INT( 11 ) UNSIGNED NOT NULL\r\n\t";
    $wpdb->query($sqlQuery);
    $sqlQuery = "\r\n\t\tALTER TABLE  `" . $wpdb->pmpro_memberships_categories . "` CHANGE  `category_id`  `category_id` INT( 11 ) UNSIGNED NOT NULL\r\n\t";
    $wpdb->query($sqlQuery);
    $sqlQuery = "\r\n\t\tALTER TABLE  `" . $wpdb->pmpro_memberships_pages . "` CHANGE  `membership_id`  `membership_id` INT( 11 ) UNSIGNED NOT NULL\r\n\t";
    $wpdb->query($sqlQuery);
    $sqlQuery = "\r\n\t\tALTER TABLE  `" . $wpdb->pmpro_memberships_pages . "` CHANGE  `page_id`  `page_id` INT( 11 ) UNSIGNED NOT NULL\r\n\t";
    $wpdb->query($sqlQuery);
    $sqlQuery = "\r\n\t\tALTER TABLE  `" . $wpdb->pmpro_memberships_users . "` CHANGE  `user_id`  `user_id`  INT( 11 ) UNSIGNED NOT NULL\r\n\t";
    $wpdb->query($sqlQuery);
    $sqlQuery = "\r\n\t\tALTER TABLE  `" . $wpdb->pmpro_memberships_users . "` CHANGE  `membership_id`  `membership_id` INT( 11 ) UNSIGNED NOT NULL\r\n\t";
    $wpdb->query($sqlQuery);
    $sqlQuery = "\r\n\t\tALTER TABLE  `" . $wpdb->pmpro_membership_orders . "` CHANGE  `id`  `id` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT\r\n\t";
    $wpdb->query($sqlQuery);
    $sqlQuery = "\r\n\t\tALTER TABLE  `" . $wpdb->pmpro_membership_orders . "` CHANGE  `user_id`  `user_id` INT( 11 ) UNSIGNED NOT NULL DEFAULT  '0'\r\n\t";
    $wpdb->query($sqlQuery);
    $sqlQuery = "\r\n\t\tALTER TABLE  `" . $wpdb->pmpro_membership_orders . "` CHANGE  `membership_id`  `membership_id` INT( 11 ) UNSIGNED NOT NULL DEFAULT  '0'\r\n\t";
    $wpdb->query($sqlQuery);
    $sqlQuery = "\r\n\t\tALTER TABLE  `" . $wpdb->pmpro_memberships_users . "` ADD  `code_id` INT UNSIGNED NOT NULL AFTER  `membership_id` ;\r\n\t";
    $wpdb->query($sqlQuery);
    $sqlQuery = "\r\n\t\tALTER TABLE  `" . $wpdb->pmpro_memberships_users . "` ADD INDEX (  `code_id` )\r\n\t";
    $wpdb->query($sqlQuery);
    /*
    	New tables for discount codes
    */
    //wp_pmpro_discount_codes
    $sqlQuery = "\t\t\r\n\t\tCREATE TABLE `" . $wpdb->pmpro_discount_codes . "` (\r\n\t\t  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,\r\n\t\t  `code` varchar(32) NOT NULL,\r\n\t\t  `starts` date NOT NULL,\r\n\t\t  `expires` date NOT NULL,\r\n\t\t  `uses` int(11) NOT NULL,\r\n\t\t  PRIMARY KEY (`id`),\r\n\t\t  UNIQUE KEY `code` (`code`),\r\n\t\t  KEY `starts` (`starts`),\r\n\t\t  KEY `expires` (`expires`)\r\n\t\t);\r\n\t";
    $wpdb->query($sqlQuery);
    //wp_pmpro_discount_codes_levels
    $sqlQuery = "\t\t\r\n\t\tCREATE TABLE `" . $wpdb->pmpro_discount_codes_levels . "` (\r\n\t\t  `code_id` int(11) unsigned NOT NULL,\r\n\t\t  `level_id` int(11) unsigned  NOT NULL,\r\n\t\t  `initial_payment` decimal(10,2) NOT NULL DEFAULT '0.00',\r\n\t\t  `billing_amount` decimal(10,2) NOT NULL DEFAULT '0.00',\r\n\t\t  `cycle_number` int(11) NOT NULL DEFAULT '0',\r\n\t\t  `cycle_period` enum('Day','Week','Month','Year') DEFAULT 'Month',\r\n\t\t  `billing_limit` int(11) NOT NULL COMMENT 'After how many cycles should billing stop?',\r\n\t\t  `trial_amount` decimal(10,2) NOT NULL DEFAULT '0.00',\r\n\t\t  `trial_limit` int(11) NOT NULL DEFAULT '0',\r\n\t\t  PRIMARY KEY (`code_id`,`level_id`),\r\n\t\t  KEY `initial_payment` (`initial_payment`)\r\n\t\t);\r\n\t";
    $wpdb->query($sqlQuery);
    //wp_pmpro_discount_codes_uses
    $sqlQuery = "\t\t\r\n\t\tCREATE TABLE `" . $wpdb->pmpro_discount_codes_uses . "` (\r\n\t\t  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,\r\n\t\t  `code_id` int(10) unsigned NOT NULL,\r\n\t\t  `user_id` int(10) unsigned NOT NULL,\r\n\t\t  `order_id` int(10) unsigned NOT NULL,\r\n\t\t  `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\r\n\t\t  PRIMARY KEY (`id`),\r\n\t\t  KEY `user_id` (`user_id`),\r\n\t\t  KEY `timestamp` (`timestamp`)\r\n\t\t);\r\n\t";
    $wpdb->query($sqlQuery);
    pmpro_setOption("db_version", "1.115");
    //do the next update
    return 1.115;
}
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:58,代码来源:upgrade_1_1_15.php

示例7: pmproet_save_template_data

function pmproet_save_template_data()
{
    check_ajax_referer('pmproet', 'security');
    //update this template's settings
    pmpro_setOption('email_' . $_REQUEST['template'] . '_subject', stripslashes($_REQUEST['subject']));
    pmpro_setOption('email_' . $_REQUEST['template'] . '_body', stripslashes($_REQUEST['body']));
    echo 'Template Saved';
    exit;
}
开发者ID:TakenCdosG,项目名称:admissionsrevolution_new,代码行数:9,代码来源:pmpro-email-templates.php

示例8: pmpro_upgrade_1_3_18

function pmpro_upgrade_1_3_18()
{
    //setting new email settings defaults
    pmpro_setOption("email_admin_checkout", "1");
    pmpro_setOption("email_admin_changes", "1");
    pmpro_setOption("email_admin_cancels", "1");
    pmpro_setOption("email_admin_billing", "1");
    pmpro_setOption("db_version", "1.318");
    return 1.318;
}
开发者ID:aaronfrey,项目名称:PepperLillie-TAT,代码行数:10,代码来源:upgrade_1_3_18.php

示例9: pmpro_upgrade_1_6

function pmpro_upgrade_1_6()
{
    global $wpdb;
    $wpdb->hide_errors();
    $wpdb->pmpro_membership_orders = $wpdb->prefix . 'pmpro_membership_orders';
    //add notes column to orders
    $sqlQuery = "ALTER TABLE  `" . $wpdb->pmpro_membership_orders . "` ADD  `notes` TEXT NOT NULL";
    $wpdb->query($sqlQuery);
    pmpro_setOption("db_version", "1.6");
    return 1.6;
}
开发者ID:aaronfrey,项目名称:PepperLillie-TAT,代码行数:11,代码来源:upgrade_1_6.php

示例10: pmpro_upgrade_1_8_9_1

function pmpro_upgrade_1_8_9_1()
{
    global $wpdb;
    //Fixing Stripe orders where user_id/membership_id = 0. (Sets up update via AJAX)
    $orders = $wpdb->get_col("SELECT id FROM {$wpdb->pmpro_membership_orders} WHERE gateway = 'stripe' AND user_id = 0 AND membership_id = 0 AND status <> 'error' ");
    if (!empty($orders)) {
        pmpro_addUpdate('pmpro_upgrade_1_8_9_1_ajax');
    }
    pmpro_setOption("db_version", "1.891");
    return 1.891;
}
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:11,代码来源:upgrade_1_8_9_1.php

示例11: pmpro_upgrade_1_4

function pmpro_upgrade_1_4()
{
    global $wpdb;
    $wpdb->hide_errors();
    $wpdb->pmpro_membership_levels = $wpdb->prefix . 'pmpro_membership_levels';
    //confirmation message
    $sqlQuery = "\r\n\t\tALTER TABLE  `" . $wpdb->pmpro_membership_levels . "` ADD  `confirmation` LONGTEXT NOT NULL AFTER  `description`\r\n\t";
    $wpdb->query($sqlQuery);
    pmpro_setOption("db_version", "1.4");
    return 1.4;
}
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:11,代码来源:upgrade_1_4.php

示例12: pmpro_upgrade_1_8_9_3

function pmpro_upgrade_1_8_9_3()
{
    global $wpdb;
    //Fixing incorrect start and end dates. (Sets up update via AJAX)
    $user_ids = $wpdb->get_col("SELECT user_id FROM {$wpdb->pmpro_memberships_users} WHERE status = 'active' AND modified > '2016-05-19'");
    if (!empty($user_ids)) {
        pmpro_addUpdate('pmpro_upgrade_1_8_9_3_ajax');
    }
    pmpro_setOption("db_version", "1.91");
    return 1.893;
}
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:11,代码来源:upgrade_1_8_9_3.php

示例13: pmpro_upgrade_1_5_9

function pmpro_upgrade_1_5_9()
{
    global $wpdb;
    $wpdb->hide_errors();
    $wpdb->pmpro_membership_orders = $wpdb->prefix . 'pmpro_membership_orders';
    //fix firstpayment statuses
    $sqlQuery = "UPDATE " . $wpdb->pmpro_membership_orders . " SET status = 'success' WHERE status = 'firstpayment'";
    $wpdb->query($sqlQuery);
    pmpro_setOption("db_version", "1.59");
    return 1.59;
}
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:11,代码来源:upgrade_1_5_9.php

示例14: pmpro_upgrade_1_4_8

function pmpro_upgrade_1_4_8()
{
    /*
    	Adding a billing_country field to the orders table.		
    */
    global $wpdb;
    $wpdb->hide_errors();
    $wpdb->pmpro_membership_orders = $wpdb->prefix . 'pmpro_membership_orders';
    //billing_country
    $sqlQuery = "\r\n\t\tALTER TABLE  `" . $wpdb->pmpro_membership_orders . "` ADD  `billing_country` VARCHAR( 128 ) NOT NULL AFTER  `billing_zip`\r\n\t";
    $wpdb->query($sqlQuery);
    pmpro_setOption("db_version", "1.48");
    return 1.48;
}
开发者ID:aaronfrey,项目名称:PepperLillie-TAT,代码行数:14,代码来源:upgrade_1_4_8.php

示例15: pmpro_upgrade_1_4_2

function pmpro_upgrade_1_4_2()
{
    /*
    	Setting the new use_ssl setting.
    	PayPal Website Payments Pro, Authorize.net, and Stripe will default to use ssl.
    	PayPal Express and the test gateway (no gateway) will default to not use ssl.
    */
    $gateway = pmpro_getOption("gateway");
    if ($gateway == "paypal" || $gateway == "authorizenet" || $gateway == "stripe") {
        pmpro_setOption("use_ssl", 1);
    } else {
        pmpro_setOption("use_ssl", 0);
    }
    pmpro_setOption("db_version", "1.42");
    return 1.42;
}
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:16,代码来源:upgrade_1_4_2.php


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