WordPress.org

Make WordPress Core

Changeset 22815


Ignore:
Timestamp:
11/22/2012 09:24:11 AM (9 years ago)
Author:
nacin
Message:

Two initial feature pointers for WordPress 3.5: plugin favorites and the media dialog. One offered for translation. props nacin, lessbloat, DrewAPicture. see #22454.

File:
1 edited

Legend:

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

    r22723 r22815  
    16701670        $registered_pointers = array(
    16711671            'index.php'    => 'wp330_toolbar',
    1672             'post-new.php' => 'wp330_media_uploader',
    1673             'post.php'     => 'wp330_media_uploader',
     1672            'post-new.php' => 'wp350_media',
     1673            'post.php'     => 'wp350_media',
    16741674            'themes.php'   => array( 'wp330_saving_widgets', 'wp340_customize_current_theme_link' ),
    16751675            'appearance_page_custom-header' => 'wp340_choose_image_from_library',
    16761676            'appearance_page_custom-background' => 'wp340_choose_image_from_library',
     1677            'plugin-install.php' => 'wp350_favorites',
    16771678        );
    16781679
     
    16841685
    16851686        $caps_required = array(
    1686             'wp330_media_uploader' => array( 'upload_files' ),
    16871687            'wp330_saving_widgets' => array( 'edit_theme_options', 'switch_themes' ),
    16881688            'wp340_customize_current_theme_link' => array( 'edit_theme_options' ),
    16891689            'wp340_choose_image_from_library' => array( 'edit_theme_options' ),
     1690            'wp350_media' => array( 'upload_files' ),
    16901691        );
    16911692
     
    17791780     * @since 3.3.0
    17801781     */
    1781     public static function pointer_wp330_media_uploader() {
    1782         $content  = '<h3>' . __( 'Updated Media Uploader' ) . '</h3>';
    1783         $content .= '<p>' . __( 'The single media icon now launches the uploader for all file types, and the new drag and drop interface makes uploading a breeze.' ) . '</p>';
    1784 
    1785         WP_Internal_Pointers::print_js( 'wp330_media_uploader', '#content-add_media', array(
    1786             'content'  => $content,
    1787             'position' => array( 'edge' => is_rtl() ? 'right' : 'left', 'align' => 'center' ),
    1788         ) );
    1789     }
     1782    public static function pointer_wp330_media_uploader() {}
    17901783
    17911784    /**
     
    18351828    }
    18361829
     1830    public static function pointer_wp350_media() {
     1831        $content  = '<h3>' . ( 'New Media Uploader' ) . '</h3>';
     1832        $content .= '<p>' . ( 'Uploading and inserting images and other files has never been easier.' ) . '</p>';
     1833
     1834        self::print_js( 'wp350_media', '.insert-media', array(
     1835            'content'  => $content,
     1836            'position' => array( 'edge' => is_rtl() ? 'right' : 'left', 'align' => 'center' ),
     1837        ) );
     1838    }
     1839
     1840    public static function pointer_wp350_favorites() {
     1841        $content  = '<h3>' . __( 'New Feature: Plugin Favorites' ) . '</h3>';
     1842        $content .= '<p>' . __( 'If you have favorited plugins on WordPress.org, you can now install them directly from this tab.' ) . '</p>';
     1843
     1844        self::print_js( 'wp350_favorites', '.plugin-install-favorites', array(
     1845            'content'  => $content,
     1846            'position' => array( 'edge' => 'top', 'align' => is_rtl() ? 'right' : 'left', 'offset' => is_rtl() ? '40 0' : '-40 0' ),
     1847        ) );
     1848    }
     1849
    18371850    /**
    18381851     * Prevents new users from seeing existing 'new feature' pointers.
     
    18411854     */
    18421855    public static function dismiss_pointers_for_new_users( $user_id ) {
    1843         add_user_meta( $user_id, 'dismissed_wp_pointers', 'wp330_toolbar,wp330_media_uploader,wp330_saving_widgets,wp340_choose_image_from_library,wp340_customize_current_theme_link' );
     1856        add_user_meta( $user_id, 'dismissed_wp_pointers', 'wp330_toolbar,wp330_saving_widgets,wp340_choose_image_from_library,wp340_customize_current_theme_link,wp350_media,wp350_favorites' );
    18441857    }
    18451858}
Note: See TracChangeset for help on using the changeset viewer.