當前位置: 首頁>>代碼示例>>PHP>>正文


PHP wp_dropdown_roles函數代碼示例

本文整理匯總了PHP中wp_dropdown_roles函數的典型用法代碼示例。如果您正苦於以下問題:PHP wp_dropdown_roles函數的具體用法?PHP wp_dropdown_roles怎麽用?PHP wp_dropdown_roles使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了wp_dropdown_roles函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: callback

    public function callback($term = null)
    {
        if (!empty($term)) {
            $mp_term = \Morepress\Term::forge($term);
            ?>
			<tr class="form-field">
				<th scope="row" valign="top">
					<label for="term_meta_<?php 
            echo $this->_slug;
            ?>
"><?php 
            echo $this->_params['label'];
            ?>
</label>
				</th>
				<td>
                    <select id="term_meta_<?php 
            echo $this->_slug;
            ?>
" name="term_meta[<?php 
            echo $this->_slug;
            ?>
]"  id="term_meta_<?php 
            echo $this->_slug;
            ?>
">
                        <?php 
            wp_dropdown_roles($mp_term->getMeta($this->_slug));
            ?>
                    </select>
					<?php 
            if (!empty($this->_params['description'])) {
                ?>
						<p class="description"><?php 
                echo $this->_params['description'];
                ?>
</p>
					<?php 
            }
            ?>
				</td>
			</tr>
			<?php 
        }
    }
開發者ID:adriend,項目名稱:morepress,代碼行數:45,代碼來源:Role.php

示例2: msum_options

function msum_options()
{
    $blogs = msum_get_blog_list(0, 'all');
    echo '<h3>' . __('Multisite User Management', 'msum') . '</h3>';
    if (empty($blogs)) {
        echo '<p><b>' . __('No public, safe sites available.', 'msum') . '</b></p>';
    } else {
        echo '<p>' . __('Select the default role for each of your sites.', 'msum') . '</p>';
        echo '<p>' . __('New users will receive these roles when activating their account. Existing users will receive these roles only if they have the current default role or no role at all for each particular site.', 'msum') . '</p>';
        echo '<table class="form-table">';
        foreach ($blogs as $key => $blog) {
            switch_to_blog($blog['blog_id']);
            ?>
			<tr valign="top">
				<th scope="row"><?php 
            echo get_bloginfo('name');
            ?>
</th>
				<td>
					<select name="msum_default_user_role[<?php 
            echo $blog['blog_id'];
            ?>
]" id="msum_default_user_role[<?php 
            echo $blog['blog_id'];
            ?>
]">
						<option value="none"><?php 
            _e('-- None --', 'msum');
            ?>
</option>
						<?php 
            wp_dropdown_roles(get_option('msum_default_user_role'));
            ?>
					</select>
				</td> 
			</tr>
		<?php 
            restore_current_blog();
        }
        echo '</table>';
    }
    echo '<p>' . __('<b>Note:</b> only public, non-mature and non-dashboard sites appear here. Set the default role for the dashboard site above under <b>Dashboard Settings</b>.', 'msum') . '</p>';
}
開發者ID:howardlei82,項目名稱:IGSM-Website,代碼行數:43,代碼來源:ms-user-management.php

示例3: if

<?php if ( $wp_user_search->results_are_paged() ) : ?>
	<div class="tablenav-pages"><?php $wp_user_search->page_links(); ?></div>
<?php endif; ?>

<div class="alignleft actions">
<select name="action">
<option value="" selected="selected"><?php _e('Bulk Actions'); ?></option>
<?php if ( !is_multisite() && current_user_can('delete_users') ) { ?>
<option value="delete"><?php _e('Delete'); ?></option>
<?php } else { ?>
<option value="remove"><?php _e('Remove'); ?></option>
<?php } ?>
</select>
<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />
<label class="screen-reader-text" for="new_role"><?php _e('Change role to&hellip;') ?></label><select name="new_role" id="new_role"><option value=''><?php _e('Change role to&hellip;') ?></option><?php wp_dropdown_roles(); ?></select>
<input type="submit" value="<?php esc_attr_e('Change'); ?>" name="changeit" class="button-secondary" />
<?php wp_nonce_field('bulk-users'); ?>
</div>

