-
+
',
//]]>
+
class="wp-admin wp-core-ui no-js iframe ">
@@ -1492,6 +1579,15 @@ function _post_states($post) {
if ( is_sticky($post->ID) )
$post_states['sticky'] = __('Sticky');
+ /**
+ * Filter the default post display states used in the Posts list table.
+ *
+ * @since 2.8.0
+ *
+ * @param array $post_states An array of post display states. Values include 'Password protected',
+ * 'Private', 'Draft', 'Pending', and 'Sticky'.
+ * @param int $post The post ID.
+ */
$post_states = apply_filters( 'display_post_states', $post_states, $post );
if ( ! empty($post_states) ) {
@@ -1523,6 +1619,14 @@ function _media_states( $post ) {
$media_states[] = __( 'Background Image' );
}
+ /**
+ * Filter the default media display states for items in the Media list table.
+ *
+ * @since 3.2.0
+ *
+ * @param array $media_states An array of media states. Default 'Header Image',
+ * 'Background Image'.
+ */
$media_states = apply_filters( 'display_media_states', $media_states );
if ( ! empty( $media_states ) ) {
@@ -1603,21 +1707,26 @@ function compression_test() {
}
/**
- * Echos a submit button, with provided text and appropriate class
+ * Echoes a submit button, with provided text and appropriate class(es).
*
* @since 3.1.0
*
- * @param string $text The text of the button (defaults to 'Save Changes')
- * @param string $type The type of button. One of: primary, secondary, delete
- * @param string $name The HTML name of the submit button. Defaults to "submit". If no id attribute
- * is given in $other_attributes below, $name will be used as the button's id.
- * @param bool $wrap True if the output button should be wrapped in a paragraph tag,
- * false otherwise. Defaults to true
- * @param array|string $other_attributes Other attributes that should be output with the button,
- * mapping attributes to their values, such as array( 'tabindex' => '1' ).
- * These attributes will be output as attribute="value", such as tabindex="1".
- * Defaults to no other attributes. Other attributes can also be provided as a
- * string such as 'tabindex="1"', though the array format is typically cleaner.
+ * @see get_submit_button()
+ *
+ * @param string $text The text of the button (defaults to 'Save Changes')
+ * @param string $type Optional. The type and CSS class(es) of the button. Core values
+ * include 'primary', 'secondary', 'delete'. Default 'primary'
+ * @param string $name The HTML name of the submit button. Defaults to "submit". If no
+ * id attribute is given in $other_attributes below, $name will be
+ * used as the button's id.
+ * @param bool $wrap True if the output button should be wrapped in a paragraph tag,
+ * false otherwise. Defaults to true
+ * @param array|string $other_attributes Other attributes that should be output with the button, mapping
+ * attributes to their values, such as setting tabindex to 1, etc.
+ * These key/value attribute pairs will be output as attribute="value",
+ * where attribute is the key. Other attributes can also be provided
+ * as a string such as 'tabindex="1"', though the array format is
+ * preferred. Default null.
*/
function submit_button( $text = null, $type = 'primary', $name = 'submit', $wrap = true, $other_attributes = null ) {
echo get_submit_button( $text, $type, $name, $wrap, $other_attributes );
@@ -1692,13 +1801,19 @@ function _wp_admin_html_begin() {
if ( $is_IE )
@header('X-UA-Compatible: IE=edge');
+/**
+ * Fires inside the HTML tag in the admin header.
+ *
+ * @since 2.2.0
+ */
?>
- >
+
+ >
@@ -1714,8 +1829,8 @@ final class WP_Internal_Pointers {
* All pointers can be disabled using the following:
* remove_action( 'admin_enqueue_scripts', array( 'WP_Internal_Pointers', 'enqueue_scripts' ) );
*
- * Individual pointers (e.g. wp330_toolbar) can be disabled using the following:
- * remove_action( 'admin_print_footer_scripts', array( 'WP_Internal_Pointers', 'pointer_wp330_toolbar' ) );
+ * Individual pointers (e.g. wp390_widgets) can be disabled using the following:
+ * remove_action( 'admin_print_footer_scripts', array( 'WP_Internal_Pointers', 'pointer_wp390_widgets' ) );
*/
public static function enqueue_scripts( $hook_suffix ) {
/*
@@ -1724,13 +1839,11 @@ final class WP_Internal_Pointers {
*/
$registered_pointers = array(
- 'index.php' => 'wp330_toolbar',
'post-new.php' => 'wp350_media',
'post.php' => array( 'wp350_media', 'wp360_revisions' ),
'edit.php' => 'wp360_locks',
- 'themes.php' => array( 'wp330_saving_widgets', 'wp340_customize_current_theme_link' ),
- 'appearance_page_custom-header' => 'wp340_choose_image_from_library',
- 'appearance_page_custom-background' => 'wp340_choose_image_from_library',
+ 'widgets.php' => 'wp390_widgets',
+ 'themes.php' => 'wp390_widgets',
);
// Check if screen related pointer is registered
@@ -1740,10 +1853,8 @@ final class WP_Internal_Pointers {
$pointers = (array) $registered_pointers[ $hook_suffix ];
$caps_required = array(
- 'wp330_saving_widgets' => array( 'edit_theme_options', 'switch_themes' ),
- 'wp340_customize_current_theme_link' => array( 'edit_theme_options' ),
- 'wp340_choose_image_from_library' => array( 'edit_theme_options' ),
'wp350_media' => array( 'upload_files' ),
+ 'wp390_widgets' => array( 'edit_theme_options' ),
);
// Get dismissed pointers
@@ -1817,71 +1928,11 @@ final class WP_Internal_Pointers {
' . __( 'New Feature: Toolbar' ) . '';
- $content .= '
' . __( 'We’ve combined the admin bar and the old Dashboard header into one persistent toolbar. Hover over the toolbar items to see what’s new.' ) . '
';
-
- if ( is_multisite() && is_super_admin() )
- $content .= '
' . __( 'Network Admin is now located in the My Sites menu.' ) . '
';
-
- WP_Internal_Pointers::print_js( 'wp330_toolbar', '#wpadminbar', array(
- 'content' => $content,
- 'position' => array( 'edge' => 'top', 'align' => 'center' ),
- ) );
- }
-
- /**
- * Print 'Updated Media Uploader' for 3.3.0.
- *
- * @since 3.3.0
- */
+ public static function pointer_wp330_toolbar() {}
public static function pointer_wp330_media_uploader() {}
-
- /**
- * Print 'New Feature: Saving Widgets' for 3.3.0.
- *
- * @since 3.3.0
- */
- public static function pointer_wp330_saving_widgets() {
- $content = '
' . __( 'New Feature: Saving Widgets' ) . '
';
- $content .= '
' . __( 'If you change your mind and revert to your previous theme, we’ll put the widgets back the way you had them.' ) . '
';
-
- WP_Internal_Pointers::print_js( 'wp330_saving_widgets', '#message2', array(
- 'content' => $content,
- 'position' => array( 'edge' => 'top', 'align' => is_rtl() ? 'right' : 'left' ),
- ) );
- }
-
- /**
- * Print 'New Feature: Current Theme Customize Link' for 3.4.0.
- *
- * @since 3.4.0
- */
- public static function pointer_wp340_customize_current_theme_link() {
- $content = '
' . __( 'New Feature: Customizer' ) . '
';
- $content .= '
' . __( 'Click Customize to change the header, background, title and menus of the current theme, all in one place.' ) . '
';
- $content .= '
' . __( 'Click the Live Preview links in the Available Themes list below to customize and preview another theme before activating it.' ) . '
';
-
- WP_Internal_Pointers::print_js( 'wp340_customize_current_theme_link', '#customize-current-theme-link', array(
- 'content' => $content,
- 'position' => array( 'edge' => 'top', 'align' => is_rtl() ? 'right' : 'left', 'offset' => is_rtl() ? '32 0' : '-32 0' ),
- ) );
- }
-
- /**
- * Print 'New Feature: Choose Image from Library' for 3.4.0.
- *
- * @since 3.4.0
- */
- public static function pointer_wp340_choose_image_from_library() {
- $content = '
' . __( 'New Feature: Choose Image from Library' ) . '
';
- $content .= '
' . __( 'Want to use an image you uploaded earlier? Select it from your media library instead of uploading it again.' ) . '
';
-
- WP_Internal_Pointers::print_js( 'wp340_choose_image_from_library', '#choose-from-library-link', array(
- 'content' => $content,
- 'position' => array( 'edge' => 'top', 'align' => is_rtl() ? 'right' : 'left', 'defer_loading' => true ),
- ) );
- }
+ public static function pointer_wp330_saving_widgets() {}
+ public static function pointer_wp340_customize_current_theme_link() {}
+ public static function pointer_wp340_choose_image_from_library() {}
public static function pointer_wp350_media() {
$content = '
' . __( 'New Media Manager' ) . '
';
@@ -1904,25 +1955,52 @@ final class WP_Internal_Pointers {
}
public static function pointer_wp360_locks() {
+ if ( ! is_multi_author() ) {
+ return;
+ }
+
$content = '
' . __( 'Edit Lock' ) . '
';
$content .= '
' . __( 'Someone else is editing this. No need to refresh; the lock will disappear when they’re done.' ) . '
';
- if ( ! is_multi_author() )
- return;
-
self::print_js( 'wp360_locks', 'tr.wp-locked .locked-indicator', array(
'content' => $content,
'position' => array( 'edge' => 'left', 'align' => 'left' ),
) );
}
+ public static function pointer_wp390_widgets() {
+ if ( ! current_theme_supports( 'widgets' ) ) {
+ return;
+ }
+
+ $content = '
' . __( 'New Feature: Live Widget Previews' ) . '
';
+ $content .= '
' . __( 'Add, edit, and play around with your widgets from the theme customizer.' ) . ' ' . __( 'Preview your changes in real-time and only save them when you’re ready.' ) . '
';
+
+ if ( 'themes' === get_current_screen()->id ) {
+ $selector = '.theme.active .customize';
+ $position = array( 'edge' => is_rtl() ? 'right' : 'left', 'align' => 'center', 'my' => is_rtl() ? 'right-13px' : '' );
+ } else {
+ $selector = 'a[href="customize.php"]';
+ if ( is_rtl() ) {
+ $position = array( 'edge' => 'right', 'align' => 'center', 'my' => 'right-5px' );
+ } else {
+ $position = array( 'edge' => 'left', 'align' => 'center', 'my' => 'left-5px' );
+ }
+ }
+
+ self::print_js( 'wp390_widgets', $selector, array(
+ 'content' => $content,
+ 'position' => $position,
+ ) );
+ }
+
/**
* Prevents new users from seeing existing 'new feature' pointers.
*
* @since 3.3.0
*/
public static function dismiss_pointers_for_new_users( $user_id ) {
- 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,wp360_revisions,wp360_locks' );
+ add_user_meta( $user_id, 'dismissed_wp_pointers', 'wp350_media,wp360_revisions,wp360_locks,wp390_widgets' );
}
}
@@ -1949,7 +2027,7 @@ function convert_to_screen( $hook_name ) {
/**
* Output the HTML for restoring the post data from DOM storage
*
- * @since 3.6
+ * @since 3.6.0
* @access private
*/
function _local_storage_notice() {
@@ -2021,4 +2099,4 @@ function wp_star_rating( $args = array() ) {
echo str_repeat( '
', $half_stars );
echo str_repeat( '
', $empty_stars);
echo '
';
-}
\ No newline at end of file
+}