本文整理汇总了PHP中get_screen_icon函数的典型用法代码示例。如果您正苦于以下问题:PHP get_screen_icon函数的具体用法?PHP get_screen_icon怎么用?PHP get_screen_icon使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_screen_icon函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sjs_PUbox_disp_options_page
function sjs_PUbox_disp_options_page()
{
//the action options.php can be accessed by url manipulation,we have to make sure when we create options for the plugin it shows up here in the options.php page
//enctype is used here to ensure that user can upload things
?>
<div class="wrap">
<?php
get_screen_icon();
?>
<h2>PU box Options Settings</h2>
<form method="post" action="options.php" enctype="multipart/form-data">
<?php
settings_fields('sjs_PUbox_group');
//provides hidden inputs and nonces for security@params:group name
?>
<?php
do_settings_sections(__FILE__);
?>
<p class="submit">
<input type="submit" name="submit" class="button-primary" value="Apply Changes">
</p>
</form>
</div>
<?php
}
示例2: render_settings_page
/**
* Render settings page. This function should echo the HTML form of the settings page.
*/
public function render_settings_page($post)
{
?>
<div class="wrap">
<?php
echo get_screen_icon('options-general');
?>
<h2><?php
echo $this->page_title;
?>
</h2>
<div class="intro">
<p>This is the intro text</p>
</div>
<?php
settings_errors();
print_r($this->get_settings_data());
?>
<form method="post" action="options.php">
<?php
echo $this->settings_fields($this->option_group);
?>
<table class="form-table">
<tr>
<th><label for="<?php
echo esc_attr('footer');
?>
"><?php
echo esc_attr('Footer Text');
?>
</label></th>
<td>
<input type="text" id="<?php
echo esc_attr('footer');
?>
" name="<?php
echo esc_attr($this->option_name . "[footer]");
?>
" value="<?php
echo esc_attr($this->get_data('footer'));
?>
" />
</td>
</tr>
</table>
<?php
submit_button('Save Options', 'primary', 'submit', false);
?>
<?php
submit_button('Restore Defaults', 'secondary', 'reset', false);
?>
</form>
</div><?php
}
示例3: get_screen_icon
protected function get_screen_icon($icon)
{
global $wp_version;
if (version_compare($wp_version, '3.7', '<=')) {
// WP 3.7 and below
return get_screen_icon($icon);
}
return '';
// Screen icons are no longer used as of WordPress 3.8
}
示例4: get_header
/**
* Generate header HTML.
* @access public
* @since 1.0.0
* @return void
*/
public static function get_header($token = 'woothemes-updater', $screen_icon = 'tools')
{
do_action('woothemes_updater_screen_before', $token, $screen_icon);
$html = '<div class="wrap woothemes-updater-wrap">' . "\n";
$html .= get_screen_icon($screen_icon);
$html .= '<h2 class="nav-tab-wrapper">' . "\n";
$html .= self::get_navigation_tabs();
$html .= '</h2>' . "\n";
echo $html;
do_action('woothemes_updater_screen_header_before_content', $token, $screen_icon);
}
示例5: main
function main()
{
if ($_POST) {
self::save_settings($_POST);
}
global $mf_domain;
print '<div class="wrap">';
// the title needs a hat icon
echo get_screen_icon('magic-fields');
print '<h2>' . __('Magic Fields Settings', $mf_domain) . '</h2>';
$options = self::fields_form();
self::form_options($options);
print '</div>';
}
示例6: get_header
/**
* Generate header HTML.
* @access public
* @since 6.0.0
* @return void
*/
public static function get_header($token = 'woothemes', $screen_icon = 'themes')
{
do_action('wf_screen_before', $token, $screen_icon);
do_action('wf_screen_before_' . esc_attr($token), $token, $screen_icon);
$html = '<div class="wf-wrap wrap">' . "\n";
$html .= get_screen_icon($screen_icon);
$html .= '<h2 class="nav-tab-wrapper">' . "\n";
$html .= self::get_navigation_tabs();
$html .= self::get_admin_branding();
$html .= '</h2>' . "\n";
echo $html;
do_action('wf_screen_header_before_content', $token, $screen_icon);
do_action('wf_screen_header_before_content_' . esc_attr($token), $token, $screen_icon);
}
示例7: woo_help
function woo_help()
{
?>
<div class='wrap'>
<?php
get_screen_icon();
?>
<h3>Use the shortcode [product-cat] inside any WordPress post or page to view category wise WooCommerce
product listing. </h3>
<h4>WooCommerce must be installed to use this plugin.</h4>
</div>
<?php
}
开发者ID:abdulahad16,项目名称:WooCommerce-Tabbed-Category-Wise-Product-Listing,代码行数:15,代码来源:woo-cat-product.php
示例8: render_settings_page
/**
* Render settings page. This function should echo the HTML form of the settings page.
*/
public function render_settings_page($post)
{
$this->view->set_view_file(CYCLONE_PATH . 'views/settings-page.php');
$settings_data = $this->get_settings_data();
$templates = $this->templates_manager->get_all_templates();
$settings_data['load_templates'] = $this->templates_manager->get_active_templates($settings_data);
// Filter load templates
$vars = array();
$vars['page_title'] = $this->page_title;
$vars['screen_icon'] = get_screen_icon('options-general');
$vars['settings_fields'] = $this->settings_fields($this->option_group);
$vars['option_name'] = $this->option_name;
$vars['templates'] = $templates;
$vars['settings_data'] = $settings_data;
$vars['debug'] = CYCLONE_DEBUG ? cyclone_slider_debug($vars['settings_data']) : '';
$this->view->set_vars($vars);
$this->view->render();
}
示例9: render_page
/**
* Render page. This function should output the HTML of the page.
*/
public function render_page($post)
{
?>
<div class="wrap">
<?php
echo get_screen_icon('options-general');
?>
<h2><?php
echo $this->page_title;
?>
</h2>
<div class="intro">
<p>This is the intro text</p>
</div>
<form method="post" action="">
<table class="form-table">
<tr>
<th><label for="<?php
echo esc_attr('sample_text');
?>
"><?php
echo esc_attr('Sample Text');
?>
</label></th>
<td>
<input type="text" id="sample_text" name="sample_text" value="" />
</td>
</tr>
</table>
<?php
submit_button('Save Options', 'primary', 'submit', false);
?>
<?php
submit_button('Restore Defaults', 'secondary', 'reset', false);
?>
</form>
</div><?php
}
示例10: render_settings_page
/**
* Render settings page. This function should echo the HTML form of the settings page.
*/
public function render_settings_page($post)
{
global $wp_version;
$vars = array();
$vars['page_title'] = $this->page_title;
$vars['textdomain'] = $this->plugin['textdomain'];
if (version_compare($wp_version, '3.7', '<=')) {
// WP 3.7 and below
$vars['screen_icon'] = get_screen_icon('options-general');
} else {
// WP 3.8+
$vars['screen_icon'] = '';
// Screen icons are no longer used as of WordPress 3.8
}
$vars['settings_fields'] = $this->settings_fields($this->plugin['settings_page.option_group']);
$vars['option_name'] = $this->plugin['settings_page.option_name'];
$vars['settings_data'] = $this->get_settings_data();
$debug = filter_var(trim(print_r($vars['settings_data'], true)), FILTER_SANITIZE_FULL_SPECIAL_CHARS);
$vars['debug'] = $this->plugin['debug'] ? '<pre>' . $debug . '</pre>' : '';
$this->plugin['view']->render('settings-page.php', $vars);
}
示例11: options_page_tabs
public function options_page_tabs($current = 'basic')
{
if (isset($_GET['tab'])) {
$current = $_GET['tab'];
} else {
$current = 'basic';
}
$tabs = $this->get_settings_page_tabs();
$links = array();
foreach ($tabs as $tab => $name) {
if ($tab == $current) {
$links[] = "<a class=\"nav-tab nav-tab-active\" href=\"?page=mangapress-options-page&tab={$tab}\">{$name}</a>";
} else {
$links[] = "<a class=\"nav-tab\" href=\"?page=mangapress-options-page&tab={$tab}\">{$name}</a>";
}
}
echo get_screen_icon();
echo '<h2 class="nav-tab-wrapper">';
foreach ($links as $link) {
echo $link;
}
echo '</h2>';
}
示例12: screen_icon_link
public function screen_icon_link($name = 'aaron')
{
$link = '<a href="http://aarondcampbell.com">';
if (function_exists('get_screen_icon')) {
$link .= get_screen_icon($name);
} else {
ob_start();
screen_icon($name);
$link .= ob_get_clean();
}
$link .= '</a>';
echo apply_filters('rpf-screen_icon_link', $link, $name);
}
示例13: admin_screen
/**
* admin_screen()
*
* Load the admin screen.
*
* @since 1.0.0
*/
function admin_screen()
{
$export_type = 'all';
if (isset($_POST['export-type'])) {
$export_type = esc_attr($_POST['export-type']);
}
?>
<div class="wrap">
<?php
echo get_screen_icon($screen = 'import-export');
?>
<h2><?php
_e('Import / Export');
?>
</h2>
<div class="import">
<h3><?php
_e('Import Settings');
?>
</h3>
<p><?php
_e('If you have settings in a backup file on your computer, the Import / Export system can import those into this site. To get started, upload your backup file to import from below.');
?>
</p>
<form enctype="multipart/form-data" method="post"
action="<?php
echo admin_url('admin.php?page=' . $this->token);
?>
">
<?php
wp_nonce_field('OptionsFramework-backup-import');
?>
<label for="OptionsFramework-import-file"><?php
printf(__('Upload File: (Maximum Size: %s)'), ini_get('post_max_size'));
?>
</label>
<input type="file" id="OptionsFramework-import-file" name="OptionsFramework-import-file" size="25"/>
<input type="hidden" name="OptionsFramework-backup-import" value="1"/>
<input type="submit" class="button" value="<?php
_e('Upload File and Import');
?>
"/>
</form>
</div>
<div class="export">
<h3><?php
_e('Export Settings');
?>
</h3>
<p><?php
_e('When you click the button below, the Import / Export system will create a text file for you to save to your computer.');
?>
</p>
<p><?php
echo sprintf(__('This text file can be used to restore your settings here on "%s", or to easily setup another website with the same settings".'), get_bloginfo('name'));
?>
</p>
<form method="post" action="<?php
echo admin_url('admin.php?page=' . $this->token);
?>
">
<?php
wp_nonce_field('OptionsFramework-backup-export');
?>
<input type="hidden" name="OptionsFramework-backup-export" value="1"/>
<input type="submit" class="button"
value="<?php
_e('Download Export File', 'OptionsFramework');
?>
"/>
</form>
</div>
</div><!--/.wrap-->
<?php
}
示例14: render_header
/**
* Display Plugin Title and if needed tabbed navigation.
*
* @since 2.0
* @param string $plugin_title Plugin title.
* @param string $tab_id Page id. Manually set the active tab.
* @return void
*/
public function render_header($plugin_title = '', $tab_id = false)
{
if (!empty($plugin_title)) {
echo get_screen_icon() . '<h2>' . (string) $plugin_title . '</h2>';
}
// if ( !$this->valid_pages )
// return;
$page_title_count = 0;
foreach ($this->pages as $page) {
if (isset($page['title']) && $page['title']) {
++$page_title_count;
}
}
$html = '';
$current = $this->current_page;
$page_ids = wp_list_pluck($this->pages, 'id');
$cur_tab_id = $tab_id ? (string) $tab_id : $current['id'];
$cur_tab_id = in_array($cur_tab_id, $page_ids) ? $cur_tab_id : $current['id'];
$i = 0;
foreach ($this->pages as $page) {
if (isset($page['title']) && $page['title']) {
if ($page_title_count > 1) {
$html .= 0 === $i ? '<h2 class="nav-tab-wrapper">' : '';
$active = '';
if ($cur_tab_id === $page['id']) {
$active = ' nav-tab-active';
}
// Get the url of the current settings page.
$tab_url = remove_query_arg(array('tab', 'settings-updated'));
// Add query arg 'tab' if it's not the first settings page.
if ($this->pages[0]['id'] !== $page['id']) {
$tab_url = add_query_arg('tab', $page['slug'], $tab_url);
}
$html .= sprintf('<a href="%1$s" class="nav-tab%2$s" id="%3$s-tab">%4$s</a>', esc_url($tab_url), $active, esc_attr($page['id']), $page['title']);
$html .= ++$i === $page_title_count ? '</h3>' : '';
}
if ($page_title_count === 1) {
if (isset($current['title']) && $current['title'] === $page['title']) {
$html .= '<h3>' . $page['title'] . '</h3>';
break;
}
}
}
}
echo $html;
}
示例15: form
/**
* Output the settings page, if one has been hooked to the current admin page, and output
* the settings sections hooked to the current admin page/tab.
*
* WordPress core icons that can be used for the page and tab icons.
* - index
* - tools
* - edit
* - upload
* - link-manager
* - edit-pages
* - edit-comments
* - themes
* - plugins
* - users
* - options-general
*
* @author Steven A. Zahm
* @since 0.7.3.0
* @param string $pageHook
* @param bool $return [optional]
* @return string
*/
public function form($pageHook, $args = array())
{
$defaults = array('page_title' => '', 'page_icon' => '', 'tab_icon' => '');
$args = wp_parse_args($args, $defaults);
//var_dump($args);
$out = '';
$sort = array();
// Page icon.
if (!empty($args['page_icon'])) {
echo get_screen_icon($args['page_icon']);
}
// Page title.
if (!empty($args['page_title'])) {
echo '<h2>', $args['page_title'], '</h2>';
}
// Display any registered settings errors and success messages.
settings_errors();
// Display the tab icon
if (!empty($args['tab_icon'])) {
echo get_screen_icon($args['tab_icon']);
}
// If the page hook was not supplied echo an empty string.
if (!empty($pageHook)) {
$tabs = $this->tabs[$pageHook];
//var_dump($this->tabs[$pageHook]);
// If there were no tabs returned echo out an empty string.
if (!empty($tabs)) {
echo '<h2 class="nav-tab-wrapper">';
// Store the position values so an array multi sort can be done to postion the tabs in the desired order.
foreach ($tabs as $key => $tab) {
$sort[] = isset($tab['position']) && !empty($tab['position']) ? $tab['position'] : 0;
}
// Sort the tabs based on their position.
array_multisort($sort, $tabs);
// If the current tab isn't set, set the current tab to the intial tab in the array.
$currentTab = isset($_GET['tab']) ? $_GET['tab'] : $tabs[0]['id'];
foreach ($tabs as $tab) {
// Only show tabs registered to the current page.
if (!isset($tab['page_hook']) || $tab['page_hook'] !== $pageHook) {
continue;
}
echo '<a class="nav-tab' . ($currentTab === $tab['id'] ? ' nav-tab-active' : '') . '" href="' . add_query_arg('tab', $tab['id']) . '">' . $tab['title'] . '</a>';
}
echo '</h2>';
}
}
echo '<form method="post" action="options.php">';
/*
* If tabs were registered to the current page, set the hidden fields with the current tab id
* appended to the page hook. If this is not done the settings registered to the current tab will
* not be saved.
*/
//global $new_whitelist_options;print_r($new_whitelist_options);
settings_fields(isset($currentTab) && !empty($currentTab) ? $pageHook . '-' . $currentTab : $pageHook);
/*
* Output any fields that were not registered to a specific section and defaulted to the default section.
* Mimics default core WP behaviour.
*/
echo '<table class="form-table">';
do_settings_fields(isset($currentTab) && !empty($currentTab) ? $pageHook . '-' . $currentTab : $pageHook, 'default');
echo '</table>';
/*
* Reference:
* http://codex.wordpress.org/Function_Reference/do_settings_sections
*
* If the section is hooked into a tab add the current tab to the page hook
* so only the settings registered to the current tab are displayed.
*/
do_settings_sections(isset($currentTab) && !empty($currentTab) ? $pageHook . '-' . $currentTab : $pageHook);
submit_button();
echo '</form>';
}