<br class="clear" />
</div>

	<?php if ( is_wp_error( $wp_user_search->search_errors ) ) : ?>
		<div class="error">
			<ul>
			<?php
				foreach ( $wp_user_search->search_errors->get_error_messages() as $message )
					echo "<li>$message</li>";
			?>
			</ul>
開發者ID:realfluid,項目名稱:umbaugh,代碼行數:30,代碼來源:users.php

示例4: _e

</tr>
<tr valign="top"> 
<th scope="row"><?php _e('Membership:') ?></th> 
<td> <label for="users_can_register"> 
<input name="users_can_register" type="checkbox" id="users_can_register" value="1" <?php checked('1', get_option('users_can_register')); ?> /> 
<?php _e('Anyone can register') ?></label><br />
<label for="comment_registration">
<input name="comment_registration" type="checkbox" id="comment_registration" value="1" <?php checked('1', get_option('comment_registration')); ?> /> 
<?php _e('Users must be registered and logged in to comment') ?>
</label>
</td> 
</tr> 
<tr valign="top"> 
<th scope="row"><?php _e('New User Default Role:') ?></th> 
<td><label for="default_role"> 
<select name="default_role" id="default_role"><?php wp_dropdown_roles( get_option('default_role') ); ?></select></label>
</td> 
</tr> 
</table> 
<fieldset class="options"> 
<legend><?php _e('Date and Time') ?></legend> 
<table class="optiontable"> 
<tr> 
<th scope="row"><?php _e('<abbr title="Coordinated Universal Time">UTC</abbr> time is:') ?> </th> 
<td><code><?php echo gmdate(__('Y-m-d g:i:s a')); ?></code></td> 
</tr>
<tr>
<th scope="row"><?php _e('Times in the weblog should differ by:') ?> </th>
<td><input name="gmt_offset" type="text" id="gmt_offset" size="2" value="<?php form_option('gmt_offset'); ?>" /> 
<?php _e('hours') ?> (<?php _e('Your timezone offset, for example <code>-6</code> for Central Time.'); ?>)</td>
</tr>
開發者ID:staylor,項目名稱:develop.svn.wordpress.org,代碼行數:31,代碼來源:options-general.php

示例5: extra_tablenav

    function extra_tablenav($which)
    {
        if ('top' != $which) {
            return;
        }
        if (!current_user_can('promote_users')) {
            return;
        }
        ?>
	<div class="alignleft actions">
		<label class="screen-reader-text" for="new_role"><?php 
        _e('Change role to&hellip;');
        ?>
</label>
		<select name="new_role" id="new_role">
			<option value=''><?php 
        _e('Change role to&hellip;');
        ?>
</option>
			<?php 
        wp_dropdown_roles();
        ?>
		</select>
		<?php 
        submit_button(__('Change'), 'small', 'changeit', false);
        ?>
	</div>
<?php 
    }
開發者ID:rkglug,項目名稱:WordPress,代碼行數:29,代碼來源:class-wp-users-list-table.php

示例6: _e

_e('Members may only sign up for active subscription levels.', 'rcp');
?>
</p>
				</td>
			</tr>
			<tr class="form-field">
				<th scope="row" valign="top">
					<label for="rcp-role"><?php 
_e('User Role', 'rcp');
?>
</label>
				</th>
				<td>
					<select name="role" id="rcp-role">
						<?php 
wp_dropdown_roles($level->role);
?>
					</select>
					<p class="description"><?php 
_e('The user role given to the member after signing up.', 'rcp');
?>
</p>
				</td>
			</tr>
			<?php 
do_action('rcp_edit_subscription_form', $level);
?>
		</tbody>
	</table>
	<p class="submit">
		<input type="hidden" name="rcp-action" value="edit-subscription"/>
開發者ID:ramiy,項目名稱:restrict-content-pro,代碼行數:31,代碼來源:edit-subscription.php

示例7: _e

        _e('Delete');
        ?>
</option>
</select>
<input type="submit" value="<?php 
        _e('Apply');
        ?>
" name="doaction" id="doaction" class="button-secondary action" />
<label class="hidden" for="new_role"><?php 
        _e('Change role to&hellip;');
        ?>
</label><select name="new_role" id="new_role"><option value=''><?php 
        _e('Change role to&hellip;');
        ?>
</option><?php 
        wp_dropdown_roles();
        ?>
