示例#1
0
        /**
         * Responsible for saving additional profile options and settings
         *
         * @since bbPress (r2464)
         *
         * @param WP_User $profileuser User data
         * @uses do_action() Calls 'bbp_user_profile_forums'
         * @return bool Always false
         */
        public function user_profile_forums($profileuser)
        {
            // Bail if current user cannot edit users
            if (!current_user_can('edit_user', $profileuser->ID)) {
                return;
            }
            // Noop WordPress additional caps output area
            add_filter('additional_capabilities_display', '__return_false');
            ?>

		<h3><?php 
            _e('Forum Capabilities', 'bbpress');
            ?>
</h3>

		<table class="form-table">
			<tbody>
				<tr>
					<th><?php 
            _e('This user can:', 'bbpress');
            ?>
</th>

					<td>
						<fieldset>
							<legend class="screen-reader-text"><span><?php 
            _e('Additional Capabilities', 'bbpress');
            ?>
</span></legend>

							<?php 
            foreach (bbp_get_capability_groups() as $group) {
                ?>

								<div class="bbp-user-capabilities">
									<h4><?php 
                bbp_capability_group_title($group);
                ?>
</h4>

									<?php 
                foreach (bbp_get_capabilities_for_group($group) as $capability) {
                    ?>

										<label for="_bbp_<?php 
                    echo $capability;
                    ?>
">
											<input id="_bbp_<?php 
                    echo $capability;
                    ?>
" name="_bbp_<?php 
                    echo $capability;
                    ?>
" type="checkbox" id="_bbp_<?php 
                    echo $capability;
                    ?>
" value="1" <?php 
                    checked(user_can($profileuser->ID, $capability));
                    ?>
 />
											<?php 
                    bbp_capability_title($capability);
                    ?>
										</label>
										<br />

									<?php 
                }
                ?>

								</div>

							<?php 
            }
            ?>

							<p class="bbp-default-caps-wrapper">
								<input type="submit" name="bbp-default-caps" class="button" value="<?php 
            _e('Reset to Default', 'bbpress');
            ?>
"/>
							</p>

						</fieldset>
					</td>
				</tr>

			</tbody>
		</table>

		<?php 
        }
示例#2
0
        ?>
" />
						<?php 
        _e('Grant this user super admin privileges for the Network.', 'bbpress');
        ?>
					</label>
				</div>

			<?php 
    }
    ?>

			<div>

				<?php 
    foreach (bbp_get_capability_groups() as $group) {
        ?>

					<dl class="bbp-user-capabilities">
						<dt><?php 
        bbp_capability_group_title($group);
        ?>
</dt>

						<?php 
        foreach (bbp_get_capabilities_for_group($group) as $capability) {
            ?>

							<dd>
								<label for="_bbp_<?php 
            echo $capability;