Make WordPress Core

Changeset 30574


Ignore:
Timestamp:
11/26/2014 02:53:54 AM (12 years ago)
Author:
azaozz
Message:

Editor: add a pointer for the new DFW button. Remove the wp350_media and wp360_revisions pointers from the same screens. See #30458.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/template.php

    r30546 r30574  
    19061906
    19071907                $registered_pointers = array(
    1908                         'post-new.php' => 'wp350_media',
    1909                         'post.php'     => array( 'wp350_media', 'wp360_revisions' ),
     1908                        'post-new.php' => 'wp410_dfw',
     1909                        'post.php'     => 'wp410_dfw',
    19101910                        'edit.php'     => 'wp360_locks',
    19111911                        'widgets.php'  => 'wp390_widgets',
     
    19201920
    19211921                $caps_required = array(
    1922                         'wp350_media' => array( 'upload_files' ),
    19231922                        'wp390_widgets' => array( 'edit_theme_options' ),
    19241923                );
     
    20001999        public static function pointer_wp340_customize_current_theme_link() {}
    20012000        public static function pointer_wp340_choose_image_from_library() {}
    2002 
    2003         public static function pointer_wp350_media() {
    2004                 $content  = '<h3>' . __( 'New Media Manager' ) . '</h3>';
    2005                 $content .= '<p>' . __( 'Uploading files and creating image galleries has a whole new look. Check it out!' ) . '</p>';
    2006 
    2007                 self::print_js( 'wp350_media', '.insert-media', array(
    2008                         'content'  => $content,
    2009                         'position' => array( 'edge' => is_rtl() ? 'right' : 'left', 'align' => 'center' ),
    2010                 ) );
    2011         }
    2012 
    2013         public static function pointer_wp360_revisions() {
    2014                 $content  = '<h3>' . __( 'Compare Revisions' ) . '</h3>';
    2015                 $content .= '<p>' . __( 'View, compare, and restore other versions of this content on the improved revisions screen.' ) . '</p>';
    2016 
    2017                 self::print_js( 'wp360_revisions', '.misc-pub-section.misc-pub-revisions', array(
    2018                         'content' => $content,
    2019                         'position' => array( 'edge' => is_rtl() ? 'left' : 'right', 'align' => 'center' ),
    2020                 ) );
    2021         }
     2001        public static function pointer_wp350_media() {}
     2002        public static function pointer_wp360_revisions() {}
    20222003
    20232004        public static function pointer_wp360_locks() {
     
    20612042        }
    20622043
     2044        public static function pointer_wp410_dfw() {
     2045                $content  = '<h3>' . __( 'Distraction Free Writing' ) . '</h3>';
     2046                $content .= '<p>' . __( 'Enable distraction free writing; everything fades away so you can focus. '
     2047                        . 'Bring your admin back by moving your mouse, then start typing and it fades away.' ) . '</p>';
     2048
     2049                if ( is_rtl() ) {
     2050                        $position = array( 'edge' => 'left', 'align' => 'left', 'my' => 'left-5 top-60' );
     2051                } else {
     2052                        $position = array( 'edge' => 'right', 'align' => 'right', 'my' => 'right+5 top-60' );
     2053                }
     2054
     2055                self::print_js( 'wp410_dfw', '#content-html', array(
     2056                        'content' => $content,
     2057                        'position' => $position,
     2058                ) );
     2059        }
     2060
    20632061        /**
    20642062         * Prevents new users from seeing existing 'new feature' pointers.
     
    20672065         */
    20682066        public static function dismiss_pointers_for_new_users( $user_id ) {
    2069                 add_user_meta( $user_id, 'dismissed_wp_pointers', 'wp350_media,wp360_revisions,wp360_locks,wp390_widgets' );
     2067                add_user_meta( $user_id, 'dismissed_wp_pointers', 'wp360_locks,wp390_widgets' );
    20702068        }
    20712069}
Note: See TracChangeset for help on using the changeset viewer.