本文整理汇总了PHP中FrmAppHelper::remove_get_action方法的典型用法代码示例。如果您正苦于以下问题:PHP FrmAppHelper::remove_get_action方法的具体用法?PHP FrmAppHelper::remove_get_action怎么用?PHP FrmAppHelper::remove_get_action使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrmAppHelper
的用法示例。
在下文中一共展示了FrmAppHelper::remove_get_action方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: route
public static function route($action)
{
add_filter('frm_entry_stop_action_route', '__return_true');
add_action('frm_load_form_hooks', 'FrmHooksController::trigger_load_form_hooks');
FrmAppHelper::trigger_hook_load('form');
switch ($action) {
case 'create':
return self::create();
case 'edit':
return self::edit();
case 'update':
return self::update();
case 'duplicate':
return self::duplicate();
case 'new':
return self::new_entry();
default:
$action = FrmAppHelper::get_param('action', '', 'get', 'sanitize_text_field');
if ($action == -1) {
$action = FrmAppHelper::get_param('action2', '', 'get', 'sanitize_title');
}
if (strpos($action, 'bulk_') === 0) {
FrmAppHelper::remove_get_action();
return self::bulk_actions($action);
}
return FrmEntriesController::display_list();
}
}
示例2: route
public static function route()
{
$action = isset($_REQUEST['frm_action']) ? 'frm_action' : 'action';
$vars = array();
if (isset($_POST['frm_compact_fields'])) {
FrmAppHelper::permission_check('frm_edit_forms');
$json_vars = htmlspecialchars_decode(nl2br(stripslashes(str_replace('"', '\\\\"', $_POST['frm_compact_fields']))));
$json_vars = json_decode($json_vars, true);
if (empty($json_vars)) {
// json decoding failed so we should return an error message
$action = FrmAppHelper::get_param($action, '', 'get', 'sanitize_title');
if ('edit' == $action) {
$action = 'update';
}
add_filter('frm_validate_form', 'FrmFormsController::json_error');
} else {
$vars = FrmAppHelper::json_to_array($json_vars);
$action = $vars[$action];
unset($_REQUEST['frm_compact_fields'], $_POST['frm_compact_fields']);
$_REQUEST = array_merge($_REQUEST, $vars);
$_POST = array_merge($_POST, $_REQUEST);
}
} else {
$action = FrmAppHelper::get_param($action, '', 'get', 'sanitize_title');
if (isset($_REQUEST['delete_all'])) {
// override the action for this page
$action = 'delete_all';
}
}
add_action('frm_load_form_hooks', 'FrmHooksController::trigger_load_form_hooks');
FrmAppHelper::trigger_hook_load('form');
switch ($action) {
case 'new':
return self::new_form($vars);
case 'create':
case 'edit':
case 'update':
case 'duplicate':
case 'trash':
case 'untrash':
case 'destroy':
case 'delete_all':
case 'settings':
case 'update_settings':
return self::$action($vars);
default:
do_action('frm_form_action_' . $action);
if (apply_filters('frm_form_stop_action_' . $action, false)) {
return;
}
$action = FrmAppHelper::get_param('action', '', 'get', 'sanitize_text_field');
if ($action == -1) {
$action = FrmAppHelper::get_param('action2', '', 'get', 'sanitize_title');
}
if (strpos($action, 'bulk_') === 0) {
FrmAppHelper::remove_get_action();
return self::list_form();
}
return self::display_forms_list();
}
}
示例3: test_remove_get_action
/**
* @covers FrmAppHelper::remove_get_action
*/
function test_remove_get_action()
{
$_GET['action'] = 'bulk_trash';
$start_url = $_SERVER['REQUEST_URI'] = admin_url('admin.php?page=formidable&action=bulk_trash');
FrmAppHelper::remove_get_action();
$new_url = FrmAppHelper::get_server_value('REQUEST_URI');
$this->assertNotEquals($new_url, $start_url);
}