@@ -1204,21 +1196,23 @@ function do_accordion_sections( $screen, $context, $object ) {
*
* @global $wp_settings_sections Storage array of all settings sections added to admin pages
*
- * @param string $id Slug-name to identify the section. Used in the 'id' attribute of tags.
- * @param string $title Formatted title of the section. Shown as the heading for the section.
- * @param string $callback Function that echos out any content at the top of the section (between heading and fields).
- * @param string $page The slug-name of the settings page on which to show the section. Built-in pages include 'general', 'reading', 'writing', 'discussion', 'media', etc. Create your own using add_options_page();
+ * @param string $id Slug-name to identify the section. Used in the 'id' attribute of tags.
+ * @param string $title Formatted title of the section. Shown as the heading for the section.
+ * @param callable $callback Function that echos out any content at the top of the section (between heading and fields).
+ * @param string $page The slug-name of the settings page on which to show the section. Built-in pages include
+ * 'general', 'reading', 'writing', 'discussion', 'media', etc. Create your own using
+ * add_options_page();
*/
function add_settings_section($id, $title, $callback, $page) {
global $wp_settings_sections;
if ( 'misc' == $page ) {
- _deprecated_argument( __FUNCTION__, '3.0', sprintf( __( 'The "%s" options group has been removed. Use another settings group.' ), 'misc' ) );
+ _deprecated_argument( __FUNCTION__, '3.0.0', sprintf( __( 'The "%s" options group has been removed. Use another settings group.' ), 'misc' ) );
$page = 'general';
}
if ( 'privacy' == $page ) {
- _deprecated_argument( __FUNCTION__, '3.5', sprintf( __( 'The "%s" options group has been removed. Use another settings group.' ), 'privacy' ) );
+ _deprecated_argument( __FUNCTION__, '3.5.0', sprintf( __( 'The "%s" options group has been removed. Use another settings group.' ), 'privacy' ) );
$page = 'reading';
}
@@ -1241,16 +1235,16 @@ function add_settings_section($id, $title, $callback, $page) {
*
* @global $wp_settings_fields Storage array of settings fields and info about their pages/sections
*
- * @param string $id Slug-name to identify the field. Used in the 'id' attribute of tags.
- * @param string $title Formatted title of the field. Shown as the label for the field
- * during output.
- * @param string $callback Function that fills the field with the desired form inputs. The
- * function should echo its output.
- * @param string $page The slug-name of the settings page on which to show the section
- * (general, reading, writing, ...).
- * @param string $section Optional. The slug-name of the section of the settings page
- * in which to show the box. Default 'default'.
- * @param array $args {
+ * @param string $id Slug-name to identify the field. Used in the 'id' attribute of tags.
+ * @param string $title Formatted title of the field. Shown as the label for the field
+ * during output.
+ * @param callable $callback Function that fills the field with the desired form inputs. The
+ * function should echo its output.
+ * @param string $page The slug-name of the settings page on which to show the section
+ * (general, reading, writing, ...).
+ * @param string $section Optional. The slug-name of the section of the settings page
+ * in which to show the box. Default 'default'.
+ * @param array $args {
* Optional. Extra arguments used when outputting the field.
*
* @type string $label_for When supplied, the setting title will be wrapped
@@ -1264,12 +1258,12 @@ function add_settings_field($id, $title, $callback, $page, $section = 'default',
global $wp_settings_fields;
if ( 'misc' == $page ) {
- _deprecated_argument( __FUNCTION__, '3.0', __( 'The miscellaneous options group has been removed. Use another settings group.' ) );
+ _deprecated_argument( __FUNCTION__, '3.0.0', __( 'The miscellaneous options group has been removed. Use another settings group.' ) );
$page = 'general';
}
if ( 'privacy' == $page ) {
- _deprecated_argument( __FUNCTION__, '3.5', __( 'The privacy options group has been removed. Use another settings group.' ) );
+ _deprecated_argument( __FUNCTION__, '3.5.0', __( 'The privacy options group has been removed. Use another settings group.' ) );
$page = 'reading';
}
@@ -1287,7 +1281,7 @@ function add_settings_field($id, $title, $callback, $page, $section = 'default',
* @global $wp_settings_fields Storage array of settings fields and info about their pages/sections
* @since 2.7.0
*
- * @param string $page The slug name of the page whos settings sections you want to output
+ * @param string $page The slug name of the page whose settings sections you want to output
*/
function do_settings_sections( $page ) {
global $wp_settings_sections, $wp_settings_fields;
@@ -1297,7 +1291,7 @@ function do_settings_sections( $page ) {
foreach ( (array) $wp_settings_sections[$page] as $section ) {
if ( $section['title'] )
- echo "
{$section['title']}
\n";
+ echo "
{$section['title']}
\n";
if ( $section['callback'] )
call_user_func( $section['callback'], $section );
@@ -1399,7 +1393,8 @@ function add_settings_error( $setting, $code, $message, $type = 'error' ) {
*
* Use the $sanitize argument to manually re-sanitize the option before returning errors.
* This is useful if you have errors or notices you want to show even when the user
- * hasn't submitted data (i.e. when they first load an options page, or in admin_notices action hook)
+ * hasn't submitted data (i.e. when they first load an options page, or in the {@see 'admin_notices'}
+ * action hook).
*
* @since 3.0.0
*
@@ -1444,16 +1439,16 @@ function get_settings_errors( $setting = '', $sanitize = false ) {
}
/**
- * Display settings errors registered by {@see add_settings_error()}.
+ * Display settings errors registered by add_settings_error().
*
* Part of the Settings API. Outputs a div for each error retrieved by
- * {@see get_settings_errors()}.
+ * get_settings_errors().
*
* This is called automatically after a settings page based on the
* Settings API is submitted. Errors should be added during the validation
- * callback function for a setting defined in {@see register_setting()}
+ * callback function for a setting defined in register_setting().
*
- * The $sanitize option is passed into {@see get_settings_errors()} and will
+ * The $sanitize option is passed into get_settings_errors() and will
* re-run the setting sanitization
* on its current value.
*
@@ -1465,9 +1460,10 @@ function get_settings_errors( $setting = '', $sanitize = false ) {
*
* @since 3.0.0
*
- * @param string $setting Optional slug title of a specific setting who's errors you want.
- * @param boolean $sanitize Whether to re-sanitize the setting value before returning errors.
- * @param boolean $hide_on_update If set to true errors will not be shown if the settings page has already been submitted.
+ * @param string $setting Optional slug title of a specific setting who's errors you want.
+ * @param bool $sanitize Whether to re-sanitize the setting value before returning errors.
+ * @param bool $hide_on_update If set to true errors will not be shown if the settings page has
+ * already been submitted.
*/
function settings_errors( $setting = '', $sanitize = false, $hide_on_update = false ) {
@@ -1491,7 +1487,7 @@ function settings_errors( $setting = '', $sanitize = false, $hide_on_update = fa
}
/**
- * {@internal Missing Short Description}}
+ * Outputs the modal window used for attaching media to posts or pages in the media-listing screen.
*
* @since 2.7.0
*
@@ -1501,8 +1497,8 @@ function find_posts_div($found_action = '') {
?>
@@ -1520,7 +1516,7 @@ function find_posts_div($found_action = '') {
@@ -1528,10 +1524,9 @@ function find_posts_div($found_action = '') {
}
/**
- * Display the post password.
+ * Displays the post password.
*
- * The password is passed through {@link esc_attr()} to ensure that it
- * is safe for placing in an html attribute.
+ * The password is passed through esc_attr() to ensure that it is safe for placing in an html attribute.
*
* @since 2.7.0
*/
@@ -1560,10 +1555,10 @@ function _draft_or_post_title( $post = 0 ) {
}
/**
- * Display the search query.
+ * Displays the search query.
*
- * A simple wrapper to display the "s" parameter in a GET URI. This function
- * should only be used when {@link the_search_query()} cannot.
+ * A simple wrapper to display the "s" parameter in a `GET` URI. This function
+ * should only be used when the_search_query() cannot.
*
* @since 2.7.0
*/
@@ -1576,6 +1571,10 @@ function _admin_search_query() {
*
* @since 2.7.0
*
+ * @global string $hook_suffix
+ * @global string $admin_body_class
+ * @global WP_Locale $wp_locale
+ *
* @param string $title Optional. Title of the Iframe page. Default empty.
* @param bool $deprecated Not used.
*/
@@ -1626,7 +1625,7 @@ do_action( "admin_head-$hook_suffix" );
/** This action is documented in wp-admin/admin-header.php */
do_action( 'admin_head' );
-$admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) );
+$admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) );
if ( is_rtl() )
$admin_body_class .= ' rtl';
@@ -1637,7 +1636,11 @@ if ( is_rtl() )
/** This filter is documented in wp-admin/admin-header.php */
$admin_body_classes = apply_filters( 'admin_body_class', '' );
?>
- class="wp-admin wp-core-ui no-js iframe ">
+ class="wp-admin wp-core-ui no-js iframe ">
- ' . __( 'Edit Lock' ) . '';
- $content .= '
' . __( 'Someone else is editing this. No need to refresh; the lock will disappear when they’re done.' ) . '
';
-
- 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 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' );
- } 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,
- ) );
- }
-
- public static function pointer_wp410_dfw() {
- // Don't show when editor-scrolling is not used.
- if ( empty( $GLOBALS['_wp_editor_expand'] ) ) {
- return;
- }
-
- $content = '
' . __( 'Distraction-Free Writing' ) . '
';
- $content .= '
' . __( '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.' ) . '
';
-
- if ( is_rtl() ) {
- $position = array( 'edge' => 'left', 'align' => 'center', 'my' => 'left+40 top-11', 'at' => 'left top' );
- } else {
- $position = array( 'edge' => 'right', 'align' => 'center', 'my' => 'right-40 top-11', 'at' => 'right top' );
- }
-
- self::print_js( 'wp410_dfw', '#wp-content-wrap', array(
- 'content' => $content,
- 'position' => $position,
- ) );
- }
-
- /**
- * Prevents new users from seeing existing 'new feature' pointers.
- *
- * @since 3.3.0
- *
- * @param int $user_id User ID.
- */
- public static function dismiss_pointers_for_new_users( $user_id ) {
- add_user_meta( $user_id, 'dismissed_wp_pointers', 'wp360_locks,wp390_widgets' );
- }
-}
-
-add_action( 'admin_enqueue_scripts', array( 'WP_Internal_Pointers', 'enqueue_scripts' ) );
-add_action( 'user_register', array( 'WP_Internal_Pointers', 'dismiss_pointers_for_new_users' ) );
-
/**
* Convert a screen string to a screen object
*
@@ -2153,7 +2022,7 @@ add_action( 'user_register', array( 'WP_Internal_Pointers', 'dismiss_poi
*/
function convert_to_screen( $hook_name ) {
if ( ! class_exists( 'WP_Screen' ) ) {
- _doing_it_wrong( 'convert_to_screen(), add_meta_box()', __( "Likely direct inclusion of wp-admin/includes/template.php in order to use add_meta_box(). This is very wrong. Hook the add_meta_box() call into the add_meta_boxes action instead." ), '3.3' );
+ _doing_it_wrong( 'convert_to_screen(), add_meta_box()', __( "Likely direct inclusion of wp-admin/includes/template.php in order to use add_meta_box(). This is very wrong. Hook the add_meta_box() call into the add_meta_boxes action instead." ), '3.3.0' );
return (object) array( 'id' => '_invalid', 'base' => '_are_belong_to_us' );
}
@@ -2168,14 +2037,13 @@ function convert_to_screen( $hook_name ) {
*/
function _local_storage_notice() {
?>
-
+
0,
- 'type' => 'rating',
+ 'type' => 'rating',
'number' => 0,
+ 'echo' => true,
);
$r = wp_parse_args( $args, $defaults );
@@ -2229,12 +2102,18 @@ function wp_star_rating( $args = array() ) {
$title = sprintf( __( '%s rating' ), number_format_i18n( $rating, 1 ) );
}
- echo '
';
- echo '
' . $title . '';
- echo str_repeat( '
', $full_stars );
- echo str_repeat( '
', $half_stars );
- echo str_repeat( '
', $empty_stars);
- echo '
';
+ $output = '
';
+ $output .= '
' . $title . '';
+ $output .= str_repeat( '
', $full_stars );
+ $output .= str_repeat( '
', $half_stars );
+ $output .= str_repeat( '
', $empty_stars );
+ $output .= '
';
+
+ if ( $r['echo'] ) {
+ echo $output;
+ }
+
+ return $output;
}
/**