</select>
<input type="submit" value="<?php 
        _e('Change');
        ?>
" name="changeit" class="button-secondary" />
<?php 
        wp_nonce_field('bulk-users');
        ?>
</div>

<br class="clear" />
</div>

	<?php 
開發者ID:blowery,項目名稱:wordpress,代碼行數:31,代碼來源:users.php

示例8: nggallery_admin_roles

function nggallery_admin_roles()
{
    if (isset($_POST['update_cap'])) {
        check_admin_referer('ngg_addroles');
        // now set or remove the capability
        ngg_set_capability($_POST['general'], "NextGEN Gallery overview");
        ngg_set_capability($_POST['tinymce'], "NextGEN Use TinyMCE");
        ngg_set_capability($_POST['add_gallery'], "NextGEN Upload images");
        ngg_set_capability($_POST['manage_gallery'], "NextGEN Manage gallery");
        ngg_set_capability($_POST['manage_others'], "NextGEN Manage others gallery");
        ngg_set_capability($_POST['manage_tags'], "NextGEN Manage tags");
        ngg_set_capability($_POST['edit_album'], "NextGEN Edit album");
        ngg_set_capability($_POST['change_style'], "NextGEN Change style");
        ngg_set_capability($_POST['change_options'], "NextGEN Change options");
        nggGallery::show_message(__('Updated capabilities', "nggallery"));
    }
    ?>
	<div class="wrap">
    <?php 
    screen_icon('nextgen-gallery');
    ?>
	<h2><?php 
    _e('Roles / capabilities', 'nggallery');
    ?>
</h2>
	<p><?php 
    _e('Select the lowest role which should be able to access the following capabilities. NextCellent Gallery supports the standard roles from WordPress.', 'nggallery');
    ?>
 <br />
	   <?php 
    _e('For a more flexible user management you can use the', 'nggallery');
    ?>
 <a href="http://wordpress.org/extend/plugins/capsman/" target="_blank">Capability Manager</a>.</p>
	<form name="addroles" id="addroles" method="POST" accept-charset="utf-8" >
		<?php 
    wp_nonce_field('ngg_addroles');
    ?>
			<table class="form-table">
			<tr valign="top">
				<th scope="row"><label for="general"><?php 
    _e('NextCellent Gallery overview', 'nggallery');
    ?>
</label></th>
				<td><select name="general" id="general"><?php 
    wp_dropdown_roles(ngg_get_role('NextGEN Gallery overview'));
    ?>
</select></td>
			</tr>
			<tr valign="top">
				<th scope="row"><label for="tinymce"><?php 
    _e('Use TinyMCE Button / Add Media', 'nggallery');
    ?>
</label></th>
				<td><select name="tinymce" id="tinymce"><?php 
    wp_dropdown_roles(ngg_get_role('NextGEN Use TinyMCE'));
    ?>
</select></td>
			</tr>
			<tr valign="top">
				<th scope="row"><label for="add_gallery"><?php 
    _e('Add gallery / Upload images', 'nggallery');
    ?>
</label></th>
				<td><select name="add_gallery" id="add_gallery"><?php 
    wp_dropdown_roles(ngg_get_role('NextGEN Upload images'));
    ?>
</select></td>
			</tr>
			<tr valign="top">
				<th scope="row"><label for="manage_gallery"><?php 
    _e('Manage gallery', 'nggallery');
    ?>
</label></th>
				<td><select name="manage_gallery" id="manage_gallery"><?php 
    wp_dropdown_roles(ngg_get_role('NextGEN Manage gallery'));
    ?>
</select></td>
			</tr>
			<tr valign="top">
				<th scope="row"><label for="manage_others"><?php 
    _e('Manage others gallery', 'nggallery');
    ?>
</label></th>
				<td><select name="manage_others" id="manage_others"><?php 
    wp_dropdown_roles(ngg_get_role('NextGEN Manage others gallery'));
    ?>
</select></td>
			</tr>
			<tr valign="top">
				<th scope="row"><label for="manage_tags"><?php 
    _e('Manage tags', 'nggallery');
    ?>
</label></th>
				<td><select name="manage_tags" id="manage_tags"><?php 
    wp_dropdown_roles(ngg_get_role('NextGEN Manage tags'));
    ?>
</select></td>
			</tr>
			<tr valign="top">
				<th scope="row"><label for="edit_album"><?php 
//.........這裏部分代碼省略.........
開發者ID:valerol,項目名稱:korpus,代碼行數:101,代碼來源:roles.php

示例9: user_primary_role_dropdown_list

    public function user_primary_role_dropdown_list($user_roles)
    {
        ?>
        
        <select name="primary_role" id="primary_role">
<?php 
        // Compare user role against currently editable roles
        $user_roles = array_intersect(array_values($user_roles), array_keys(get_editable_roles()));
        $user_primary_role = array_shift($user_roles);
        // print the full list of roles with the primary one selected.
        wp_dropdown_roles($user_primary_role);
        // print the 'no role' option. Make it selected if the user has no role yet.
        $selected = empty($user_primary_role) ? 'selected="selected"' : '';
        echo '<option value="" ' . $selected . '>' . esc_html__('&mdash; No role for this site &mdash;') . '</option>';
        ?>
        </select>
<?php 
    }
開發者ID:pwsclau,項目名稱:kurastar_dev,代碼行數:18,代碼來源:class-ure-lib.php

示例10: wp_dropdown_roles

?>
</label></th>
			<td><select name="access_post" class="tzn_option_select">
				<?php 
echo wp_dropdown_roles($this->options['access_post']);
?>
			</select></td>
		</tr>
		<tr>
			<th><label><?php 
_e('Who can moderate the project', 'taskfreak');
?>
</label></th>
			<td><select name="access_manage" class="tzn_option_select">
				<?php 
echo wp_dropdown_roles($this->options['access_manage']);
?>
			</select></td>
		</tr>
		</table>
		<h3><?php 
_e('Security options', 'taskfreak');
?>
</h3>
		<table class="form-table">
		<tr>
			<th><label><?php 
_e('Allow uploads in task comments', 'taskfreak');
?>
</label></th>
			<td>
開發者ID:tomzt,項目名稱:tfwp,代碼行數:31,代碼來源:settings.php

示例11: wp_dropdown_roles

 <span class="description"><?php 
echo SwpmUtils::_('(required)');
?>
</span></label></th>
            <td><input class="regular-text validate[required]" name="alias" type="text" id="alias" value="" aria-required="true" /></td>
	</tr>
	<tr class="form-field form-required">
            <th scope="row"><label for="role"><?php 
echo SwpmUtils::_('Default WordPress Role');
?>
 <span class="description"><?php 
echo SwpmUtils::_('(required)');
?>
</span></label></th>
            <td><select  class="regular-text" name="role"><?php 
wp_dropdown_roles('subscriber');
?>
</select></td>
	</tr>
        <tr>
            <th scope="row"><label for="subscription_period"><?php 
echo SwpmUtils::_('Access Duration');
?>
 <span class="description"><?php 
echo SwpmUtils::_('(required)');
?>
</span></label>
            </th>
            <td>
                <p><input type="radio" checked="checked" value="<?php 
echo SwpmMembershipLevel::NO_EXPIRY;
開發者ID:kevinotsuka,項目名稱:coffeecircle,代碼行數:31,代碼來源:admin_add_level.php

示例12: wp_dropdown_roles

?>
:</label>
        <select name="capability[gmedia_module_manage]" class="form-control input-sm"><?php 
wp_dropdown_roles($gmDB->get_role('gmedia_module_manage'));
?>
</select>

        <p class="help-block"><?php 
_e('Who can manage modules', 'grand-media');
?>
</p>
    </div>

    <div class="form-group">
        <label><?php 
_e('Settings', 'grand-media');
?>
:</label>
        <select name="capability[gmedia_settings]" class="form-control input-sm"><?php 
wp_dropdown_roles($gmDB->get_role('gmedia_settings'));
?>
</select>

        <p class="help-block"><?php 
_e('Who can change settings. Note: Capabilites can be changed only by administrator', 'grand-media');
?>
</p>
    </div>

</fieldset>
開發者ID:pasyuk,項目名稱:grand-media,代碼行數:30,代碼來源:roles.php

示例13: clean_login_options


//.........這裏部分代碼省略.........
    echo __('User role', 'cleanlogin');
    ?>
</th>
					<td>
						<label><input name="standby" type="checkbox" id="standby" <?php 
    if ($standby == 'on') {
        echo 'checked="checked"';
    }
    ?>
><?php 
    echo __('Enable Standby role?', 'cleanlogin');
    ?>
</label>
						<p class="description"><?php 
    echo __('Standby role disables all the capabilities for new users, until the administrator changes. It usefull for site with restricted components.', 'cleanlogin');
    ?>
</p>
						<br>
						<label><input name="chooserole" type="checkbox" id="chooserole" <?php 
    if ($chooserole == 'on') {
        echo 'checked="checked"';
    }
    ?>
><?php 
    echo __('Choose the role(s) in the registration form?', 'cleanlogin');
    ?>
</label>
						<p class="description"><?php 
    echo __('This feature allows you to choose the role from the frontend, with the selected roles you want to show. You can also define an standard predefined role through a shortcode parameter, e.g. [clean-login-register role="contributor"]. Anyway, you need to choose only the role(s) you want to accept to avoid security/infiltration issues.', 'cleanlogin');
    ?>
</p>
						<p>
							<select name="newuserroles[]" id="newuserroles" multiple size="5"><?php 
    wp_dropdown_roles();
    ?>
</select>
							<?php 
    //print_r($newuserroles);
    ?>
						</p>
					</td>
				</tr>
				<tr>
					<th scope="row"><?php 
    echo __('Hide username', 'cleanlogin');
    ?>
</th>
					<td>
						<label><input name="hideuser" type="checkbox" id="hideuser" <?php 
    if ($hideuser == 'on') {
        echo 'checked="checked"';
    }
    ?>
><?php 
    echo __('Hide username?', 'cleanlogin');
    ?>
</label>
						<p class="description"><?php 
    echo __('Hide username from the preview form.', 'cleanlogin');
    ?>
</p>
					</td>
				</tr>
				<tr>
					<th scope="row"><?php 
    echo __('Password complexity', 'cleanlogin');
開發者ID:seanlon,項目名稱:profile-page,代碼行數:67,代碼來源:clean-login.php

示例14: display


//.........這裏部分代碼省略.........
" size="8" />
				<?php 
                if ($i < $ilim - 1) {
                    ?>
				&nbsp;<span class="pp-usermeta-field-more" <?php 
                    if (empty($_GET["pp_search_user_meta_key_{$i}_{$id_suffix}"])) {
                        echo 'style="display:none"';
                    }
                    ?>
>+</span>
				<?php 
                }
                ?>
				</div>
			<?php 
            }
            ?>
		<?php 
        }
        ?>
		
		<?php 
        if ('user' == $agent_type && pp_get_option('user_search_by_role')) {
            ?>
			<select id="pp_search_role_<?php 
            echo $id_suffix;
            ?>
" class="pp-search-role">
			<option value=""><?php 
            _e('(any WP role)', 'pp');
            ?>
</option>
			<?php 
            wp_dropdown_roles();
            ?>
			</select>
		<?php 
        }
        ?>
		</td>
		
		<?php 
        if ($display_stored_selections) {
            ?>
			<td style="vertical-align:top" class="pp-members-current">
			</td>
		<?php 
        }
        ?>
		
		</tr>
		
		<tr><td>
		<h4><?php 
        _e('Search Results:', 'pp');
        ?>
<img class="waiting" style="display:none;float:right" src="<?php 
        echo esc_url(admin_url('images/wpspin_light.gif'));
        ?>
" alt="" /></h4>
		
		<select id="agent_results_<?php 
        echo $id_suffix;
        ?>
" class="pp_agent_results" <?php 
        if ($multi_select) {
開發者ID:severnrescue,項目名稱:web,代碼行數:67,代碼來源:agents-ajax_pp.php

示例15: render_default_wp_role

 public function render_default_wp_role()
 {
     echo '<select style="min-width: 200px;" name="aad-settings[default_wp_role]" id="new_role">';
     echo '<option value="">No Role</option>';
     wp_dropdown_roles($this->default_wp_role);
     echo '</select>';
     // echo '<p class="description">If no role is selected, a user will not be added.</p>';
 }
開發者ID:VirtualClarity,項目名稱:aad-sso-wordpress,代碼行數:8,代碼來源:Settings.php


注:本文中的wp_dropdown_roles函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。