Ejemplo n.º 1
0
        $new_role = str_replace(array('-', ' ', ' '), '_', $new_role);
        $new_role = preg_replace('/[^A-Za-z0-9_]/', '', $new_role);
        $new_role = strtolower($new_role);
        $new_role_name = strip_tags($_POST['role-name']);
        $new_role_added = add_role($new_role, $new_role_name, $new_user_caps);
    }
}
?>
<div class="wrap">
	<h2><?php 
_e('Add a new user role', 'event_espresso');
?>
</h2>
	<?php 
if ($new_role_added) {
    espresso_admin_message('', sprintf(__('The %1$s role has been created.', 'event_espresso'), $_POST['role-name']));
}
?>
	<?php 
do_action('espresso_pre_new_role_form');
// Available action hook for displaying messages.
?>
	<div id="poststuff">
		<form name="form0" method="post" action="<?php 
echo admin_url("admin.php?page=roles&amp;action=new");
?>
" style="border:none;background:transparent;">
			<?php 
wp_nonce_field(espresso_get_nonce('new-role'));
?>
			<div class="postbox open">
Ejemplo n.º 2
0
            $new_cap = strtolower($new_cap);
            if ($new_cap && !$role->has_cap($new_cap)) {
                $role->add_cap($new_cap);
            }
        }
    }
}
?>
<div class="wrap">
	<h2><?php 
printf(__('Edit the %1$s role', 'event-espresso'), $role->name);
?>
</h2>
	<?php 
if ($role_updated) {
    espresso_admin_message('', __('Role updated.', 'event-espresso'));
}
?>
	<?php 
do_action('espresso_pre_edit_role_form');
//Available pre-form hook for displaying messages.
?>
	<div id="poststuff">
		<form name="form0" method="post" action="<?php 
echo admin_url(esc_url("admin.php?page=roles&amp;action=edit&amp;role={$role->name}"));
?>
" style="border:none;background:transparent;">
			<?php 
wp_nonce_field(espresso_get_nonce('edit-roles'));
?>
			<div class="postbox open">