Changeset 33593
- Timestamp:
- 08/07/2015 12:58:10 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/template.php
r33390 r33593 2018 2018 /* 2019 2019 * Register feature pointers 2020 * Format: array( hook_suffix => pointer_id ) 2020 * 2021 * Format: 2022 * array( 2023 * hook_suffix => pointer callback 2024 * ) 2025 * 2026 * Example: 2027 * array( 2028 * 'themes.php' => 'wp390_widgets' 2029 * ) 2021 2030 */ 2022 2023 2031 $registered_pointers = array( 2024 'post-new.php' => 'wp410_dfw', 2025 'post.php' => 'wp410_dfw', 2026 'edit.php' => 'wp360_locks', 2027 'widgets.php' => 'wp390_widgets', 2028 'themes.php' => 'wp390_widgets', 2032 // None currently 2029 2033 ); 2030 2034 … … 2035 2039 $pointers = (array) $registered_pointers[ $hook_suffix ]; 2036 2040 2041 /* 2042 * Specify required capabilities for feature pointers 2043 * 2044 * Format: 2045 * array( 2046 * pointer callback => Array of required capabilities 2047 * ) 2048 * 2049 * Example: 2050 * array( 2051 * 'wp390_widgets' => array( 'edit_theme_options' ) 2052 * ) 2053 */ 2037 2054 $caps_required = array( 2038 'wp390_widgets' => array( 'edit_theme_options' ),2055 // None currently 2039 2056 ); 2040 2057 … … 2117 2134 public static function pointer_wp350_media() {} 2118 2135 public static function pointer_wp360_revisions() {} 2119 2120 /** 2121 * @static 2122 */ 2123 public static function pointer_wp360_locks() { 2124 if ( ! is_multi_author() ) { 2125 return; 2126 } 2127 2128 $content = '<h3>' . __( 'Edit Lock' ) . '</h3>'; 2129 $content .= '<p>' . __( 'Someone else is editing this. No need to refresh; the lock will disappear when they’re done.' ) . '</p>'; 2130 2131 self::print_js( 'wp360_locks', 'tr.wp-locked .locked-indicator', array( 2132 'content' => $content, 2133 'position' => array( 'edge' => 'left', 'align' => 'left' ), 2134 ) ); 2135 } 2136 2137 /** 2138 * @static 2139 */ 2140 public static function pointer_wp390_widgets() { 2141 if ( ! current_theme_supports( 'widgets' ) ) { 2142 return; 2143 } 2144 2145 $content = '<h3>' . __( 'New Feature: Live Widget Previews' ) . '</h3>'; 2146 $content .= '<p>' . __( 'Add, edit, and play around with your widgets from the Customizer.' ) . ' ' . __( 'Preview your changes in real-time and only save them when you’re ready.' ) . '</p>'; 2147 2148 if ( 'themes' === get_current_screen()->id ) { 2149 $selector = '.theme.active .customize'; 2150 $position = array( 'edge' => is_rtl() ? 'right' : 'left', 'align' => 'center' ); 2151 } else { 2152 $selector = 'a[href^="customize.php"]'; 2153 if ( is_rtl() ) { 2154 $position = array( 'edge' => 'right', 'align' => 'center', 'my' => 'right-5px' ); 2155 } else { 2156 $position = array( 'edge' => 'left', 'align' => 'center', 'my' => 'left-5px' ); 2157 } 2158 } 2159 2160 self::print_js( 'wp390_widgets', $selector, array( 2161 'content' => $content, 2162 'position' => $position, 2163 ) ); 2164 } 2165 2166 /** 2167 * @static 2168 * 2169 * @global bool $_wp_editor_expand 2170 */ 2171 public static function pointer_wp410_dfw() { 2172 // Don't show when editor-scrolling is not used. 2173 if ( empty( $GLOBALS['_wp_editor_expand'] ) ) { 2174 return; 2175 } 2176 2177 $content = '<h3>' . __( 'Distraction-Free Writing' ) . '</h3>'; 2178 $content .= '<p>' . __( 'Enable distraction-free writing mode, and everything surrounding the editor will fade away when you start typing. Move your mouse out of the editor to reveal everything again.' ) . '</p>'; 2179 2180 if ( is_rtl() ) { 2181 $position = array( 'edge' => 'left', 'align' => 'center', 'my' => 'left+40 top-11', 'at' => 'left top' ); 2182 } else { 2183 $position = array( 'edge' => 'right', 'align' => 'center', 'my' => 'right-40 top-11', 'at' => 'right top' ); 2184 } 2185 2186 self::print_js( 'wp410_dfw', '#wp-content-wrap', array( 2187 'content' => $content, 2188 'position' => $position, 2189 ) ); 2190 } 2136 public static function pointer_wp360_locks() {} 2137 public static function pointer_wp390_widgets() {} 2138 public static function pointer_wp410_dfw() {} 2191 2139 2192 2140 /** … … 2200 2148 */ 2201 2149 public static function dismiss_pointers_for_new_users( $user_id ) { 2202 add_user_meta( $user_id, 'dismissed_wp_pointers', ' wp360_locks,wp390_widgets' );2150 add_user_meta( $user_id, 'dismissed_wp_pointers', '' ); 2203 2151 } 2204 2152 }
Note: See TracChangeset
for help on using the changeset viewer.