本文整理匯總了PHP中FrmAppHelper::maybe_add_permissions方法的典型用法代碼示例。如果您正苦於以下問題:PHP FrmAppHelper::maybe_add_permissions方法的具體用法?PHP FrmAppHelper::maybe_add_permissions怎麽用?PHP FrmAppHelper::maybe_add_permissions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FrmAppHelper
的用法示例。
在下文中一共展示了FrmAppHelper::maybe_add_permissions方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: menu
public static function menu()
{
FrmAppHelper::maybe_add_permissions();
if (!current_user_can('frm_view_forms')) {
return;
}
$frm_settings = FrmAppHelper::get_settings();
add_menu_page('Formidable', $frm_settings->menu, 'frm_view_forms', 'formidable', 'FrmFormsController::route', FrmAppHelper::plugin_url() . '/images/form_16.png', self::get_menu_position());
}
示例2: menu
public static function menu()
{
FrmAppHelper::maybe_add_permissions();
if (!current_user_can('frm_view_forms')) {
return;
}
$menu_name = FrmAppHelper::get_menu_name();
add_menu_page('Formidable', $menu_name, 'frm_view_forms', 'formidable', 'FrmFormsController::route', '', self::get_menu_position());
}
示例3: set_as_user_role
function set_as_user_role($role)
{
// create user
$user = $this->factory->user->create_and_get(array('role' => $role));
$this->assertTrue($user->exists(), 'Problem getting user');
// log in as user
wp_set_current_user($user->ID);
$this->assertTrue(current_user_can($role), 'Failed setting the current user role');
FrmAppHelper::maybe_add_permissions();
return $user->ID;
}