本文整理汇总了PHP中get_admin_url函数的典型用法代码示例。如果您正苦于以下问题:PHP get_admin_url函数的具体用法?PHP get_admin_url怎么用?PHP get_admin_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_admin_url函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: import
/**
*
* @param array $current_import
* @return bool
*/
function import(array $current_import)
{
// fetch the remote content
$html = wp_remote_get($current_import['file']);
// Something failed
if (is_wp_error($html)) {
$redirect_url = get_admin_url(get_current_blog_id(), '/tools.php?page=pb_import');
error_log('\\PressBooks\\Import\\Html import error, wp_remote_get() ' . $html->get_error_message());
$_SESSION['pb_errors'][] = $html->get_error_message();
$this->revokeCurrentImport();
\Pressbooks\Redirect\location($redirect_url);
}
$url = parse_url($current_import['file']);
// get parent directory (with forward slash e.g. /parent)
$path = dirname($url['path']);
$domain = $url['scheme'] . '://' . $url['host'] . $path;
// get id (there will be only one)
$id = array_keys($current_import['chapters']);
// front-matter, chapter, or back-matter
$post_type = $this->determinePostType($id[0]);
$chapter_parent = $this->getChapterParent();
$body = $this->kneadandInsert($html['body'], $post_type, $chapter_parent, $domain);
// Done
return $this->revokeCurrentImport();
}
开发者ID:pressbooks,项目名称:pressbooks,代码行数:30,代码来源:class-pb-xhtml.php
示例2: mmpm_theme_options_array
/**
* @package MegaMain
* @subpackage MegaMain
* @since mm 1.0
*/
function mmpm_theme_options_array()
{
foreach (get_nav_menu_locations() as $key => $value) {
if ($key !== 'side_navigation' && $key !== 'top_navigation') {
continue;
}
$key = str_replace(' ', '-', $key);
$theme_menu_locations[$key] = $key;
}
$locations_options = array(array('name' => __('Below are all the locations, which are supported this theme. Toggle for change their settings.', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'primary_settings', 'type' => 'caption'));
if (isset($theme_menu_locations) && is_array($theme_menu_locations)) {
$locations_options[] = array('name' => __('You can activate Mega Main Menu in such locations:', MMPM_TEXTDOMAIN_ADMIN), 'descr' => __('Mega Main Menu and its settings will be displayed in selected locations only after the activation of this location.', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'mega_menu_locations', 'type' => 'checkbox', 'values' => $theme_menu_locations);
} else {
$locations_options[] = array('name' => __('Firstly, You need to create at least one menu', MMPM_TEXTDOMAIN_ADMIN) . ' (<a href="' . home_url() . '/wp-admin/nav-menus.php">' . __('Theme Menu Settings', MMPM_TEXTDOMAIN_ADMIN) . '</a>) ' . __('and set theme-location for him', MMPM_TEXTDOMAIN_ADMIN) . ' (<a href="' . home_url() . '/wp-admin/nav-menus.php?action=locations">' . __('Theme Menu Locations', MMPM_TEXTDOMAIN_ADMIN) . '</a>).', 'key' => 'no_locations', 'type' => 'caption');
}
foreach (get_nav_menu_locations() as $key => $value) {
if ($key !== 'side_navigation' && $key !== 'top_navigation') {
continue;
}
$original_menu_slug = $key;
$key = str_replace(' ', '-', $key);
$locations_options = array_merge($locations_options, array(array('name' => __('Layout Options: ', MMPM_TEXTDOMAIN_ADMIN) . ' <strong>' . $key . '</strong>', 'key' => $key . '_menu_options', 'type' => 'collapse_start'), array('name' => __('Add to Mega Main Menu:', MMPM_TEXTDOMAIN_ADMIN), 'descr' => __('You can add to the primary menu container: logo and search.', MMPM_TEXTDOMAIN_ADMIN), 'key' => $key . '_included_components', 'type' => 'checkbox', 'values' => array(__('Company Logo (on left side)', MMPM_TEXTDOMAIN_ADMIN) => 'company_logo', __('Search Box (on right side)', MMPM_TEXTDOMAIN_ADMIN) => 'search_box', __('WooCart (on right side)', MMPM_TEXTDOMAIN_ADMIN) => 'woo_cart'), 'default' => array()), array('name' => __('Height of the initial container and menu items of the first level.', MMPM_TEXTDOMAIN_ADMIN), 'descr' => __('Set the extent for the initial menu container and items of the first level.', MMPM_TEXTDOMAIN_ADMIN), 'key' => $key . '_first_level_item_height', 'type' => 'number', 'min' => 20, 'max' => 300, 'units' => 'px', 'values' => '50'), array('name' => __('Alignment of the first level items:', MMPM_TEXTDOMAIN_ADMIN), 'descr' => __('Choose how to locate menu elements of the first level.', MMPM_TEXTDOMAIN_ADMIN), 'key' => $key . '_first_level_item_align', 'type' => 'select', 'values' => array(__('Left', MMPM_TEXTDOMAIN_ADMIN) => 'left', __('Center', MMPM_TEXTDOMAIN_ADMIN) => 'center', __('Right', MMPM_TEXTDOMAIN_ADMIN) => 'right'), 'default' => array('left')), array('name' => __('Location of icon in first level elements', MMPM_TEXTDOMAIN_ADMIN), 'descr' => __('Choose where to locate icon for first level items.', MMPM_TEXTDOMAIN_ADMIN), 'key' => $key . '_first_level_icons_position', 'type' => 'select', 'values' => array(__('Left', MMPM_TEXTDOMAIN_ADMIN) => 'left', __('Above', MMPM_TEXTDOMAIN_ADMIN) => 'top', __('Right', MMPM_TEXTDOMAIN_ADMIN) => 'right', __('Disable Icons In First Level Items', MMPM_TEXTDOMAIN_ADMIN) => 'disable_first_lvl', __('Disable Icons Globally', MMPM_TEXTDOMAIN_ADMIN) => 'disable_globally'), 'default' => array('disable_first_lvl')), array('name' => __('Separator:', MMPM_TEXTDOMAIN_ADMIN), 'descr' => __('Select type of separator between the first level items of this menu.', MMPM_TEXTDOMAIN_ADMIN), 'key' => $key . '_first_level_separator', 'type' => 'select', 'values' => array(__('None', MMPM_TEXTDOMAIN_ADMIN) => 'none', __('Smooth', MMPM_TEXTDOMAIN_ADMIN) => 'smooth', __('Sharp', MMPM_TEXTDOMAIN_ADMIN) => 'sharp'), 'default' => array('smooth')), array('name' => __('Rounded corners', MMPM_TEXTDOMAIN_ADMIN), 'descr' => __('Select the value of corners radius.', MMPM_TEXTDOMAIN_ADMIN), 'key' => $key . '_corners_rounding', 'type' => 'number', 'min' => 0, 'max' => 100, 'units' => 'px', 'default' => 2), array('name' => __('Dropdowns Animation:', MMPM_TEXTDOMAIN_ADMIN), 'descr' => __('Select the type of animation to displaying dropdowns. <span style="color: #f11;">Warning:</span> Animation correctly works only in the latest versions of progressive browsers.', MMPM_TEXTDOMAIN_ADMIN), 'key' => $key . '_dropdowns_animation', 'type' => 'select', 'values' => array(__('None', MMPM_TEXTDOMAIN_ADMIN) => 'none', __('Unfold', MMPM_TEXTDOMAIN_ADMIN) => 'anim_1', __('Fading', MMPM_TEXTDOMAIN_ADMIN) => 'anim_2', __('Scale', MMPM_TEXTDOMAIN_ADMIN) => 'anim_3', __('Down to Up', MMPM_TEXTDOMAIN_ADMIN) => 'anim_4', __('Dropdown', MMPM_TEXTDOMAIN_ADMIN) => 'anim_5'), 'default' => array('none')), array('name' => __('Minimized on Handheld Devices', MMPM_TEXTDOMAIN_ADMIN), 'descr' => __('If this option is activated you get the folded menu on handheld devices.', MMPM_TEXTDOMAIN_ADMIN), 'key' => $key . '_mobile_minimized', 'type' => 'checkbox', 'values' => array(__('Activate', MMPM_TEXTDOMAIN_ADMIN) => 'true'), 'default' => array('true')), array('name' => __('Direction', MMPM_TEXTDOMAIN_ADMIN), 'descr' => __('Here you can determine the direction of the menu. Horizontal for classic top menu bar. Vertical for sidebar menu.', MMPM_TEXTDOMAIN_ADMIN), 'key' => $key . '_direction', 'type' => 'select', 'values' => array(__('Horizontal', MMPM_TEXTDOMAIN_ADMIN) => 'horizontal', __('Vertical', MMPM_TEXTDOMAIN_ADMIN) => 'vertical'), 'default' => array('horizontal'), 'dependency' => array('element' => array($key . '_sticky_status', $key . '_sticky_offset'), 'value' => 'horizontal')), array('name' => __('Sticky', MMPM_TEXTDOMAIN_ADMIN), 'descr' => __('Check this option to make the menu sticky. Not working on mobile devices.', MMPM_TEXTDOMAIN_ADMIN), 'key' => $key . '_sticky_status', 'type' => 'checkbox', 'values' => array(__('Enable', MMPM_TEXTDOMAIN_ADMIN) => 'true')), array('name' => __('Sticky scroll offset', MMPM_TEXTDOMAIN_ADMIN), 'descr' => __('Set the length of the scroll for each user to pass before the menu will stick to the top of the window.', MMPM_TEXTDOMAIN_ADMIN), 'key' => $key . '_sticky_offset', 'type' => 'number', 'min' => 0, 'max' => 2000, 'units' => 'px', 'default' => 340), array('name' => __('Forced PHP Integration', MMPM_TEXTDOMAIN_ADMIN), 'descr' => __('If you have knowledge of PHP you can call this function anywhere in order to display this menu. Please use it only if you professional.', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'forced_integration', 'type' => 'just_html', 'default' => '<pre><?php wp_nav_menu( array( "theme_location" => "' . $original_menu_slug . '" ) ); ?></pre>'), array('name' => __('', MMPM_TEXTDOMAIN_ADMIN), 'type' => 'collapse_end')));
}
$locations_options = array_merge($locations_options, array(array('name' => __('Logo Settings', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'mega_menu_logo', 'type' => 'caption'), array('name' => __('The logo file', MMPM_TEXTDOMAIN_ADMIN), 'descr' => __("Select image to be used as logo in Main Mega Menu. It's recommended to use image with transparent background (.PNG) and sizes from 200 to 800 px.", MMPM_TEXTDOMAIN_ADMIN), 'key' => 'logo_src', 'type' => 'file', 'default' => MMPM_IMG_URI . '/megamain-logo-120x120.png'), array('name' => __('Maximum logo height', MMPM_TEXTDOMAIN_ADMIN), 'descr' => __('Maximum logo height in terms of percentage in regard to the height of the initial container.', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'logo_height', 'min' => 10, 'max' => 99, 'units' => '%', 'type' => 'number', 'default' => 90), array('name' => __('Backup of the settings', MMPM_TEXTDOMAIN_ADMIN), 'descr' => __('You can make a backup of the plugin settings and restore this settings later. Notice: Options of each menu item from the section "Menu Structure" is not imported.', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'backup', 'type' => 'just_html', 'default' => '<a href="' . get_admin_url() . '?mmpm_page=backup_file">' . __('Download backup file with current settings') . '</a><br /><br />' . __('Upload backup file and restore settings. Chose file and click "Save All Settings".') . '<br /><input class="col-xs-12 form-control input-sm" type="file" name="' . MMPM_OPTIONS_DB_NAME . '_backup" />')));
$skins_options = array(array('name' => __('You can change any properties for any menu location', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'mega_menu_skins', 'type' => 'caption'));
foreach (get_nav_menu_locations() as $key => $value) {
$key = str_replace(' ', '-', $key);
$skins_options = array_merge($skins_options, array(array('name' => __('Skin Options: ', MMPM_TEXTDOMAIN_ADMIN) . ' <strong>' . $key . '</strong>', 'key' => $key . '_menu_skin', 'type' => 'collapse_start'), array('name' => __('Skin Options of the Initial Container', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'dropdowns_skin_options', 'type' => 'caption'), array('name' => __('Background Gradient (Color) of the primary container ', MMPM_TEXTDOMAIN_ADMIN), 'key' => $key . '_menu_bg_gradient', 'type' => 'gradient', 'default' => array('color1' => '#428bca', 'color2' => '#2a6496', 'start' => '0', 'end' => '100', 'orientation' => 'top')), array('name' => __('Background image of the primary container', MMPM_TEXTDOMAIN_ADMIN), 'descr' => __('You can choose and tune the background image for the primary container.', MMPM_TEXTDOMAIN_ADMIN), 'key' => $key . '_menu_bg_image', 'type' => 'background_image', 'default' => ''), array('name' => __('Skin Options of the First Level Items', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'dropdowns_skin_options', 'type' => 'caption'), array('name' => __('Font of the First Level Items', MMPM_TEXTDOMAIN_ADMIN), 'descr' => __('You can change size and weight of the font for first level items.', MMPM_TEXTDOMAIN_ADMIN), 'key' => $key . '_menu_first_level_link_font', 'type' => 'font', 'values' => array('font_family', 'font_size', 'font_weight'), 'default' => array('font_family' => 'Verdana', 'font_size' => '13', 'font_weight' => '400')), array('name' => __('Size of icons in the first level items', MMPM_TEXTDOMAIN_ADMIN), 'key' => $key . '_menu_first_level_icon_font', 'type' => 'font', 'values' => array('font_size'), 'default' => array('font_size' => '15')), array('name' => __('Text color of the first level item', MMPM_TEXTDOMAIN_ADMIN), 'key' => $key . '_menu_first_level_link_color', 'type' => 'color', 'default' => '#f8f8f8'), array('name' => __('Background Gradient (Color) of the first level item', MMPM_TEXTDOMAIN_ADMIN), 'key' => $key . '_menu_first_level_link_bg', 'type' => 'gradient', 'default' => array('color1' => 'rgba(255,255,255,0)', 'color2' => 'rgba(255,255,255,0)', 'start' => '0', 'end' => '100', 'orientation' => 'top')), array('name' => __('Text color of the active first level item', MMPM_TEXTDOMAIN_ADMIN), 'key' => $key . '_menu_first_level_link_color_hover', 'type' => 'color', 'default' => '#f8f8f8'), array('name' => __('Background Gradient (Color) of the active first level item', MMPM_TEXTDOMAIN_ADMIN), 'key' => $key . '_menu_first_level_link_bg_hover', 'type' => 'gradient', 'default' => array('color1' => '#3498db', 'color2' => '#2980b9', 'start' => '0', 'end' => '100', 'orientation' => 'top')), array('name' => __('Background color of the Search Box', MMPM_TEXTDOMAIN_ADMIN), 'key' => $key . '_menu_search_bg', 'type' => 'color', 'default' => '#3498db'), array('name' => __('Text and icon color of the Search Box', MMPM_TEXTDOMAIN_ADMIN), 'key' => $key . '_menu_search_color', 'type' => 'color', 'default' => '#f8f8f8'), array('name' => __('Skin Options of the Dropdowns', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'dropdowns_skin_options', 'type' => 'caption'), array('name' => __('Background Gradient (Color) of the Dropdown elements', MMPM_TEXTDOMAIN_ADMIN), 'key' => $key . '_menu_dropdown_wrapper_gradient', 'type' => 'gradient', 'default' => array('color1' => '#ffffff', 'color2' => '#ffffff', 'start' => '0', 'end' => '100', 'orientation' => 'top')), array('name' => __('Font of the dropdown menu item', MMPM_TEXTDOMAIN_ADMIN), 'key' => $key . '_menu_dropdown_link_font', 'type' => 'font', 'values' => array('font_family', 'font_size', 'font_weight'), 'default' => array('font_family' => 'Verdana', 'font_size' => '12', 'font_weight' => '400')), array('name' => __('Text color of the dropdown menu item', MMPM_TEXTDOMAIN_ADMIN), 'key' => $key . '_menu_dropdown_link_color', 'type' => 'color', 'default' => '#428bca'), array('name' => __('Background Gradient (Color) of the dropdown menu item', MMPM_TEXTDOMAIN_ADMIN), 'key' => $key . '_menu_dropdown_link_bg', 'type' => 'gradient', 'default' => array('color1' => 'rgba(255,255,255,0)', 'color2' => 'rgba(255,255,255,0)', 'start' => '0', 'end' => '100', 'orientation' => 'top')), array('name' => __('Border color between dropdown menu items', MMPM_TEXTDOMAIN_ADMIN), 'key' => $key . '_menu_dropdown_link_border_color', 'type' => 'color', 'default' => '#f0f0f0'), array('name' => __('Text color of the dropdown active menu item', MMPM_TEXTDOMAIN_ADMIN), 'key' => $key . '_menu_dropdown_link_color_hover', 'type' => 'color', 'default' => '#f8f8f8'), array('name' => __('Background Gradient (Color) of the dropdown active menu item', MMPM_TEXTDOMAIN_ADMIN), 'key' => $key . '_menu_dropdown_link_bg_hover', 'type' => 'gradient', 'default' => array('color1' => '#3498db', 'color2' => '#2980b9', 'start' => '0', 'end' => '100', 'orientation' => 'top')), array('name' => __('Plain Text Color of the Dropdown', MMPM_TEXTDOMAIN_ADMIN), 'key' => $key . '_menu_dropdown_plain_text_color', 'type' => 'color', 'default' => '#333333'), array('name' => __('', MMPM_TEXTDOMAIN_ADMIN), 'type' => 'collapse_end')));
}
$skins_options = array_merge($skins_options, array(array('name' => __('Set of Installed Fonts', MMPM_TEXTDOMAIN_ADMIN), 'descr' => __('Select the fonts to be included on the site. Remember that a lot of fonts affect on the speed of load page. Always remove unnecessary fonts. Font faces can see on this page - ', MMPM_TEXTDOMAIN_ADMIN) . '<a href="http://www.google.com/fonts" target="_blank">Google fonts</a>', 'key' => 'set_of_google_fonts', 'type' => 'multiplier', 'default' => '1', 'values' => array(array('name' => __('Font 1', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'font_item', 'type' => 'collapse_start'), array('name' => __('Fonts Faily', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'family', 'type' => 'select', 'values' => mmpm_get_googlefonts_list(), 'default' => 'Open Sans'), array('name' => __('', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'font_item', 'type' => 'collapse_end'))), array('name' => __('Additional Styles: ', MMPM_TEXTDOMAIN_ADMIN), 'descr' => __('Here you can add and edit highlighting styles.', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'additional_styles_presets', 'type' => 'multiplier', 'default' => '1', 'values' => array(array('name' => __('Style 1', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'additional_style_item', 'type' => 'collapse_start'), array('name' => __('Style Name', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'style_name', 'type' => 'textfield', 'default' => 'My Highlight Style'), array('name' => __('Text color', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'text_color', 'type' => 'color', 'default' => '#f8f8f8'), array('name' => __('Background Gradient (Color) ', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'bg_gradient', 'type' => 'gradient', 'default' => array('color1' => '#34495E', 'color2' => '#2C3E50', 'start' => '0', 'end' => '100', 'orientation' => 'top')), array('name' => __('Text color of the active item', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'text_color_hover', 'type' => 'color', 'default' => '#f8f8f8'), array('name' => __('Background Gradient (Color) of the active item', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'bg_gradient_hover', 'type' => 'gradient', 'default' => array('color1' => '#3d566e', 'color2' => '#354b60', 'start' => '0', 'end' => '100', 'orientation' => 'top')), array('name' => __('', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'additional_style_item', 'type' => 'collapse_end'))), array('name' => __('Custom Icons', MMPM_TEXTDOMAIN_ADMIN), 'descr' => __('You can add custom raster icons. After saving these settings, icons will become available in a modal window of icons selection. Recommended size 64x64 pixels.', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'set_of_custom_icons', 'type' => 'multiplier', 'default' => '1', 'values' => array(array('name' => __('Custom Icon 1', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'icon_item', 'type' => 'collapse_start'), array('name' => __('Icon File', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'custom_icon', 'type' => 'file', 'default' => MMPM_IMG_URI . '/megamain-logo-120x120.png'), array('name' => __('', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'icon_item', 'type' => 'collapse_end')))));
return array(array('title' => 'General', 'key' => 'general', 'icon' => 'im-icon-wrench-3', 'options' => $locations_options), array('title' => 'Skins', 'key' => 'skins', 'icon' => 'im-icon-brush', 'options' => $skins_options), array('title' => 'Specific Options', 'key' => 'specific_options', 'icon' => 'im-icon-hammer', 'options' => array(array('name' => __('Custom CSS', MMPM_TEXTDOMAIN_ADMIN), 'descr' => __('You can place here any necessary custom CSS properties.', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'custom_css', 'type' => 'textarea'), array('name' => __('Responsive for Handheld Devices', MMPM_TEXTDOMAIN_ADMIN), 'descr' => __('Enable responsive properties. If this option is enabled, then the menu will be transformed, if the user uses the handheld device.', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'responsive_styles', 'type' => 'checkbox', 'values' => array(__('Activate', MMPM_TEXTDOMAIN_ADMIN) => 'true'), 'default' => array('true')), array('name' => __('Use Coercive Styles', MMPM_TEXTDOMAIN_ADMIN), 'descr' => __('If this option is checked - all CSS properties for this plugin will be have "!important" priority.', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'coercive_styles', 'type' => 'checkbox', 'values' => array(__('Activate', MMPM_TEXTDOMAIN_ADMIN) => 'true')), array('name' => __('"Indefinite location" mode', MMPM_TEXTDOMAIN_ADMIN), 'descr' => __('<span style="color: #f11;">Warning:</span> If this option is checked - all menus will be replaced by the mega menu. This will be useful only for templates in which are not defined locations of the menu and template has only one menu.', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'indefinite_location_mode', 'type' => 'checkbox', 'values' => array(__('Activate', MMPM_TEXTDOMAIN_ADMIN) => 'true')), array('name' => __('Number of widget areas', MMPM_TEXTDOMAIN_ADMIN), 'descr' => __('Set here how many independent widget areas you need.', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'number_of_widgets', 'type' => 'number', 'min' => 1, 'max' => 100, 'units' => 'areas', 'values' => '1', 'default' => '1'))), array('title' => 'Settings of the structure', 'key' => 'structure_settings', 'icon' => 'im-icon-checkbox', 'options' => array(array('name' => __('Here you can deactivate the options that you do not use to customize the menu structure. This helps reduce the number of options and reduce the load on the server.', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'menu_structure_settings', 'type' => 'caption'), array('name' => __('Style of the item', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'item_style', 'type' => 'checkbox', 'values' => array(__('Disable', MMPM_TEXTDOMAIN_ADMIN) => 'disable')), array('name' => __('Icon of the item', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'item_icon', 'type' => 'checkbox', 'values' => array(__('Disable', MMPM_TEXTDOMAIN_ADMIN) => 'disable')), array('name' => __('Hide Icon of the Item', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'disable_icon', 'type' => 'checkbox', 'values' => array(__('Disable', MMPM_TEXTDOMAIN_ADMIN) => 'disable')), array('name' => __('Hide Text of the Item', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'disable_text', 'type' => 'checkbox', 'values' => array(__('Disable', MMPM_TEXTDOMAIN_ADMIN) => 'disable')), array('name' => __('Disable Link', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'disable_link', 'type' => 'checkbox', 'values' => array(__('Disable', MMPM_TEXTDOMAIN_ADMIN) => 'disable')), array('name' => __('Submenu Type', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'submenu_type', 'type' => 'checkbox', 'values' => array(__('Disable', MMPM_TEXTDOMAIN_ADMIN) => 'disable')), array('name' => __('Side of dropdown elements', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'submenu_drops_side', 'type' => 'checkbox', 'values' => array(__('Disable', MMPM_TEXTDOMAIN_ADMIN) => 'disable')), array('name' => __('Submenu Columns', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'submenu_columns', 'type' => 'checkbox', 'values' => array(__('Disable', MMPM_TEXTDOMAIN_ADMIN) => 'disable')), array('name' => __('Enable Full Width Dropdown', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'submenu_enable_full_width', 'type' => 'checkbox', 'values' => array(__('Disable', MMPM_TEXTDOMAIN_ADMIN) => 'disable')), array('name' => __('Dropdown Background Image', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'submenu_bg_image', 'type' => 'checkbox', 'values' => array(__('Disable', MMPM_TEXTDOMAIN_ADMIN) => 'disable')))), array('title' => 'Support & Suggestions', 'key' => 'support', 'icon' => 'im-icon-support', 'options' => array(array('name' => __('', MMPM_TEXTDOMAIN_ADMIN), 'key' => 'support', 'type' => 'just_html', 'default' => '<br /><br /> <a href="http://manual.menu.megamain.com/" target="_blank">Online documentation</a>. <br /><br /> If you need support, <br /> If you have a question or suggestion - <br /> Leave a message on our support page <br /> <a href="http://support.megamain.com/?ref=' . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] . '" target="_blank">Support.MegaMain.com</a> (in new window).'))));
// END FRIMARY ARRAY
}
开发者ID:ntnvu,项目名称:tcb_online,代码行数:38,代码来源:theme_options_array.php
示例3: subscribe_if_not_subscribed
public function subscribe_if_not_subscribed()
{
global $bc_accounts;
$accounts = $bc_accounts->get_sanitized_all_accounts();
$completed_accounts = array();
foreach ($accounts as $account => $account_data) {
// We may have multiple accounts for an account_id, prevent syncing that account more than once.
if (!in_array($account_data['account_id'], $completed_accounts)) {
$completed_accounts[] = $account_data['account_id'];
$bc_accounts->set_current_account($account);
$subscriptions = $this->cms_api->get_subscriptions();
if (is_array($subscriptions)) {
foreach ($subscriptions as $subscription) {
if ($bc_accounts->get_account_id() === $subscription['service_account'] && isset($subscription['id']) && false !== strpos($subscription['endpoint'], get_admin_url())) {
$this->cms_api->remove_subscription($subscription['id']);
}
}
}
$subscription_status = $this->cms_api->add_subscription();
if (is_wp_error($subscription_status)) {
$bc_accounts->restore_default_account();
return false;
}
if (isset($subscription_status['id']) && $subscription_status['service_account'] === $bc_accounts->get_account_id()) {
$subscription_id = BC_Utility::sanitize_subscription_id($subscription_status['id']);
update_option($this->get_option_key_for($bc_accounts->get_account_id()), $subscription_id);
}
$bc_accounts->restore_default_account();
}
}
}
开发者ID:gopinathshiva,项目名称:wordpress-vip-plugins,代码行数:31,代码来源:class-bc-notifications.php
示例4: nebula_admin_bar_nebula_wireframing
function nebula_admin_bar_nebula_wireframing($wp_admin_bar)
{
$wp_admin_bar->add_node(array('id' => 'nebula-wireframing', 'title' => '<i class="fa fa-fw fa-sitemap" style="font-family: \'FontAwesome\'; color: #a0a5aa; color: rgba(240,245,250,.6); margin-right: 5px;"></i> Wireframing Enabled', 'href' => get_admin_url() . 'themes.php?page=nebula_options'));
$wp_admin_bar->add_node(array('parent' => 'nebula-wireframing', 'id' => 'nebula-wireframing-help', 'title' => '<i class="nebula-admin-fa fa fa-fw fa-question" style="font-family: \'FontAwesome\'; color: #a0a5aa; color: rgba(240, 245, 250, .6); margin-right: 5px;"></i> Help & Documentation »', 'href' => 'https://gearside.com/nebula/documentation/custom-functionality/wireframing/', 'meta' => array('target' => '_blank')));
$wp_admin_bar->remove_menu('wpseo-menu');
//SEO menu not important during wireframing
}
开发者ID:KevinFairbanks,项目名称:Nebula,代码行数:7,代码来源:nebula_wireframing.php
示例5: eventon_admin_help_tab_content
/** Help Tab Content*/
function eventon_admin_help_tab_content()
{
$screen = get_current_screen();
ob_start();
?>
<p><b>EventON WP Event Calendar General Information.</b></p>
<p><a class='evo_admin_btn btn_prime' href='<?php
echo get_admin_url();
?>
index.php?page=evo-getting-started'>Getting started guide to eventON</a></p>
<p>All the updated documentation for eventON can be found from our <a class='evo_admin_btn btn_triad'href='http://www.myeventon.com/documentation/'>online documentation library.</a></p>
<?php
$content = ob_get_clean();
ob_start();
?>
<p><b>Support for EventON Calendar</b></p>
<p>We provide support for issues directly related to eventON calendar via our <a href='http://helpdesk.ashanjay.com' target='_blank' class='evo_admin_btn btn_triad'>HelpDesk</a> EventON valid purchase code is required to access helpdesk if eventON came bundled with your theme.</p>
<p>Before creating a ticket, please check the troubleshooter guide that can very well help you solve your issue by trying our common solutions.</p>
<p>Please check out our <a href='http://www.myeventon.com/documentation/check-eventon-working/' class='evo_admin_btn btn_triad' target='_blank' >troubleshooter guide to eventon</a></p>
<?php
$support = ob_get_clean();
$screen->add_help_tab(array('id' => 'eventon_overview_tab', 'title' => __('General', 'eventon'), 'content' => $content));
$screen->add_help_tab(array('id' => 'eventon_overview_tab_s', 'title' => __('Support', 'eventon'), 'content' => $support));
$screen->set_help_sidebar('<p><strong>' . __('For more information:', 'eventon') . '</strong></p>' . '<p><a href="http://www.myeventon.com/" target="_blank">' . __('EventON', 'eventon') . '</a></p>' . '<p><a href="http://www.myeventon.com/changelog/" target="_blank">' . __('Changelog', 'eventon') . '</a></p>' . '<p><a href="http://www.myeventon.com/documentation/" target="_blank">' . __('Documentation', 'eventon') . '</a></p>' . '<p><a href="http://www.myeventon.com/addons/" target="_blank">' . __('Addons', 'eventon') . '</a></p>' . '<p><a href="http://helpdesk.ashanjay.com" target="_blank">' . __('Helpdesk', 'eventon') . '</a></p>');
}
开发者ID:pab44,项目名称:pab44,代码行数:26,代码来源:eventon-admin-content.php
示例6: rt_of_options_array
function rt_of_options_array()
{
$of_options = array();
/*-----------------------------------------------------------------------------------*/
/* The Options Array */
/*-----------------------------------------------------------------------------------*/
// Theme Setup
$of_options[] = array("name" => __("Theme Setup", RT_LANGUAGE), "id" => "theme_setup", "type" => "heading");
$of_options[] = array("name" => __("Register page link", RT_LANGUAGE), "id" => "theme_setup_register_page_link", "std" => "", "type" => "text");
$of_options[] = array("name" => __("Enable admin theme", RT_LANGUAGE), "id" => "theme_setup_admin_theme", "std" => "default", "type" => "select", "options" => array("default" => __("Default", RT_LANGUAGE), "admin-theme-1" => __("Admin Theme 1", RT_LANGUAGE)));
$of_options[] = array("name" => __("Support Developer Level 1", RT_LANGUAGE), "id" => "theme_setup_developer_level_1", "std" => 1, "on" => "Enable", "off" => "Disable", "type" => "switch");
$of_options[] = array("name" => __("Enable Customer Support", RT_LANGUAGE), "desc" => __('Disable this feature If you are a developer', RT_LANGUAGE), "id" => "theme_setup_customer_support", "std" => 1, "on" => "Enable", "off" => "Disable", "type" => "switch");
$of_options[] = array("name" => __("Enable Top Header", RT_LANGUAGE), "id" => "theme_setup_top_header", "std" => 0, "on" => "Enable", "off" => "Disable", "type" => "switch");
$of_options[] = array("name" => __("Enable Banner side out", RT_LANGUAGE), "desc" => __('Enable to use banner side out. Click <a target="_blank" href="' . get_admin_url() . '/options-general.php?page=float_left_right_ads.php">Here</a> to setup banner', RT_LANGUAGE), "id" => "theme_setup_banner_side_out_enable", "std" => 0, "on" => "Enable", "off" => "Disable", "type" => "switch");
$of_options[] = array("name" => __("Enable Statistic", RT_LANGUAGE), "desc" => __('Enabled Statistics to measure website traffic', RT_LANGUAGE), "id" => "theme_setup_statistics", "std" => 0, "on" => "Enable", "off" => "Disable", "type" => "switch");
// Single Woocommerce
$of_options[] = array("name" => __("Custom Woocommerce", RT_LANGUAGE), "id" => "custom_woocommerce", "type" => "heading");
$of_options[] = array("name" => __("Enable Compare Products", RT_LANGUAGE), "desc" => __('Enable/Disable Compare products. Click <a target="_blank" href="' . get_admin_url() . '/admin.php?page=yith_woocompare_panel">Here</a> to setup feature.', RT_LANGUAGE), "id" => "woocommerce_compare_products", "std" => 0, "on" => "Enable", "off" => "Disable", "type" => "switch");
$of_options[] = array("name" => __("Enable Wishlist Products", RT_LANGUAGE), "desc" => __('Enable/Disable Wishlist products.', RT_LANGUAGE), "id" => "woocommerce_wishlist_products", "std" => 0, "on" => "Enable", "off" => "Disable", "type" => "switch");
$of_options[] = array("name" => __("Shop Page", RT_LANGUAGE), "desc" => "", "id" => "shop_page_code", "std" => "<h3 style='margin: 0;'>" . __("Shop Page", RT_LANGUAGE) . "</h3>", "icon" => true, "type" => "info");
$of_options[] = array("name" => __("Shop Page Filter Display?", RT_LANGUAGE), "desc" => __("Enable/Disable filter on shop page", RT_LANGUAGE), "id" => "woocommerce_shop_filter_display", "std" => 0, "on" => "Enable", "off" => "Disable", "type" => "switch");
$of_options[] = array("name" => __("Shop Page Thumbnail Hover Effect", RT_LANGUAGE), "desc" => __("Choose Thumbnail Hover Effect in Shop Page", RT_LANGUAGE), "id" => "woocommerce_shop_thumb_hover_effect", "std" => "default", "type" => "select", "options" => array("default" => __("Default", RT_LANGUAGE), "hover-zoom" => __("Zoom Thumbnail", RT_LANGUAGE)));
$of_options[] = array("name" => __("Shop Page Thumbnail Click Effect", RT_LANGUAGE), "desc" => __("Choose Thumbnail Click Effect in Shop Page", RT_LANGUAGE), "id" => "woocommerce_shop_thumb_click_effect", "std" => "default", "type" => "select", "options" => array("default" => __("Default", RT_LANGUAGE), "popup-image" => __("Popup Image", RT_LANGUAGE), "popup-image-zoom" => __("Popup Image and Zoom", RT_LANGUAGE), "popup-gallery" => __("Popup Gallery", RT_LANGUAGE), "popup-gallery-zoom" => __("Popup Gallery and Zoom", RT_LANGUAGE)));
$of_options[] = array("name" => __("Single Product", RT_LANGUAGE), "desc" => "", "id" => "single_product_code", "std" => "<h3 style='margin: 0;'>" . __("Single Product", RT_LANGUAGE) . "</h3>", "icon" => true, "type" => "info");
$of_options[] = array("name" => __("Enable Zoom Thumbnail", RT_LANGUAGE), "desc" => __('Enable to use zoom thumbnail effect. Click <a target="_blank" href="' . get_admin_url() . '/admin.php?page=yith_woocommerce_zoom-magnifier_panel">Here</a> to setup effect.', RT_LANGUAGE), "id" => "woocommerce_product_zoom_thumb", "std" => 0, "on" => "Enable", "off" => "Disable", "type" => "switch");
$of_options[] = array("name" => __("Single Product thumbnail gallery design", RT_LANGUAGE), "desc" => __("Choose if the thumbnail gallery on the single product page are vertical or horizontal.", RT_LANGUAGE), "id" => "woocommerce_product_thumb_design", "std" => "horizontal", "type" => "select", "options" => array("horizontal" => __("Horizontal Design", RT_LANGUAGE), "vertical" => __("Vertical Design", RT_LANGUAGE)));
// Custom Blog
$of_options[] = array("name" => __("Custom Blog", RT_LANGUAGE), "id" => "heading_custom_blog", "type" => "heading");
$of_options[] = array("name" => __("General Blog Options", "Avada"), "desc" => "", "id" => "custom_blog_single_post", "std" => "<h3 style='margin: 0;'>" . __("General Blog Options", "Avada") . "</h3>", "icon" => true, "type" => "info");
$of_options[] = array("name" => __("Blog Archive/Category Layout", RT_LANGUAGE), "desc" => __("Select the layout for the blog archive/category pages.", RT_LANGUAGE), "id" => "custom_blog_archive_layout", "std" => "Large", "type" => "select", "options" => array('' => 'None', 'medium-1' => 'Medium 1'));
return $of_options;
}
开发者ID:anhtuan64,项目名称:sage,代码行数:32,代码来源:func-options.php
示例7: dt_metabox_benefits_options
function dt_metabox_benefits_options($post)
{
$box_name = 'dt_benefits_options';
$defaults = array('retina_image' => '', 'retina_image_w' => 0, 'retina_image_h' => 0, 'retina_image_id' => null);
$opts = get_post_meta($post->ID, '_' . $box_name, true);
$opts = wp_parse_args(maybe_unserialize($opts), $defaults);
// Use nonce for verification
wp_nonce_field(plugin_basename(__FILE__), $box_name . '_nonce');
// image
$img_id = '<input type="hidden" value="' . $opts['retina_image_id'] . '" class="dt-uploader-textfield dt-get-id" name="' . $box_name . '_retina_image_id" />';
// upload button
$upload = dt_melement('link', array('description' => _x('Upload Image', 'backend benefits', LANGUAGE_ZONE), 'class' => 'dt-uploader-opener button-primary thickbox', 'href' => get_admin_url() . 'media-upload.php?post_id=' . $post->ID . '&type=image&TB_iframe=1&width=640&height=310'));
// delete button
$delete = dt_melement('link', array('description' => _x('Clear', 'backend benefits', LANGUAGE_ZONE), 'class' => 'dt-uploader-delete button', 'href' => '#'));
?>
<p class="dt_switcher-box"><?php
if ($opts['retina_image_id']) {
$img = wp_get_attachment_image_src($opts['retina_image_id'], 'medium');
if ($img) {
$size = wp_constrain_dimensions($img[1], $img[2], 266, 266);
echo '<img class="attachment-266x266 dt-thumb" src="' . $img[0] . '" ' . image_hwstring($size[0], $size[1]) . ' />';
}
}
echo $img_id . $upload . $delete;
?>
</p>
<?php
}
开发者ID:mnjit,项目名称:aa-global,代码行数:30,代码来源:metaboxes.php
示例8: setopt_admin_notice
/**
* Print a reminder message for set the options after the theme is installed or updated
*/
function setopt_admin_notice()
{
$screen = get_current_screen();
if (current_user_can('manage_options') && $screen->id !== 'appearance_page_fastfood_options' && version_compare(FastfoodOptions::get_opt('version', '0'), fastfood_get_info('version'), '<')) {
echo '<div class="update-nag"><strong>' . sprintf(__('%1$s theme says: Dont forget to set <a href="%2$s">my options</a>!', 'fastfood'), 'Fastfood', get_admin_url() . 'themes.php?page=' . $this->option_name) . '</strong></div>';
}
}
开发者ID:TwoBeers,项目名称:fastfood,代码行数:10,代码来源:admin.php
示例9: _validate_form
protected function _validate_form()
{
if (isset($_POST['vimeography_basic_settings']) && check_admin_referer('vimeography-gallery-action', 'vimeography-gallery-verification')) {
try {
$input = $_POST['vimeography_basic_settings'];
if (empty($input['gallery_title']) or empty($input['source_url'])) {
throw new Exception(__('Make sure you fill out all of the fields below!'));
}
global $wpdb;
$settings['gallery_title'] = $wpdb->escape(wp_filter_nohtml_kses($input['gallery_title']));
$settings['source_url'] = $wpdb->escape(wp_filter_nohtml_kses($input['source_url']));
$result = $wpdb->insert(VIMEOGRAPHY_GALLERY_TABLE, array('title' => $settings['gallery_title'], 'date_created' => current_time('mysql'), 'is_active' => 1));
if (!$result) {
throw new Exception(__('We couldn\'t create a new gallery. Try upgrading or reinstalling the Vimeography plugin.'));
} else {
$gallery_id = $wpdb->insert_id;
$result = $wpdb->insert(VIMEOGRAPHY_GALLERY_META_TABLE, array('gallery_id' => $gallery_id, 'source_url' => $settings['source_url'], 'video_limit' => 20, 'featured_video' => NULL, 'gallery_width' => NULL, 'cache_timeout' => 3600, 'theme_name' => 'bugsauce'));
if (!$result) {
throw new Exception(__('We couldn\'t save your gallery settings. Try reinstalling the Vimeography plugin.'));
}
}
wp_redirect(get_admin_url() . 'admin.php?page=vimeography-edit-galleries&id=' . $gallery_id . '&created=1');
exit;
} catch (Exception $e) {
require_once ABSPATH . 'wp-admin/admin-header.php';
$this->messages[] = array('type' => 'error', 'heading' => 'Ruh roh.', 'message' => $e->getMessage());
}
}
}
开发者ID:robjcordes,项目名称:nexnewwp,代码行数:29,代码来源:new.php
示例10: add_switcher
function add_switcher()
{
// Tester si le multisite est activié
if (!function_exists('is_multisite') || !is_multisite()) {
return false;
}
// Blogs de l'utilisateur actuel
global $current_user;
$blogs = get_blogs_of_user($current_user->id, true);
// Il faut plus d'un blog pour avoir le menu déroulant
if (count($blogs) <= 1) {
return false;
}
$current_blogurl = get_bloginfo('url');
echo '<form style="float:left;min-width:150px;margin:10px 0 0 40px;" action="" method="post">';
wp_nonce_field('multisite-switcher');
echo 'Switch Backend: ';
echo '<select onchange="location.href=this.value;" id="multisiteswitcher" name="multisiteswitcher">';
foreach ($blogs as $blog) {
echo '<option ' . selected($blog->siteurl, $current_blogurl, false) . ' value="' . esc_url(get_admin_url($blog->userblog_id)) . '">' . $blog->blogname . '</option>';
}
echo '</select>';
echo '<noscript> <input class="button-secondary action" type="submit" value="Go"/></noscript>';
echo '</form>';
}
开发者ID:huyz,项目名称:Wordpress-Plugins,代码行数:25,代码来源:multisite-switcher.php
示例11: update_notifier_bar_menu
function update_notifier_bar_menu()
{
if (function_exists('simplexml_load_string')) {
// Stop if simplexml_load_string funtion isn't available
global $wp_admin_bar, $wpdb;
if (!is_super_admin() || !is_admin_bar_showing()) {
// Don't display notification in admin bar if it's disabled or the current user isn't an administrator
return;
}
$xml = get_latest_theme_version(NOTIFIER_CACHE_INTERVAL);
// Get the latest remote XML file on our server
// get version
if (function_exists('wp_get_theme')) {
$theme_data = wp_get_theme(get_template());
$version = $theme_data->version;
} else {
$theme_data = get_theme_data(get_template_directory() . '/style.css');
$version = $theme_data['Version'];
}
if (!is_object($xml)) {
return;
}
if (version_compare($xml->latest, $version, '>')) {
// Compare current theme version with the remote XML version
$wp_admin_bar->add_menu(array('id' => 'update_notifier', 'title' => '<span>' . NOTIFIER_THEME_NAME . ' <span id="ab-updates">1 Update</span></span>', 'href' => get_admin_url() . 'index.php?page=theme-update-notifier'));
}
}
}
开发者ID:GaryJones,项目名称:goombiel,代码行数:28,代码来源:update-notifier.php
示例12: wpmuNewBlog
/**
* Runs activation function and sets up default WP options for new blog,
* a.k.a. when a registered user creates a new blog
*
* @param int $blog_id
* @param int $user_id
*
* @see add_action( 'wpmu_new_blog', ... )
*/
function wpmuNewBlog($blog_id, $user_id)
{
$this->blog_id = (int) $blog_id;
$this->user_id = (int) $user_id;
switch_to_blog($this->blog_id);
if (!$this->isBookSetup()) {
$this->wpmuActivate();
array_walk($this->opts, function ($v, $k) {
if (empty($v)) {
delete_o
|
请发表评论