本文整理汇总了PHP中FrmAppHelper::get_menu_name方法的典型用法代码示例。如果您正苦于以下问题:PHP FrmAppHelper::get_menu_name方法的具体用法?PHP FrmAppHelper::get_menu_name怎么用?PHP FrmAppHelper::get_menu_name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrmAppHelper
的用法示例。
在下文中一共展示了FrmAppHelper::get_menu_name方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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());
}
示例2: insert_form_button
/**
* Inserts Formidable button
* Hook exists since 2.5.0
*
* @since 2.0.15
*/
public static function insert_form_button()
{
if (current_user_can('frm_view_forms')) {
$menu_name = FrmAppHelper::get_menu_name();
$content = '<a href="#TB_inline?width=50&height=50&inlineId=frm_insert_form" class="thickbox button add_media frm_insert_form" title="' . esc_attr__('Add forms and content', 'formidable') . '">
<span class="frm-buttons-icon wp-media-buttons-icon"></span> ' . $menu_name . '</a>';
echo wp_kses_post($content);
}
}
示例3: update_hidden_cols
public static function update_hidden_cols($meta_id, $object_id, $meta_key, $meta_value)
{
$menu_name = FrmAppHelper::get_menu_name();
$sanitized = sanitize_title($menu_name);
$this_page_name = 'manage' . $sanitized . '_page_formidable-entriescolumnshidden';
if ($meta_key != $this_page_name) {
return;
}
global $frm_vars;
if (!isset($frm_vars['prev_hidden_cols']) || !$frm_vars['prev_hidden_cols']) {
return;
//don't continue if there's no previous value
}
foreach ($meta_value as $mk => $mv) {
//remove blank values
if (empty($mv)) {
unset($meta_value[$mk]);
}
}
$cur_form_prefix = reset($meta_value);
$cur_form_prefix = explode('_', $cur_form_prefix);
$cur_form_prefix = $cur_form_prefix[0];
$save = false;
foreach ((array) $frm_vars['prev_hidden_cols'] as $prev_hidden) {
if (empty($prev_hidden) || in_array($prev_hidden, $meta_value)) {
//don't add blank cols or process included cols
continue;
}
$form_prefix = explode('_', $prev_hidden);
$form_prefix = $form_prefix[0];
if ($form_prefix == $cur_form_prefix) {
//don't add back columns that are meant to be hidden
continue;
}
$meta_value[] = $prev_hidden;
$save = true;
unset($form_prefix);
}
if ($save) {
$user = wp_get_current_user();
update_user_option($user->ID, $this_page_name, $meta_value, true);
}
}