本文整理汇总了PHP中get_current_screen函数的典型用法代码示例。如果您正苦于以下问题:PHP get_current_screen函数的具体用法?PHP get_current_screen怎么用?PHP get_current_screen使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_current_screen函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wp_user_profiles_add_contextual_help
/**
* Add contextual help
*
* @since 0.2.0
*/
function wp_user_profiles_add_contextual_help()
{
// Static sidebar
get_current_screen()->set_help_sidebar('<p>' . esc_html__('Some information may be displayed publicly on the site.', 'wp-user-profiles') . '</p>' . '<p>' . esc_html__('Always use a strong password, and never give your login information to anyone.', 'wp-user-profiles') . '</p>');
// Allow plugins to easily hook in
do_action('wp_user_profiles_add_contextual_help');
}
示例2: WP_CMR_List_Table
/**
* Setup options mostly.
*
* @todo Get list of displayed columns from options
*
*/
function WP_CMR_List_Table($args = '')
{
$args = wp_parse_args($args, array('plural' => '', 'iColumns' => 3, 'per_page' => 20, 'iDisplayStart' => 0, 'ajax_action' => 'wp_crm_list_table', 'current_screen' => '', 'table_scope' => '', 'singular' => '', 'ajax' => false));
$this->_args = $args;
if (empty($this->_args['current_screen'])) {
$screen = get_current_screen();
$this->_args['current_screen'] = $screen->id;
}
//* Returns columns, hidden, sortable */
list($columns, $hidden) = $this->get_column_info();
//** Build aoColumns for ajax return */
$column_count = 0;
foreach ($columns as $column_slug => $column_title) {
if (in_array($column_slug, $hidden)) {
$column_visible = 'false';
} else {
$column_visible = 'true';
}
$this->aoColumns[] = "{ 'sClass': '{$column_slug} column-{$column_slug}', 'bVisible': {$column_visible}}";
$this->aoColumnDefs[] = "{ 'sName': '{$column_slug}', 'aTargets': [{$column_count}]}";
$this->column_ids[$column_count] = $column_slug;
$column_count++;
}
$this->_args['iColumns'] = count($this->aoColumns);
}
示例3: initialize
/**
* initialize
*/
public function initialize()
{
$screen = get_current_screen();
add_filter('views_' . $screen->id, array($this, 'donate_link'));
add_action('admin_head', array($this, 'add_columns'));
add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
}
示例4: admin_init
/**
* Process redirection of all dashboard pages for password reset
*
* @since 1.8
*
* @return void
*/
public function admin_init() {
if ( isset( get_current_screen()->id ) && ( 'profile' === get_current_screen()->id || 'profile-network' === get_current_screen()->id ) ) {
if ( isset( $this->settings['expire'] ) && $this->settings['expire'] === true ) { //make sure we're enforcing a password change
$current_user = wp_get_current_user();
if ( isset( $current_user->ID ) && $current_user->ID !== 0 ) { //make sure we have a valid user
$required = get_user_meta( $current_user->ID, 'itsec_password_change_required', true );
if ( $required == true ) {
wp_safe_redirect( admin_url( 'profile.php?itsec_password_expired=true#pass1' ) );
exit();
}
}
}
}
}
示例5: admin_script
/**
* Add Away mode Javascript
*
* @return void
*/
public function admin_script()
{
global $itsec_globals;
if (isset(get_current_screen()->id) && strpos(get_current_screen()->id, 'security_page_toplevel_page_itsec_settings') !== false) {
wp_enqueue_script('itsec_strong_passwords_js', $this->module_path . 'js/admin-strong-passwords.js', array('jquery'), $itsec_globals['plugin_build']);
}
}
开发者ID:Telemedellin,项目名称:feriadelasfloresmedellin,代码行数:12,代码来源:class-itsec-strong-passwords-admin.php
示例6: enqueue_admin_scripts
public function enqueue_admin_scripts()
{
if (get_current_screen()->id == $this->plugin_screen_hook_suffix) {
wp_enqueue_script($this->plugin_slug . '-admin-script', get_stylesheet_directory_uri() . '/video-player/js/progression-admin.js', array('jquery', 'wp-color-picker'), $this->version);
}
wp_enqueue_media();
}
示例7: admin_enqueue_scripts
/**
* Enqueue common styles
*
* @return void
*/
function admin_enqueue_scripts()
{
$screen = get_current_screen();
// Enqueue scripts and styles for registered pages (post types) only
if ('post' != $screen->base || !in_array($screen->post_type, $this->meta_box['pages'])) {
return;
}
wp_enqueue_style('rwmb', RWMB_CSS_URL . 'style.css', array(), RWMB_VER);
// Load clone script conditionally
$has_clone = false;
foreach ($this->fields as $field) {
if ($field['clone']) {
$has_clone = true;
}
// Enqueue scripts and styles for fields
$class = self::get_class_name($field);
if (method_exists($class, 'admin_enqueue_scripts')) {
call_user_func(array($class, 'admin_enqueue_scripts'));
}
}
if ($has_clone) {
wp_enqueue_script('rwmb-clone', RWMB_JS_URL . 'clone.js', array('jquery'), RWMB_VER, true);
}
if ($this->validation) {
wp_enqueue_script('jquery-validate', RWMB_JS_URL . 'jquery.validate.min.js', array('jquery'), RWMB_VER, true);
wp_enqueue_script('rwmb-validate', RWMB_JS_URL . 'validate.js', array('jquery-validate'), RWMB_VER, true);
}
}
示例8: enqueue
/**
* Enqueue Scripts on Manage Gallery page
*/
function enqueue()
{
$current_screen = get_current_screen();
if (!empty($current_screen) && $current_screen->base == 'nggallery-manage-images') {
$this->localize();
}
}
示例9: help
/**
* Contextual help content.
*
* @since 2.0.0
*/
public function help()
{
$screen = get_current_screen();
$theme_settings_help = '<h3>' . __('Theme Settings', 'genesis') . '</h3>' . '<p>' . __('Your Theme Settings provides control over how the theme works. You will be able to control a lot of common and even advanced features from this menu. Some child themes may add additional menu items to this list, including the ability to select different color schemes or set theme specific features such as a slider. Each of the boxes can be collapsed by clicking the box header and expanded by doing the same. They can also be dragged into any order you desire or even hidden by clicking on "Screen Options" in the top right of the screen and "unchecking" the boxes you do not want to see. Below you\'ll find the items common to every child theme …', 'genesis') . '</p>';
$information_help = '<h3>' . __('Information', 'genesis') . '</h3>' . '<p>' . __('The information box allows you to see the current Genesis theme information and display if desired.', 'genesis') . '</p>' . '<p>' . __('Normally, this should be unchecked. You can also set to enable automatic updates.', 'genesis') . '</p>' . '<p>' . __('This does not mean the updates happen automatically without your permission; it will just notify you that an update is available. You must select it to perform the update.', 'genesis') . '</p>' . '<p>' . __('If you provide an email address and select to notify that email address when the update is available, your site will email you when the update can be performed.No, updates only affect files being updated.', 'genesis') . '</p>';
$feeds_help = '<h3>' . __('Custom Feeds', 'genesis') . '</h3>' . '<p>' . __('If you use Feedburner to handle your rss feed(s) you can use this function to set your site\'s native feed to redirect to your Feedburner feed.', 'genesis') . '</p>' . '<p>' . __('By filling in the feed links calling for the main site feed, it will display as a link to Feedburner.', 'genesis') . '</p>' . '<p>' . __('By checking the "Redirect Feed" box, all traffic to default feed links will be redirected to the Feedburner link instead.', 'genesis') . '</p>';
$layout_help = '<h3>' . __('Default Layout', 'genesis') . '</h3>' . '<p>' . __('This lets you select the default layout for your entire site. On most of the child themes you\'ll see these options:', 'genesis') . '</p>' . '<ul>' . '<li>' . __('Content Sidebar', 'genesis') . '</li>' . '<li>' . __('Sidebar Content', 'genesis') . '</li>' . '<li>' . __('Sidebar Content Sidebar', 'genesis') . '</li>' . '<li>' . __('Content Sidebar Sidebar', 'genesis') . '</li>' . '<li>' . __('Sidebar Sidebar Content', 'genesis') . '</li>' . '<li>' . __('Full Width Content', 'genesis') . '</li>' . '</ul>' . '<p>' . __('These options can be extended or limited by the child theme. Additionally, many of the child themes do not allow different layouts on the home page as they have been designed for a specific home page layout.', 'genesis') . '</p>' . '<p>' . __('This layout can also be overridden in the post/page/term layout options on each post/page/term.', 'genesis') . '</p>';
$header_help = '<h3>' . __('Header', 'genesis') . '</h3>' . '<p>' . __('The <strong>Dynamic text</strong> option will use the Site Title and Site Description from your site\'s settings in your header.', 'genesis') . '</p>' . '<p>' . __('The <strong>Image logo</strong> option will use a logo image file in the header instead of the site\'s title and description. This setting adds a .header-image class to your site, allowing you to specify the header image in your child theme\'s style.css. By default, the logo can be saved as logo.png and saved to the images folder of your child theme.', 'genesis') . '</p>';
$navigation_help = '<h3>' . __('Navigation', 'genesis') . '</h3>' . '<p>' . __('The Primary Navigation Extras typically display on the right side of your Primary Navigation menu.', 'genesis') . '</p>' . '<ul>' . '<li>' . __('Today\'s date displays the current date', 'genesis') . '</li>' . '<li>' . __('RSS feed link displays a link to the RSS feed for your site that a reader can use to subscribe to your site using the feedreader of their choice.', 'genesis') . '</li>' . '<li>' . __('Search form displays a small search form utilizing the WordPress search functionality.', 'genesis') . '</li>' . '<li>' . __('Twitter link displays a link to your Twitter profile, as indicated in Twitter ID setting. Enter only your user name in this setting.', 'genesis') . '</li>' . '</ul>' . '<p>' . __('These options can be extended or limited by the child theme.', 'genesis') . '</p>';
$breadcrumbs_help = '<h3>' . __('Breadcrumbs', 'genesis') . '</h3>' . '<p>' . __('This box lets you define where the "Breadcrumbs" display. The Breadcrumb is the navigation tool that displays where a visitor is on the site at any given moment.', 'genesis') . '</p>';
$comments_help = '<h3>' . __('Comments and Trackbacks', 'genesis') . '</h3>' . '<p>' . __('This allows a site wide decision on whether comments and trackbacks (notifications when someone links to your page) are enabled for posts and pages.', 'genesis') . '</p>' . '<p>' . __('If you enable comments or trackbacks here, it can be disabled on an individual post or page. If you disable here, they cannot be enabled on an individual post or page.', 'genesis') . '</p>';
$archives_help = '<h3>' . __('Content Archives', 'genesis') . '</h3>' . '<p>' . __('In the Genesis Theme Settings you may change the site wide Content Archives options to control what displays in the site\'s Archives.', 'genesis') . '</p>' . '<p>' . __('Archives include any pages using the blog template, category pages, tag pages, date archive, author archives, and the latest posts if there is no custom home page.', 'genesis') . '</p>' . '<p>' . __('The first option allows you to display the post content or the post excerpt. The Display post content setting will display the entire post including HTML code up to the <!--more--> tag if used (this is HTML for the comment tag that is not displayed in the browser).', 'genesis') . '</p>' . '<p>' . __('It may also be coupled with the second field "Limit content to [___] characters" to limit the content to a specific number of letters or spaces. This will strip any HTML, but allows for more precise and easily changed lengths than the excerpt.', 'genesis') . '</p>' . '<p>' . __('The Display post excerpt setting will display the first 55 words of the post after also stripping any included HTML or the manual/custom excerpt added in the post edit screen.', 'genesis') . '</p>' . '<p>' . __('The \'Include post image?\' setting allows you to show a thumbnail of the first attached image or currently set featured image.', 'genesis') . '</p>' . '<p>' . __('This option should not be used with the post content unless the content is limited to avoid duplicate images.', 'genesis') . '</p>' . '<p>' . __('The \'Image Size\' list is populated by the available image sizes defined in the theme.', 'genesis') . '</p>' . '<p>' . __('Post Navigation Technique allows you to select one of three navigation methods.', 'genesis') . '</p>';
$blog_help = '<h3>' . __('Blog Page', 'genesis') . '</h3>' . '<p>' . __('This works with the Blog Template, which is a page template that shows your latest posts. It\'s what people see when they land on your homepage.', 'genesis') . '</p>' . '<p>' . __('In the General Settings you can select a specific category to display from the drop down menu, and exclude categories by ID, or even select how many posts you\'d like to display on this page.', 'genesis') . '</p>' . '<p>' . __('There are some special features of the Blog Template that allow you to specify which category to show on each page using the template, which is helpful if you have a "News" category (or something else) that you want to display separately.', 'genesis') . '</p>' . '<p>' . sprintf(__('You can find more on this feature in the <a href="%s" target="_blank">How to Add a Post Category Page tutorial.</a>', 'genesis'), 'http://www.studiopress.com/tutorials/genesis/add-post-category-page') . '</p>';
$scripts_help = '<h3>' . __('Header and Footer Scripts', 'genesis') . '</h3>' . '<p>' . sprintf(__('This provides you with two fields that will output to the %1$s element of your site and just before the %2$s tag. These will appear on every page of the site and are a great way to add analytic code and other scripts. You cannot use PHP in these fields. If you need to use PHP then you should look into the Genesis Simple Hooks plugin.', 'genesis'), '<code><head></code>', '<code></body></code>') . '</p>';
$home_help = '<h3>' . __('How Home Pages Work', 'genesis') . '</h3>' . '<p>' . __('Most Genesis child themes include a custom home page.', 'genesis') . '</p>' . '<p>' . __('To use this type of home page, make sure your latest posts are set to show on the front page. You can setup a page with the Blog page template to show a blog style list of your latest posts on another page.', 'genesis') . '</p>' . '<p>' . __('This home page is typically setup via widgets in the sidebars for the home page. This can be accessed via the Widgets menu item under Appearance.', 'genesis') . '</p>' . '<p>' . __('Child themes that include this type of home page typically include additional theme-specific tutorials which can be accessed via a sticky post at the top of that child theme support forum.', 'genesis') . '</p>' . '<p>' . __('If your theme uses a custom home page and you want to show the latest posts in a blog format, do not use the blog template. Instead, you need to rename the home.php file to home-old.php instead.', 'genesis') . '</p>' . '<p>' . __('Another common home page is the "blog" type home page, which is common to most of the free child themes. This shows your latest posts and requires no additional setup.', 'genesis') . '</p>' . '<p>' . __('The third type of home page is the new dynamic home page. This is common on the newest child themes. It will show your latest posts in a blog type listing unless you put widgets into the home page sidebars.', 'genesis') . '</p>' . '<p>' . __('This setup is preferred because it makes it easier to show a blog on the front page (no need to rename the home.php file) and does not have the confusion of no content on the home page when the theme is initially installed.', 'genesis') . '</p>';
$screen->add_help_tab(array('id' => $this->pagehook . '-theme-settings', 'title' => __('Theme Settings', 'genesis'), 'content' => $theme_settings_help));
$screen->add_help_tab(array('id' => $this->pagehook . '-information', 'title' => __('Information', 'genesis'), 'content' => $information_help));
$screen->add_help_tab(array('id' => $this->pagehook . '-feeds', 'title' => __('Custom Feeds', 'genesis'), 'content' => $feeds_help));
$screen->add_help_tab(array('id' => $this->pagehook . '-layout', 'title' => __('Default Layout', 'genesis'), 'content' => $layout_help));
$screen->add_help_tab(array('id' => $this->pagehook . '-header', 'title' => __('Header', 'genesis'), 'content' => $header_help));
if (genesis_first_version_compare('2.0.2', '<=')) {
$screen->add_help_tab(array('id' => $this->pagehook . '-navigation', 'title' => __('Navigation', 'genesis'), 'content' => $navigation_help));
}
$screen->add_help_tab(array('id' => $this->pagehook . '-breadcrumbs', 'title' => __('Breadcrumbs', 'genesis'), 'content' => $breadcrumbs_help));
$screen->add_help_tab(array('id' => $this->pagehook . '-comments', 'title' => __('Comments and Trackbacks', 'genesis'), 'content' => $comments_help));
$screen->add_help_tab(array('id' => $this->pagehook . '-archives', 'title' => __('Content Archives', 'genesis'), 'content' => $archives_help));
$screen->add_help_tab(array('id' => $this->pagehook . '-blog', 'title' => __('Blog Page', 'genesis'), 'content' => $blog_help));
$screen->add_help_tab(array('id' => $this->pagehook . '-scripts', 'title' => __('Header and Footer Scripts', 'genesis'), 'content' => $scripts_help));
$screen->add_help_tab(array('id' => $this->pagehook . '-home', 'title' => __('Home Pages', 'genesis'), 'content' => $home_help));
//* Add help sidebar
$screen->set_help_sidebar('<p><strong>' . __('For more information:', 'genesis') . '</strong></p>' . '<p><a href="http://my.studiopress.com/help/" target="_blank">' . __('Get Support', 'genesis') . '</a></p>' . '<p><a href="http://my.studiopress.com/snippets/" target="_blank">' . __('Genesis Snippets', 'genesis') . '</a></p>' . '<p><a href="http://my.studiopress.com/tutorials/" target="_blank">' . __('Genesis Tutorials', 'genesis') . '</a></p>');
}
示例10: editable_column_settings
/**
* Modify column editable type
* @param $editable
* @param $column
* @return mixed
*/
function editable_column_settings($editable, $column)
{
$key = str_replace("cpachidden_", "", $column['field']);
$screen = get_current_screen();
if ('column-meta' == $column['type']) {
if (array_key_exists($key, $this->fields) && $this->fields[$key]['type'] == 'select') {
$editable['type'] = 'select';
$editable['options'] = $this->get_column_options($this->fields[$key]['options']);
}
if (!empty($screen) && $screen->id == 'users' && $column['field_type'] == 'array') {
global $wpdb;
$editable['type'] = 'select';
$values = $wpdb->get_col("SELECT DISTINCT meta_value FROM {$wpdb->usermeta} WHERE meta_key='" . $column['field'] . "'");
$i = 0;
foreach ($values as $value) {
if (empty($value)) {
continue;
}
$editable['options'][$i]['value'] = $value;
$editable['options'][$i]['label'] = $value;
$i++;
}
$editable['options'][$i]['value'] = "";
$editable['options'][$i]['label'] = "";
}
}
return $editable;
}
示例11: enable_media_replace
/**
* Add some new fields to the attachment edit panel.
* @param array form fields edit panel
* @return array form fields with enable-media-replace fields added
*/
function enable_media_replace($form_fields, $post)
{
// Check if we are on media upload screen for insertion of replace link
$on_media_edit_screen = false;
$current_wp_version = get_bloginfo('version');
if ($current_wp_version < 3.5) {
if (isset($_GET["attachment_id"]) && $_GET["attachment_id"]) {
$on_media_edit_screen = true;
}
} else {
$current_screen = get_current_screen();
if (!is_null($current_screen) && $current_screen->base == 'post' && $current_screen->post_type == 'attachment') {
$on_media_edit_screen = true;
}
}
if ($on_media_edit_screen == true) {
$url = admin_url("upload.php?page=enable-media-replace/enable-media-replace.php&action=media_replace&attachment_id=" . $post->ID);
$action = "media_replace";
$editurl = wp_nonce_url($url, $action);
if (FORCE_SSL_ADMIN) {
$editurl = str_replace("http:", "https:", $editurl);
}
$link = "href=\"{$editurl}\"";
$form_fields["enable-media-replace"] = array("label" => __("Replace media", "enable-media-replace"), "input" => "html", "html" => "<p><a class='button-secondary'{$link}>" . __("Upload a new file", "enable-media-replace") . "</a></p>", "helps" => __("To replace the current file, click the link and upload a replacement.", "enable-media-replace"));
}
return $form_fields;
}
示例12: _getDefaultScreenIcon
private function _getDefaultScreenIcon()
{
$_oScreen = get_current_screen();
$_sIconIDAttribute = $this->_getScreenIDAttribute($_oScreen);
$_aAttributes = array('class' => $this->getClassAttribute($this->getAOrB(empty($_sIconIDAttribute) && $_oScreen->post_type, sanitize_html_class('icon32-posts-' . $_oScreen->post_type), ''), $this->getAOrB(empty($_sIconIDAttribute) || $_sIconIDAttribute == $this->oFactory->oProp->sClassName, 'generic', '')), 'id' => "icon-" . $_sIconIDAttribute);
return $this->_getScreenIconByAttributes($_aAttributes);
}
开发者ID:michaeluno,项目名称:admin-page-framework,代码行数:7,代码来源:AdminPageFramework_View__PageRenderer__ScreenIcon.php
示例13: register_settings
/**
* Register settings
*
* @since 1.3
*/
public function register_settings()
{
// Weed out all admin pages except the Jigoshop Settings page hits
global $pagenow;
if ($pagenow != 'admin.php' && $pagenow != 'options.php') {
return;
}
$screen = get_current_screen();
if ($screen->base != 'jigoshop_page_jigoshop_settings' && $screen->base != 'options') {
return;
}
$slug = $this->get_current_tab_slug();
$options = isset($this->our_parser->tabs[$slug]) ? $this->our_parser->tabs[$slug] : '';
if (!is_array($options)) {
jigoshop_log("Jigoshop Settings API: -NO- valid options for 'register_settings()' - EXITING with:");
jigoshop_log($slug);
return;
}
register_setting(JIGOSHOP_OPTIONS, JIGOSHOP_OPTIONS, array($this, 'validate_settings'));
if (is_array($options)) {
foreach ($options as $index => $option) {
switch ($option['type']) {
case 'title':
add_settings_section($option['section'], $option['name'], array($this, 'display_section'), JIGOSHOP_OPTIONS);
break;
default:
$this->create_setting($index, $option);
break;
}
}
}
add_action('admin_enqueue_styles', array($this, 'settings_styles'), 9);
add_action('admin_enqueue_scripts', array($this, 'settings_scripts'), 9);
}
示例14: add_tabs
/**
* Add Contextual help tabs
*/
public function add_tabs()
{
$screen = get_current_screen();
if (!in_array($screen->id, wc_get_screen_ids())) {
return;
}
$video_map = array('wc-settings' => array('title' => __('General Settings', 'woocommerce'), 'url' => '//fast.wistia.net/embed/iframe/mz2l10u5f6?videoFoam=true'), 'wc-settings-general' => array('title' => __('General Settings', 'woocommerce'), 'url' => '//fast.wistia.net/embed/iframe/mz2l10u5f6?videoFoam=true'), 'wc-settings-products' => array('title' => __('Product Settings', 'woocommerce'), 'url' => '//fast.wistia.net/embed/iframe/lolkan4fxf?videoFoam=true'), 'wc-settings-tax' => array('title' => __('Tax Settings', 'woocommerce'), 'url' => '//fast.wistia.net/embed/iframe/qp1v19dwrh?videoFoam=true'), 'wc-settings-checkout' => array('title' => __('Checkout Settings', 'woocommerce'), 'url' => '//fast.wistia.net/embed/iframe/65yjv96z51?videoFoam=true'), 'wc-settings-shipping' => array('title' => __('Shipping Settings', 'woocommerce'), 'url' => '//fast.wistia.net/embed/iframe/9c9008dxnr?videoFoam=true'), 'wc-settings-account' => array('title' => __('Account Settings', 'woocommerce'), 'url' => '//fast.wistia.net/embed/iframe/35mazq7il2?videoFoam=true'), 'wc-settings-email' => array('title' => __('Email Settings', 'woocommerce'), 'url' => '//fast.wistia.net/embed/iframe/svcaftq4xv?videoFoam=true'), 'wc-settings-api' => array('title' => __('Webhook Settings', 'woocommerce'), 'url' => '//fast.wistia.net/embed/iframe/1q0ny74vvq?videoFoam=true'), 'wc-settings-checkout-wc_gateway_paypal' => array('title' => __('PayPal Standard', 'woocommerce'), 'url' => '//fast.wistia.net/embed/iframe/rbl7e7l4k2?videoFoam=true'), 'wc-settings-checkout-wc_gateway_simplify_commerce' => array('title' => __('Simplify Commerce', 'woocommerce'), 'url' => '//fast.wistia.net/embed/iframe/jdfzjiiw61?videoFoam=true'), 'wc-settings-shipping' => array('title' => __('Shipping Settings', 'woocommerce'), 'url' => '//fast.wistia.net/embed/iframe/9c9008dxnr?videoFoam=true'), 'wc-settings-shipping-wc_shipping_free_shipping' => array('title' => __('Free Shipping', 'woocommerce'), 'url' => '//fast.wistia.net/embed/iframe/po191fmvy9?videoFoam=true'), 'wc-settings-shipping-wc_shipping_local_delivery' => array('title' => __('Local Delivery', 'woocommerce'), 'url' => '//fast.wistia.net/embed/iframe/5qjepx9ozj?videoFoam=true'), 'wc-settings-shipping-wc_shipping_local_pickup' => array('title' => __('Local Pickup', 'woocommerce'), 'url' => '//fast.wistia.net/embed/iframe/pe95ph0apb?videoFoam=true'), 'edit-product_cat' => array('title' => __('Product Categories, Tags, Shipping Classes, & Attributes', 'woocommerce'), 'url' => '//fast.wistia.net/embed/iframe/f0j5gzqigg?videoFoam=true'), 'edit-product_tag' => array('title' => __('Product Categories, Tags, Shipping Classes, & Attributes', 'woocommerce'), 'url' => '//fast.wistia.net/embed/iframe/f0j5gzqigg?videoFoam=true'), 'edit-product_shipping_class' => array('title' => __('Product Categories, Tags, Shipping Classes, & Attributes', 'woocommerce'), 'url' => '//fast.wistia.net/embed/iframe/f0j5gzqigg?videoFoam=true'), 'product_attributes' => array('title' => __('Product Categories, Tags, Shipping Classes, & Attributes', 'woocommerce'), 'url' => '//fast.wistia.net/embed/iframe/f0j5gzqigg?videoFoam=true'), 'product' => array('title' => __('Simple Products', 'woocommerce'), 'url' => '//fast.wistia.net/embed/iframe/ziyjmd4kut?videoFoam=true'), 'wc-status' => array('title' => __('System Status', 'woocommerce'), 'url' => '//fast.wistia.net/embed/iframe/xdn733nnhi?videoFoam=true'), 'wc-reports' => array('title' => __('Reports', 'woocommerce'), 'url' => '//fast.wistia.net/embed/iframe/6aasex0w99?videoFoam=true'), 'edit-shop_coupon' => array('title' => __('Coupons', 'woocommerce'), 'url' => '//fast.wistia.net/embed/iframe/gupd4h8sit?videoFoam=true'), 'shop_coupon' => array('title' => __('Coupons', 'woocommerce'), 'url' => '//fast.wistia.net/embed/iframe/gupd4h8sit?videoFoam=true'), 'edit-shop_order' => array('title' => __('Managing Orders', 'woocommerce'), 'url' => '//fast.wistia.net/embed/iframe/n8n0sa8hee?videoFoam=true'), 'shop_order' => array('title' => __('Managing Orders', 'woocommerce'), 'url' => '//fast.wistia.net/embed/iframe/n8n0sa8hee?videoFoam=true'));
$page = empty($_GET['page']) ? '' : sanitize_title($_GET['page']);
$tab = empty($_GET['tab']) ? '' : sanitize_title($_GET['tab']);
$section = empty($_REQUEST['section']) ? '' : sanitize_title($_REQUEST['section']);
$video_key = $page ? implode('-', array_filter(array($page, $tab, $section))) : $screen->id;
// Fallback for sections
if (!isset($video_map[$video_key])) {
$video_key = $page ? implode('-', array_filter(array($page, $tab))) : $screen->id;
}
// Fallback for tabs
if (!isset($video_map[$video_key])) {
$video_key = $page ? $page : $screen->id;
}
if (isset($video_map[$video_key])) {
$screen->add_help_tab(array('id' => 'woocommerce_101_tab', 'title' => __('WooCommerce 101', 'woocommerce'), 'content' => '<h2><a href="http://docs.woothemes.com/document/woocommerce-101-video-series/?utm_source=WooCommerce&utm_medium=Wizard&utm_content=Videos&utm_campaign=Onboarding">' . __('WooCommerce 101', 'woocommerce') . '</a> – ' . esc_html($video_map[$video_key]['title']) . '</h2>' . '<iframe src="' . esc_url($video_map[$video_key]['url']) . '" allowtransparency="true" frameborder="0" scrolling="no" class="wistia_embed" name="wistia_embed" allowfullscreen mozallowfullscreen webkitallowfullscreen oallowfullscreen msallowfullscreen width="480" height="298"></iframe>'));
}
$screen->add_help_tab(array('id' => 'woocommerce_docs_tab', 'title' => __('Documentation', 'woocommerce'), 'content' => '<h2>' . __('Documentation', 'woocommerce') . '</h2>' . '<p>' . __('Should you need help understanding, using, or extending WooCommerce, please read our documentation. You will find all kinds of resources including snippets, tutorials and much more.', 'woocommerce') . '</p>' . '<p><a href="' . 'http://docs.woothemes.com/documentation/plugins/woocommerce/' . '" class="button button-primary">' . __('WooCommerce Documentation', 'woocommerce') . '</a> <a href="' . 'http://docs.woothemes.com/wc-apidocs/' . '" class="button">' . __('Developer API Docs', 'woocommerce') . '</a></p>'));
$screen->add_help_tab(array('id' => 'woocommerce_support_tab', 'title' => __('Support', 'woocommerce'), 'content' => '<h2>' . __('Support', 'woocommerce') . '</h2>' . '<p>' . sprintf(__('After %sreading the documentation%s, for further assistance you can use the %scommunity forums%s on WordPress.org to talk with other users. If however you are a WooThemes customer, or need help with premium add-ons sold by WooThemes, please %suse our helpdesk%s.', 'woocommerce'), '<a href="http://docs.woothemes.com/documentation/plugins/woocommerce/">', '</a>', '<a href="https://wordpress.org/support/plugin/woocommerce">', '</a>', '<a href="http://support.woothemes.com">', '</a>') . '</p>' . '<p>' . __('Before asking for help we recommend checking the system status page to identify any problems with your configuration.', 'woocommerce') . '</p>' . '<p><a href="' . admin_url('admin.php?page=wc-status') . '" class="button button-primary">' . __('System Status', 'woocommerce') . '</a> <a href="' . 'https://wordpress.org/support/plugin/woocommerce' . '" class="button">' . __('WordPress.org Forums', 'woocommerce') . '</a> <a href="' . 'http://support.woothemes.com' . '" class="button">' . __('WooThemes Customer Support', 'woocommerce') . '</a></p>'));
$screen->add_help_tab(array('id' => 'woocommerce_education_tab', 'title' => __('Education', 'woocommerce'), 'content' => '<h2>' . __('Education', 'woocommerce') . '</h2>' . '<p>' . __('If you would like to learn about using WooCommerce from an expert, consider following a WooCommerce course ran by one of our educational partners.', 'woocommerce') . '</p>' . '<p><a href="' . 'http://www.woothemes.com/educational-partners/?utm_source=WooCommerce&utm_medium=Wizard&utm_content=Partners&utm_campaign=Onboarding' . '" class="button button-primary">' . __('View Education Partners', 'woocommerce') . '</a></p>'));
$screen->add_help_tab(array('id' => 'woocommerce_bugs_tab', 'title' => __('Found a bug?', 'woocommerce'), 'content' => '<h2>' . __('Found a bug?', 'woocommerce') . '</h2>' . '<p>' . sprintf(__('If you find a bug within WooCommerce core you can create a ticket via <a href="%s">Github issues</a>. Ensure you read the <a href="%s">contribution guide</a> prior to submitting your report. To help us solve your issue, please be as descriptive as possible and include your <a href="%s">system status report</a>.', 'woocommerce'), 'https://github.com/woothemes/woocommerce/issues?state=open', 'https://github.com/woothemes/woocommerce/blob/master/CONTRIBUTING.md', admin_url('admin.php?page=wc-status')) . '</p>' . '<p><a href="' . 'https://github.com/woothemes/woocommerce/issues?state=open' . '" class="button button-primary">' . __('Report a bug', 'woocommerce') . '</a> <a href="' . admin_url('admin.php?page=wc-status') . '" class="button">' . __('System Status', 'woocommerce') . '</a></p>'));
$screen->set_help_sidebar('<p><strong>' . __('For more information:', 'woocommerce') . '</strong></p>' . '<p><a href="' . 'http://www.woothemes.com/woocommerce/' . '" target="_blank">' . __('About WooCommerce', 'woocommerce') . '</a></p>' . '<p><a href="' . 'http://wordpress.org/extend/plugins/woocommerce/' . '" target="_blank">' . __('WordPress.org Project', 'woocommerce') . '</a></p>' . '<p><a href="' . 'https://github.com/woothemes/woocommerce' . '" target="_blank">' . __('Github Project', 'woocommerce') . '</a></p>' . '<p><a href="' . 'http://www.woothemes.com/product-category/themes/woocommerce/' . '" target="_blank">' . __('Official Themes', 'woocommerce') . '</a></p>' . '<p><a href="' . 'http://www.woothemes.com/product-category/woocommerce-extensions/' . '" target="_blank">' . __('Official Extensions', 'woocommerce') . '</a></p>');
}
示例15: _wpsc_te2_action_admin_enqueue_scripts
/**
* Register and enqueue scripts
*
* Action hook: admin_enqueue_scripts
*
* @since 0.1
*/
function _wpsc_te2_action_admin_enqueue_scripts()
{
wp_register_script('wpsc-auto-resize-field', WPSC_TE_V2_JS_URL . '/auto-resize-field.js', array('jquery'), WPSC_VERSION);
wp_register_script('wpsc-fix-reading-settings', WPSC_TE_V2_JS_URL . '/fix-reading-settings.js', array('jquery'), WPSC_VERSION);
wp_register_script('wpsc-presentation-settings', WPSC_TE_V2_JS_URL . '/presentation-settings.js', array('jquery'), WPSC_VERSION);
wp_register_script('wpsc-multi-select', WPSC_TE_V2_JS_URL . '/multi-select.js', array('jquery', 'wpsc-select2'), WPSC_VERSION);
wp_register_script('wpsc-select2', WPSC_TE_V2_JS_URL . '/select2.full.min.js', array('jquery'), WPSC_VERSION);
$current_screen = get_current_screen();
switch ($current_screen->id) {
case 'settings_page_wpsc-settings':
// Settings->Store->Pages
wp_enqueue_script('wpsc-auto-resize-field');
// Settings->Store->Presentation
wp_enqueue_script('wpsc-multi-select');
wp_enqueue_script('wpsc-presentation-settings');
break;
// Appearance->Widgets
// Appearance->Widgets
case 'widgets':
wp_enqueue_script('wpsc-multi-select');
break;
// Settings->Reading
// Settings->Reading
case 'options-reading':
_wpsc_te2_enqueue_reading_settings_fix();
break;
}
}