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


PHP pmpro_getAllLevels函数代码示例

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


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

示例1: pmpro_upgrade_1_8_9_3_ajax

function pmpro_upgrade_1_8_9_3_ajax()
{
    global $wpdb;
    $debug = false;
    $run = true;
    //some vars
    $all_levels = pmpro_getAllLevels(true, true);
    //keeping track of which user we're working on
    $last_user_id = get_option('pmpro_upgrade_1_8_9_3_last_user_id', 0);
    //get all active users during the period where things may have been broken
    $user_ids = $wpdb->get_col("SELECT user_id FROM {$wpdb->pmpro_memberships_users} WHERE status = 'active' AND modified > '2016-05-19' AND user_id > {$last_user_id} ORDER BY user_id LIMIT 10");
    //track progress
    $first_load = get_transient('pmpro_updates_first_load');
    if ($first_load) {
        $total_users = $wpdb->get_var("SELECT COUNT(user_id) FROM {$wpdb->pmpro_memberships_users} WHERE status = 'active' AND modified > '2016-05-19' ORDER BY user_id");
        update_option('pmpro_upgrade_1_8_9_3_total', $total_users, 'no');
        $progress = 0;
    } else {
        $total_users = get_option('pmpro_upgrade_1_8_9_3_total', 0);
        $progress = get_option('pmpro_upgrade_1_8_9_3_progress', 0);
    }
    update_option('pmpro_upgrade_1_8_9_3_progress', $progress + count($user_ids), 'no');
    global $pmpro_updates_progress;
    if ($total_users > 0) {
        $pmpro_updates_progress = "[" . $progress . "/" . $total_users . "]";
    } else {
        $pmpro_updates_progress = "";
    }
    if (empty($user_ids)) {
        //done with this update
        pmpro_removeUpdate('pmpro_upgrade_1_8_9_3_ajax');
        delete_option('pmpro_upgrade_1_8_9_3_last_user_id');
        delete_option('pmpro_upgrade_1_8_9_3_total');
        delete_option('pmpro_upgrade_1_8_9_3_progress');
    } else {
        foreach ($user_ids as $user_id) {
            $last_user_id = $user_id;
            //keeping track of the last user we processed
            $user = get_userdata($user_id);
            //user not found for some reason
            if (empty($user)) {
                if ($debug) {
                    echo "User #" . $user_id . " not found.\n";
                }
                continue;
            }
            //get level
            $user->membership_level = pmpro_getMembershipLevelForUser($user->ID);
            //has a start and end date already
            if (!empty($user->membership_level->enddate) && !empty($user->membership_level->startdate)) {
                if ($debug) {
                    echo "User #" . $user_id . ", " . $user->user_email . " already has a start and end date.\n";
                }
                continue;
            }
            //get order
            $last_order = new MemberOrder();
            $last_order->getLastMemberOrder();
            /*
            	Figure out if this user should have been given an end date.
            	The level my have an end date.
            	They might have used a discount code.
            	They might be using the set-expiration-dates code.
            	They might have custom code setting the end date.
            
            	Let's setup some vars as if we are at checkout.
            	Then pass recreate the level with the pmpro_checkout_level filter.
            	And use the end date there if there is one.
            */
            global $pmpro_level, $discount_code, $discount_code_id;
            //level
            $level_id = $user->membership_level->id;
            $_REQUEST['level'] = $level_id;
            //gateway
            if (!empty($last_order) && !empty($last_order->gateway)) {
                $_REQUEST['gateway'] = $last_order->gateway;
            } else {
                $_REQUEST['gateway'] = pmpro_getGateway();
            }
            //discount code
            $discount_code_id = $user->membership_level->code_id;
            $discount_code = $wpdb->get_var("SELECT code FROM {$wpdb->pmpro_discount_codes} WHERE id = '" . $discount_code_id . "' LIMIT 1");
            //get level
            if (!empty($discount_code_id)) {
                $sqlQuery = "SELECT l.id, cl.*, l.name, l.description, l.allow_signups FROM {$wpdb->pmpro_discount_codes_levels} cl LEFT JOIN {$wpdb->pmpro_membership_levels} l ON cl.level_id = l.id LEFT JOIN {$wpdb->pmpro_discount_codes} dc ON dc.id = cl.code_id WHERE dc.code = '" . $discount_code . "' AND cl.level_id = '" . (int) $level_id . "' LIMIT 1";
                $pmpro_level = $wpdb->get_row($sqlQuery);
                //if the discount code doesn't adjust the level, let's just get the straight level
                if (empty($pmpro_level)) {
                    $pmpro_level = $all_levels[$level_id];
                }
                //filter adjustments to the level
                $pmpro_level->code_id = $discount_code_id;
                $pmpro_level = apply_filters("pmpro_discount_code_level", $pmpro_level, $discount_code_id);
            }
            //no level yet, use default
            if (empty($pmpro_level)) {
                $pmpro_level = $all_levels[$level_id];
            }
            //no level for some reason
            if (empty($pmpro_level) && empty($pmpro_level->id)) {
//.........这里部分代码省略.........
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:101,代码来源:upgrade_1_8_9_3.php

示例2: pmpro_levels

    function pmpro_levels($course_id = null)
    {
        if (in_array('paid-memberships-pro/paid-memberships-pro.php', apply_filters('active_plugins', get_option('active_plugins'))) && function_exists('pmpro_getAllLevels')) {
            $levels = pmpro_getAllLevels();
            // Get all the PMPro Levels
            ?>
          <li class="course_membership"><strong><?php 
            _e('Set Course Memberships', 'wplms-front-end');
            ?>
<span>
                  <select id="vibe_pmpro_membership" class="chosen" multiple>
                      <?php 
            if (isset($levels) && is_array($levels)) {
                foreach ($levels as $level) {
                    if (!is_Array($course_pricing['vibe_pmpro_membership'])) {
                        $course_pricing['vibe_pmpro_membership'] = array();
                    }
                    if (is_object($level)) {
                        echo '<option value="' . $level->id . '" ' . (in_array($level->id, $course_pricing['vibe_pmpro_membership']) ? 'selected' : '') . '>' . $level->name . '</option>';
                    }
                }
            }
            ?>
                  </select>
              </span>
              </strong>
          </li>
      <?php 
        }
    }
开发者ID:nikitansk,项目名称:devschool,代码行数:30,代码来源:class.generate_fields.php

示例3: pmprolpv_admin_init

/**
 * Register settings sections and fields.
 *
 * @since 0.3.0
 */
function pmprolpv_admin_init()
{
    // Register limits settings section.
    add_settings_section('pmprolpv_limits', 'Membership Post View Limits', 'pmprolpv_settings_section_limits', 'pmpro-limitpostviews');
    // Register redirection settings section.
    add_settings_section('pmprolpv_redirection', 'Redirection', 'pmprolpv_settings_section_redirection', 'pmpro-limitpostviews');
    // Register limits settings fields.
    $levels = pmpro_getAllLevels(true, true);
    $levels[0] = new stdClass();
    $levels[0]->name = __('Non-members', 'pmpro');
    asort($levels);
    foreach ($levels as $id => $level) {
        $title = $level->name;
        add_settings_field('pmprolpv_limit_' . $id, $title, 'pmprolpv_settings_field_limits', 'pmpro-limitpostviews', 'pmprolpv_limits', $id);
        // Register JavaScript setting.
        register_setting('pmpro-limitpostviews', 'pmprolpv_limit_' . $id, 'pmprolpv_sanitize_limit');
    }
    // Register redirection settings field.
    add_settings_field('pmprolpv_redirect_page', 'Redirect to', 'pmprolpv_settings_field_redirect_page', 'pmpro-limitpostviews', 'pmprolpv_redirection');
    // Register redirection setting.
    register_setting('pmpro-limitpostviews', 'pmprolpv_redirect_page');
    // Register JavaScript settings field.
    add_settings_field('pmprolpv_use_js', 'Use JavaScript redirection', 'pmprolpv_settings_field_use_js', 'pmpro-limitpostviews', 'pmprolpv_redirection');
    // Register JavaScript setting.
    register_setting('pmpro-limitpostviews', 'pmprolpv_use_js');
}
开发者ID:eighty20results,项目名称:pmpro-limit-post-views,代码行数:31,代码来源:admin.php

示例4: wplms_sell_quiz_as_product

 function wplms_sell_quiz_as_product($metabox)
 {
     if (in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins')))) {
         $metabox['vibe_quiz_product'] = array('label' => __('Associated Product', 'vibe-customtypes'), 'desc' => __('Associated Product with the Course.', 'vibe-customtypes'), 'id' => 'vibe_quiz_product', 'type' => 'selectcpt', 'post_type' => 'product', 'std' => '');
     }
     if (in_array('paid-memberships-pro/paid-memberships-pro.php', apply_filters('active_plugins', get_option('active_plugins'))) && is_user_logged_in()) {
         $levels = pmpro_getAllLevels();
         foreach ($levels as $level) {
             $level_array[] = array('value' => $level->id, 'label' => $level->name);
         }
         $metabox['vibe_quiz_pmpro_membership'] = array('label' => __('PMPro Membership', 'vibe-customtypes'), 'desc' => __('Required Membership level for this quiz', 'vibe-customtypes'), 'id' => 'vibe_quiz_pmpro_membership', 'type' => 'multiselect', 'options' => $level_array);
     }
     if (in_array('wplms-mycred-addon/wplms-mycred-addon.php', apply_filters('active_plugins', get_option('active_plugins')))) {
         $metabox['vibe_quiz_mycred_points'] = array('label' => __('MyCred Points', 'vibe-customtypes'), 'desc' => __('MyCred Points required to take this quiz.', 'vibe-customtypes'), 'id' => 'vibe_quiz_mycred_points', 'type' => 'number');
     }
     return $metabox;
 }
开发者ID:VibeThemes,项目名称:wplms_sell_quiz,代码行数:17,代码来源:sell_quiz.php

示例5: pmproet_admin_init_test_order

function pmproet_admin_init_test_order()
{
    global $current_user, $pmproet_test_order_id;
    //make sure PMPro is activated
    if (!class_exists('MemberOrder')) {
        return;
    }
    $pmproet_test_order_id = get_option('pmproet_test_order_id');
    $test_order = new MemberOrder($pmproet_test_order_id);
    if (empty($test_order->id)) {
        $all_levels = pmpro_getAllLevels();
        if (!empty($all_levels)) {
            $first_level = array_shift($all_levels);
            $test_order->membership_id = $first_level->id;
            $test_order->InitialPayment = $first_level->initial_payment;
        } else {
            $test_order->membership_id = 1;
            $test_order->InitialPayment = 1;
        }
        $test_order->user_id = $current_user->ID;
        $test_order->cardtype = "Visa";
        $test_order->accountnumber = "4111111111111111";
        $test_order->expirationmonth = date('m', current_time('timestamp'));
        $test_order->expirationyear = intval(date('Y', current_time('timestamp'))) + 1;
        $test_order->ExpirationDate = $test_order->expirationmonth . $test_order->expirationyear;
        $test_order->CVV2 = '123';
        $test_order->FirstName = 'Jane';
        $test_order->LastName = 'Doe';
        $test_order->Address1 = '123 Street';
        $test_order->billing = new stdClass();
        $test_order->billing->name = 'Jane Doe';
        $test_order->billing->street = '123 Street';
        $test_order->billing->city = 'City';
        $test_order->billing->state = 'ST';
        $test_order->billing->country = 'US';
        $test_order->billing->zip = '12345';
        $test_order->billing->phone = '5558675309';
        $test_order->gateway_environment = 'sandbox';
        $test_order->notes = __('This is a test order used with the PMPro Email Templates addon.', 'pmpro');
        $test_order->saveOrder();
        $pmproet_test_order_id = $test_order->id;
        update_option('pmproet_test_order_id', $pmproet_test_order_id);
    }
}
开发者ID:audiblePi,项目名称:fccTest,代码行数:44,代码来源:init.php

示例6: register_my_members_menu

function register_my_members_menu()
{
    //make sure PMPro is activated
    if (!function_exists('pmpro_getAllLevels')) {
        return;
    }
    $my_theme = wp_get_theme();
    $menus = get_registered_nav_menus();
    foreach ($menus as $location => $description) {
        register_nav_menu('members-' . $location, __($description . ' - Members', $my_theme->get('Template')));
        $levels = pmpro_getAllLevels(true, true);
        foreach ($levels as $level) {
            $level_nav_menu = get_option('pmpro_nav_menu_hidden_level_' . $level->id, false);
            if (!empty($level_nav_menu)) {
                register_nav_menu('members-' . $level->id . '-' . $location, __($description . ' - ' . $level->name . ' Members', 'pmpro'));
            }
        }
    }
}
开发者ID:greathmaster,项目名称:pmpro-nav-menus,代码行数:19,代码来源:pmpro-nav-menus.php

示例7: javo_item_price_callback

    public function javo_item_price_callback($atts, $content = "")
    {
        global $post;
        $temp = $post;
        $errors = new wp_error();
        if (!defined('PMPRO_VERSION')) {
            $errors->add('test-error', __('Please activate "Paid Membership Pro" plugin to use price table shortcodes.', 'javo_fr'));
        }
        extract(shortcode_atts(array('title' => '', 'sub_title' => '', 'title_text_color' => '#000', 'sub_title_text_color' => '#000', 'line_color' => '#fff'), $atts));
        if ($errors->get_error_code() != null) {
            ob_start();
            ?>
			<div class="alert alert-danger">
				<strong><?php 
            _e('Error!', 'javo_fr');
            ?>
</strong>
				<div><?php 
            echo $errors->get_error_message();
            ?>
</div>
			</div>
			<?php 
            return ob_get_clean();
        }
        $pmpro_levels = pmpro_getAllLevels();
        ob_start();
        echo apply_filters('javo_shortcode_title', $title, $sub_title, array('title' => 'color:' . $title_text_color . ';', 'subtitle' => 'color:' . $sub_title_text_color . ';', 'line' => 'border-color:' . $line_color . ';'));
        $post->post_content = "[pmpro_levels]";
        if (function_exists('pmpro_wp')) {
            pmpro_wp();
        }
        echo do_shortcode('[pmpro_levels]');
        $post = $temp;
        return ob_get_clean();
    }
开发者ID:ksingh812,项目名称:epb,代码行数:36,代码来源:javo-item-price.php

示例8: wplms_unit_check_pmpro_membership

function wplms_unit_check_pmpro_membership($content)
{
    global $post;
    if ($post->post_type != 'unit' || !is_user_logged_in()) {
        return $content;
    }
    $unit_id = $post->ID;
    $user_id = get_current_user_id();
    if (in_array('paid-memberships-pro/paid-memberships-pro.php', apply_filters('active_plugins', get_option('active_plugins'))) && function_exists('pmpro_getAllLevels')) {
        $membership_ids = get_post_meta($unit_id, 'vibe_pmpro_membership', true);
        if (!empty($membership_ids) && count($membership_ids) >= 1) {
            if (pmpro_hasMembershipLevel($membership_ids, $user_id)) {
                return $content;
            } else {
                $levels = pmpro_getAllLevels($membership_ids);
                foreach ($levels as $level) {
                    $level_array[$level->id] = $level->name;
                }
                $content = 'Please purchase membership plan ';
            }
        }
    }
    return $content;
}
开发者ID:VibeThemes,项目名称:wplms-pmpro-unit-addon,代码行数:24,代码来源:wplms-pmpro-unit-addon.php

示例9: pmpro_getAllLevels

<?php

global $wpdb, $pmpro_msg, $pmpro_msgt, $current_user;
$pmpro_levels = pmpro_getAllLevels(false, true);
$pmpro_level_order = pmpro_getOption('level_order');
if (!empty($pmpro_level_order)) {
    $order = explode(',', $pmpro_level_order);
    //reorder array
    $reordered_levels = array();
    foreach ($order as $level_id) {
        foreach ($pmpro_levels as $key => $level) {
            if ($level_id == $level->id) {
                $reordered_levels[] = $pmpro_levels[$key];
            }
        }
    }
    $pmpro_levels = $reordered_levels;
}
$pmpro_levels = apply_filters("pmpro_levels_array", $pmpro_levels);
if ($pmpro_msg) {
    ?>
<div class="pmpro_message <?php 
    echo $pmpro_msgt;
    ?>
"><?php 
    echo $pmpro_msg;
    ?>
</div>
<?php 
}
?>
开发者ID:MediaPreneur,项目名称:paid-memberships-pro,代码行数:31,代码来源:levels.php

示例10: pmpro_shortcode_account

function pmpro_shortcode_account($atts, $content = null, $code = "")
{
    global $wpdb, $pmpro_msg, $pmpro_msgt, $pmpro_levels, $current_user, $levels;
    // $atts    ::= array of attributes
    // $content ::= text within enclosing form of shortcode element
    // $code    ::= the shortcode found, when == callback name
    // examples: [pmpro_account] [pmpro_account sections="membership,profile"/]
    extract(shortcode_atts(array('section' => '', 'sections' => 'membership,profile,invoices,links'), $atts));
    //did they use 'section' instead of 'sections'?
    if (!empty($section)) {
        $sections = $section;
    }
    //Extract the user-defined sections for the shortcode
    $sections = array_map('trim', explode(",", $sections));
    ob_start();
    //if a member is logged in, show them some info here (1. past invoices. 2. billing information with button to update.)
    if (pmpro_hasMembershipLevel()) {
        $ssorder = new MemberOrder();
        $ssorder->getLastMemberOrder();
        $mylevels = pmpro_getMembershipLevelsForUser();
        $pmpro_levels = pmpro_getAllLevels(false, true);
        // just to be sure - include only the ones that allow signups
        $invoices = $wpdb->get_results("SELECT *, UNIX_TIMESTAMP(timestamp) as timestamp FROM {$wpdb->pmpro_membership_orders} WHERE user_id = '{$current_user->ID}' AND status NOT IN('refunded', 'review', 'token', 'error') ORDER BY timestamp DESC LIMIT 6");
        ?>
	
	<div id="pmpro_account">		
		<?php 
        if (in_array('membership', $sections) || in_array('memberships', $sections)) {
            ?>
			<div id="pmpro_account-membership" class="pmpro_box">
				
				<h3><?php 
            _e("My Memberships", "pmpro");
            ?>
</h3>
				<table width="100%" cellpadding="0" cellspacing="0" border="0">
					<thead>
						<tr>
							<th><?php 
            _e("Level", "pmpro");
            ?>
</th>
							<th><?php 
            _e("Billing", "pmpro");
            ?>
</th>
							<th><?php 
            _e("Expiration", "pmpro");
            ?>
</th>
						</tr>
					</thead>
					<tbody>
						<?php 
            foreach ($mylevels as $level) {
                ?>
						<tr>
							<td class="pmpro_account-membership-levelname">
								<?php 
                echo $level->name;
                ?>
								<div class="pmpro_actionlinks">
									<?php 
                do_action("pmpro_member_action_links_before");
                ?>
									
									<?php 
                if (array_key_exists($level->id, $pmpro_levels) && pmpro_isLevelExpiringSoon($level)) {
                    ?>
										<a href="<?php 
                    echo pmpro_url("checkout", "?level=" . $level->id, "https");
                    ?>
"><?php 
                    _e("Renew", "pmpro");
                    ?>
</a>
									<?php 
                }
                ?>

									<?php 
                if (isset($ssorder->status) && $ssorder->status == "success" && (isset($ssorder->gateway) && in_array($ssorder->gateway, array("authorizenet", "paypal", "stripe", "braintree", "payflow", "cybersource"))) && pmpro_isLevelRecurring($level)) {
                    ?>
										<a href="<?php 
                    echo pmpro_url("billing", "", "https");
                    ?>
"><?php 
                    _e("Update Billing Info", "pmpro");
                    ?>
</a>
									<?php 
                }
                ?>
									
									<?php 
                //To do: Only show CHANGE link if this level is in a group that has upgrade/downgrade rules
                if (count($pmpro_levels) > 1 && !defined("PMPRO_DEFAULT_LEVEL")) {
                    ?>
										<a href="<?php 
                    echo pmpro_url("levels");
//.........这里部分代码省略.........
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:101,代码来源:pmpro_account.php

示例11: pmproup_adminpage

function pmproup_adminpage()
{
    global $wpdb;
    //get options
    $options = pmproup_getOptions();
    //saving?
    if (!empty($_REQUEST['savesettings'])) {
        //get parent page
        $parent_page = intval($_REQUEST['parent_page']);
        //get levels and make sure they are all ints
        if (!empty($_REQUEST['levels'])) {
            $olevels = $_REQUEST['levels'];
        } else {
            $olevels = array();
        }
        $levels = array();
        foreach ($olevels as $olevel) {
            $levels[] = intval($olevel);
        }
        //update options
        $options['parent_page'] = $parent_page;
        $options['levels'] = $levels;
        update_option('pmpro_user_pages', $options);
        //see if existing member checkbox is checked
        if (!empty($_REQUEST['existing_members']) && !empty($levels)) {
            //find all members
            $member_ids = $wpdb->get_col("SELECT user_id FROM {$wpdb->pmpro_memberships_users} WHERE status = 'active' AND membership_id IN('" . implode("','", $levels) . "')");
            //loop through
            if (!empty($member_ids)) {
                echo "<p>Generating user pages... ";
                $count = 0;
                foreach ($member_ids as $member_id) {
                    //check for user page
                    $user_page_id = get_user_meta($member_id, "pmproup_user_page", true);
                    //no page, create one
                    if (empty($user_page_id)) {
                        $count++;
                        echo ". ";
                        pmproup_pmpro_after_checkout($member_id);
                    }
                }
                echo " Done. " . $count . " " . _n('member', 'members', $count) . " setup.</p>";
            }
        }
    }
    require_once PMPRO_DIR . "/adminpages/admin_header.php";
    ?>
		<form action="" method="post" enctype="multipart/form-data"> 
			<h2>User Pages Settings</h2>
		
			<?php 
    if (defined('PMPROUP_PARENT_PAGE_ID') || defined('PMPROUP_LEVELS')) {
        ?>
				<div id="message" class="error"><p><strong>Warning:</strong> PMPROUP_PARENT_PAGE_ID and PMPROUP_LEVELS seem to be defined already... maybe in your wp-config.php. These constants are no longer needed and you should find their definitions and delete them. The settings here will control the User Pages addon.</p></div>
				<?php 
    }
    ?>
		
			<p>The User Pages addon can be used to create a "user page" for new members of specific levels. The user pages will only be visible to site admins and the user it was created for.</p>
			
			<hr />
			
			<p>The <strong>Top Level Page</strong> is the WordPress page under which all user pages will be created. You can create a page called "User Pages" and then choose it from the dropdown below.</p>						
		
			<table class="form-table">
			<tbody>				
				<tr>
					<th scope="row" valign="top">
						<label for="parent_page"><?php 
    _e('Top Level Page', 'pmpro');
    ?>
:</label>
					</th>
					<td>
						<?php 
    wp_dropdown_pages(array("name" => "parent_page", "show_option_none" => "-- Choose One --", "selected" => $options['parent_page']));
    ?>
						
					</td>
				</tr>
			</tbody>
			</table>
			
			<hr />
			
			<p>Only members of the levels specified below will have user pages created for them. Hold the Control button (or Command button on Macs) and click to select/deselect multiple levels.</p>
			
			<table class="form-table">
			<tbody>				
				<tr>
					<th scope="row" valign="top">
						<label for="levels"><?php 
    _e('User Pages Levels', 'pmpro');
    ?>
:</label>
					</th>
					<td>
						<select id="levels" name="levels[]" multiple="yes">
							<?php 
    $levels = pmpro_getAllLevels(true, true);
//.........这里部分代码省略.........
开发者ID:TakenCdosG,项目名称:admissionsrevolution_new,代码行数:101,代码来源:settings.php

示例12: pmpro_update_existing_subscriptions


//.........这里部分代码省略.........
		<table class="form-table">
			<tbody>
				<tr>
					<th scope="row">
						<label for="pmproues_gateway"><?php 
        _e('Gateway', 'pmproues');
        ?>
</label>
					</th>
					<td>
						<select name="pmproues_gateway" id="pmproues_gateway">
							<option value="stripe"><?php 
        _e('Stripe', 'pmproues');
        ?>
</option>						
						</select>
					</td>
				</tr>
				
				<tr>
					<th scope="row">
						<label for="pmproues_level"><?php 
        _e('Level', 'pmproues');
        ?>
</label>
					</th>
					<td>
						<select name="pmproues_level" id="pmproues_level">
							<option value="">- <?php 
        _e('Choose One', 'pmproues');
        ?>
 -</option>
							<?php 
        $levels = pmpro_getAllLevels(true, true);
        foreach ($levels as $level) {
            ?>
								<option value="<?php 
            echo $level->id;
            ?>
"><?php 
            echo $level->name;
            ?>
</option>
								<?php 
        }
        ?>
						</select>
					</td>
				</tr>
				
				<tr>
					<th scope="row" valign="top"><label for="pmproues_billing_amount"><?php 
        _e('New Billing Amount', 'pmproues');
        ?>
:</label></th>
					<td>
						<?php 
        if (pmpro_getCurrencyPosition() == "left") {
            echo $pmpro_currency_symbol;
        }
        ?>
						<input id="pmproues_billing_amount" name="pmproues_billing_amount" type="text" size="20" value="<?php 
        echo esc_attr($pmproues_billing_amount);
        ?>
" /> 
						<?php 
开发者ID:strangerstudios,项目名称:pmpro-update-existing-subscriptions,代码行数:67,代码来源:pmpro-update-existing-subscriptions.php

示例13: selected

					<option value="<?php 
    echo "Last Year";
    ?>
" <?php 
    selected($predefined_date, "Last Year");
    ?>
><?php 
    echo "Last Year";
    ?>
</option>

			</select>

			<?php 
    //Note: only orders belonging to current levels can be filtered. There is no option for orders belonging to deleted levels
    $levels = pmpro_getAllLevels();
    ?>
			<select id="l" name="l">
			<?php 
    foreach ($levels as $level) {
        ?>
				<option value="<?php 
        echo $level->id;
        ?>
" <?php 
        selected($l, $level->id);
        ?>
><?php 
        echo $level->name;
        ?>
</option>
开发者ID:srimai,项目名称:paid-memberships-pro,代码行数:31,代码来源:orders.php

示例14: bp_course_get_course_credits

    function bp_course_get_course_credits($args = NULL)
    {
        $defaults = array('id' => get_the_ID(), 'currency' => 'CREDITS', 'bypass' => 0);
        $r = wp_parse_args($args, $defaults);
        extract($r, EXTR_SKIP);
        $private = 0;
        $credits_html = '';
        $credits = array();
        if (!empty($bypass)) {
            if (is_user_logged_in()) {
                $user_id = get_current_user_id();
                $expire_check = get_user_meta($user_id, $id, true);
                if ($expire > time()) {
                    return '';
                }
            }
        }
        $free_course = get_post_meta($id, 'vibe_course_free', true);
        if (vibe_validate($free_course)) {
            $credits[] = '<strong>' . apply_filters('wplms_free_course_price', __('FREE', 'vibe')) . '</strong>';
        } else {
            $product_id = get_post_meta($id, 'vibe_product', true);
            if (isset($product_id) && $product_id != '' && function_exists('get_product')) {
                //WooCommerce installed
                $product = get_product($product_id);
                if (is_object($product)) {
                    $link = get_permalink($product_id);
                    $check = vibe_get_option('direct_checkout');
                    if (isset($check) && $check) {
                        $link .= '?redirect';
                    }
                    $price_html = str_replace('class="amount"', 'class="amount"', $product->get_price_html());
                    $credits[$link] = '<strong>' . $price_html . '</strong>';
                }
            }
            if (in_array('paid-memberships-pro/paid-memberships-pro.php', apply_filters('active_plugins', get_option('active_plugins')))) {
                $membership_ids = vibe_sanitize(get_post_meta($id, 'vibe_pmpro_membership', false));
                if (isset($membership_ids) && is_Array($membership_ids) && count($membership_ids) && function_exists('pmpro_getAllLevels')) {
                    //$membership_id = min($membership_ids);
                    $levels = pmpro_getAllLevels();
                    foreach ($levels as $level) {
                        if (in_array($level->id, $membership_ids)) {
                            $link = get_option('pmpro_levels_page_id');
                            $link = get_permalink($link) . '#' . $level->id;
                            $credits[$link] = '<strong>' . $level->name . '</strong>';
                        }
                    }
                }
            }
            $course_credits = get_post_meta($id, 'vibe_course_credits', true);
            if (isset($course_credits) && $course_credits != '') {
                $credits[] = '<strong>' . $course_credits . '</strong>';
            }
        }
        // End Else
        $credits = apply_filters('wplms_course_credits_array', $credits, $id);
        if (count($credits) > 1) {
            $credits_html .= '<div class="pricing_course">
    								<div class="result"><span>' . __('Price Options +', 'vibe') . '</span></div>
								    <div class="drop">';
            $first = 1;
            foreach ($credits as $key => $credit) {
                $credits_html .= '<label data-value="' . $key . '"><span class="font-text">' . $credit . '</span></label>';
                $first = 0;
            }
            $credits_html .= '</div>
								</div>';
            /*$credits_html .='<ul class="pricing_course">';
            		$first = 1;
            		foreach($credits as $key=>$credit){
            			$credits_html .='<li data-value="'.$key.'" '.(($first)?'class="active"':'').'>&nbsp;'.$credit.'</li>';
            			$first=0;
            		}
            		$credits_html .='</ul>';*/
        } else {
            if (count($credits)) {
                foreach ($credits as $credit) {
                    $credits_html .= $credit;
                }
                if (is_singular('course')) {
                    $credits_html .= '<i class="icon-wallet-money right"></i>';
                }
            }
        }
        $credits_html .= '';
        $credits_html = apply_filters('wplms_course_credits', $credits_html, $id);
        return $credits_html;
    }
开发者ID:akshayxhtmljunkies,项目名称:brownglock,代码行数:88,代码来源:bp-course-template.php

示例15: memberlite_settings_meta_box_callback

function memberlite_settings_meta_box_callback($post)
{
    wp_nonce_field('memberlite_settings_meta_box', 'memberlite_settings_meta_box_nonce');
    $memberlite_page_template = get_post_meta($post->ID, '_wp_page_template', true);
    $memberlite_banner_desc = get_post_meta($post->ID, '_memberlite_banner_desc', true);
    $memberlite_banner_hide_title = get_post_meta($post->ID, '_memberlite_banner_hide_title', true);
    $memberlite_banner_hide_breadcrumbs = get_post_meta($post->ID, '_memberlite_banner_hide_breadcrumbs', true);
    $memberlite_banner_right = get_post_meta($post->ID, '_memberlite_banner_right', true);
    $memberlite_banner_bottom = get_post_meta($post->ID, '_memberlite_banner_bottom', true);
    $memberlite_landing_page_checkout_button = get_post_meta($post->ID, '_memberlite_landing_page_checkout_button', true);
    $memberlite_landing_page_level = get_post_meta($post->ID, '_memberlite_landing_page_level', true);
    $memberlite_landing_page_upsell = get_post_meta($post->ID, '_memberlite_landing_page_upsell', true);
    echo '<h2>' . __('Page Banner Settings', 'memberlite') . '</h2>';
    echo '<p style="margin: 1rem 0 0 0;"><strong>' . __('Banner Description', 'memberlite') . '</strong> <em>Shown in the masthead banner below the page title.</em>';
    if ($memberlite_page_template == 'templates/landing.php' && function_exists('pmpro_getAllLevels')) {
        echo ' <em>Leave blank to show landing page level description as banner description.</em>';
    }
    echo '</p>';
    echo '<label class="screen-reader-text" for="memberlite_banner_desc">';
    _e('Banner Description', 'memberlite');
    echo '</label>';
    echo '<textarea class="large-text" rows="3" id="memberlite_banner_desc" name="memberlite_banner_desc">';
    echo $memberlite_banner_desc;
    echo '</textarea>';
    echo '<input type="hidden" name="memberlite_banner_hide_title_present" value="1" />';
    echo '<label for="memberlite_banner_hide_title" class="selectit"><input name="memberlite_banner_hide_title" type="checkbox" id="memberlite_banner_hide_title" value="1" ' . checked($memberlite_banner_hide_title, 1, false) . '>' . __('Hide Page Title on Single View', 'memberlite') . '</label>';
    echo '<input type="hidden" name="memberlite_banner_hide_breadcrumbs_present" value="1" />';
    echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label for="memberlite_banner_hide_breadcrumbs" class="selectit"><input name="memberlite_banner_hide_breadcrumbs" type="checkbox" id="memberlite_banner_hide_breadcrumbs" value="1" ' . checked($memberlite_banner_hide_breadcrumbs, 1, false) . '>' . __('Hide Breadcrumbs', 'memberlite') . '</label>';
    echo '<p style="margin: 1rem 0 0 0;"><strong>' . __('Banner Right Column', 'memberlite') . '</strong> <em>Right side of the masthead banner. (i.e. Video Embed, Image or Action Button)</em></p>';
    echo '<label class="screen-reader-text" for="memberlite_banner_right">';
    _e('Banner Right Column', 'memberlite');
    echo '</label> ';
    echo '<textarea class="large-text" rows="3" id="memberlite_banner_right" name="memberlite_banner_right">';
    echo $memberlite_banner_right;
    echo '</textarea>';
    echo '<p style="margin: 1rem 0 0 0;"><strong>' . __('Page Bottom Banner', 'memberlite') . '</strong> <em>Banner shown above footer on pages. (i.e. call to action)</em></p>';
    echo '<label class="screen-reader-text" for="memberlite_banner_bottom">';
    _e('Page Bottom Banner', 'memberlite');
    echo '</label> ';
    echo '<textarea class="large-text" rows="3" id="memberlite_banner_bottom" name="memberlite_banner_bottom">';
    echo $memberlite_banner_bottom;
    echo '</textarea>';
    if ($memberlite_page_template == 'templates/landing.php' && function_exists('pmpro_getAllLevels')) {
        echo '<hr />';
        echo '<h2>' . __('Landing Page Settings', 'memberlite') . '</h2>';
        $membership_levels = pmpro_getAllLevels();
        if (empty($membership_levels)) {
            echo '<div class="inline notice error"><p><a href="' . admin_url('admin.php?page=pmpro-membershiplevels') . '">Add a Membership Level to Use These Landing Page Features &raquo;</a></p>';
        } else {
            echo '<table class="form-table"><tbody>';
            echo '<tr><th scope="row">' . __('Membership Level', 'memberlite') . '</th>';
            echo '<td><label class="screen-reader-text" for="memberlite_landing_page_level">';
            _e('Landing Page Membership Level', 'memberlite');
            echo '</label> ';
            echo '<select id="memberlite_landing_page_level" name="memberlite_landing_page_level">';
            echo '<option value="blank" ' . selected($memberlite_landing_page_level, "blank") . '>- Select -</option>';
            foreach ($membership_levels as $level) {
                echo '<option value="' . $level->id . '"' . selected($memberlite_landing_page_level, $level->id) . '>' . $level->name . '</option>';
            }
            echo '</select></td></tr>';
            echo '<tr><th scope="row">' . __('Checkout Button Text', 'memberlite') . '</th>';
            echo '<td><label class="screen-reader-text" for="memberlite_landing_page_checkout_button">';
            _e('Checkout Button Text', 'memberlite');
            echo '</label> ';
            echo '<input type="text" id="memberlite_landing_page_checkout_button" name="memberlite_landing_page_checkout_button" value="' . $memberlite_landing_page_checkout_button . '"> <em>(default: "Select")</em></td></tr>';
            echo '<tr><th scope="row">' . __('Membership Level Upsell', 'memberlite') . '</th>';
            echo '<td><label class="screen-reader-text" for="memberlite_landing_page_upsell">';
            _e('Landing Page Membership Level Upsell', 'memberlite');
            echo '</label> ';
            echo '<select id="memberlite_landing_page_upsell" name="memberlite_landing_page_upsell">';
            echo '<option value="blank" ' . selected($memberlite_landing_page_upsell, "blank") . '>- Select -</option>';
            foreach ($membership_levels as $level) {
                echo '<option value="' . $level->id . '"' . selected($memberlite_landing_page_upsell, $level->id) . '>' . $level->name . '</option>';
            }
            echo '</select></td></tr>';
            echo '</tbody></table>';
        }
    }
}
开发者ID:greathmaster,项目名称:memberlite,代码行数:79,代码来源:metaboxes.php


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