mirror of
https://github.com/WordPress/WordPress.git
synced 2025-12-08 05:15:15 +08:00
Compare commits
5 commits
376c614964
...
7413166cfe
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7413166cfe | ||
|
|
a49aba3014 | ||
|
|
32de466672 | ||
|
|
e8d1cb9adc | ||
|
|
8335c4c775 |
29 changed files with 51 additions and 31 deletions
|
|
@ -367,7 +367,7 @@ class WP_Media_List_Table extends WP_List_Table {
|
|||
if ( ! $this->detached ) {
|
||||
$posts_columns['parent'] = _x( 'Uploaded to', 'column name' );
|
||||
|
||||
if ( post_type_supports( 'attachment', 'comments' ) ) {
|
||||
if ( post_type_supports( 'attachment', 'comments' ) && get_option( 'wp_attachment_pages_enabled' ) ) {
|
||||
$posts_columns['comments'] = sprintf(
|
||||
'<span class="vers comment-grey-bubble" title="%1$s" aria-hidden="true"></span><span class="screen-reader-text">%2$s</span>',
|
||||
esc_attr__( 'Comments' ),
|
||||
|
|
|
|||
|
|
@ -2276,7 +2276,7 @@ function user_can_access_admin_page() {
|
|||
* @global array $new_allowed_options
|
||||
*
|
||||
* @param array $options
|
||||
* @return array
|
||||
* @return array Updated allowed options.
|
||||
*/
|
||||
function option_update_filter( $options ) {
|
||||
global $new_allowed_options;
|
||||
|
|
@ -2297,7 +2297,7 @@ function option_update_filter( $options ) {
|
|||
*
|
||||
* @param array $new_options
|
||||
* @param string|array $options
|
||||
* @return array
|
||||
* @return array Updated allowed options.
|
||||
*/
|
||||
function add_allowed_options( $new_options, $options = '' ) {
|
||||
if ( '' === $options ) {
|
||||
|
|
@ -2332,7 +2332,7 @@ function add_allowed_options( $new_options, $options = '' ) {
|
|||
*
|
||||
* @param array $del_options
|
||||
* @param string|array $options
|
||||
* @return array
|
||||
* @return array Updated allowed options.
|
||||
*/
|
||||
function remove_allowed_options( $del_options, $options = '' ) {
|
||||
if ( '' === $options ) {
|
||||
|
|
|
|||
|
|
@ -2831,7 +2831,7 @@ function get_alloptions_110() {
|
|||
* @global wpdb $wpdb WordPress database abstraction object.
|
||||
*
|
||||
* @param string $setting Option name.
|
||||
* @return mixed
|
||||
* @return mixed Option value.
|
||||
*/
|
||||
function __get_option( $setting ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore,PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.FunctionDoubleUnderscore
|
||||
global $wpdb;
|
||||
|
|
@ -3374,7 +3374,7 @@ function make_db_current_silent( $tables = 'all' ) {
|
|||
*
|
||||
* @param string $theme_name The name of the theme.
|
||||
* @param string $template The directory name of the theme.
|
||||
* @return bool
|
||||
* @return bool True on success, false on failure.
|
||||
*/
|
||||
function make_site_theme_from_oldschool( $theme_name, $template ) {
|
||||
$home_path = get_home_path();
|
||||
|
|
|
|||
|
|
@ -306,7 +306,7 @@ function get_user_to_edit( $user_id ) {
|
|||
* @global wpdb $wpdb WordPress database abstraction object.
|
||||
*
|
||||
* @param int $user_id User ID.
|
||||
* @return array
|
||||
* @return object[] The user's draft posts, with 'ID' and 'post_title' keys.
|
||||
*/
|
||||
function get_users_drafts( $user_id ) {
|
||||
global $wpdb;
|
||||
|
|
@ -603,7 +603,7 @@ function use_ssl_preference( $user ) {
|
|||
* @since MU (3.0.0)
|
||||
*
|
||||
* @param string $text
|
||||
* @return string
|
||||
* @return string User site invitation email message.
|
||||
*/
|
||||
function admin_created_user_email( $text ) {
|
||||
$roles = get_editable_roles();
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ function wp_list_widgets() {
|
|||
*
|
||||
* @param array $a First array.
|
||||
* @param array $b Second array.
|
||||
* @return int
|
||||
* @return int Comparison result.
|
||||
*/
|
||||
function _sort_name_callback( $a, $b ) {
|
||||
return strnatcasecmp( $a['name'], $b['name'] );
|
||||
|
|
@ -129,7 +129,7 @@ function wp_list_widget_controls( $sidebar, $sidebar_name = '' ) {
|
|||
* @global array $wp_registered_widgets
|
||||
*
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @return array Widget control arguments.
|
||||
*/
|
||||
function wp_list_widget_controls_dynamic_sidebar( $params ) {
|
||||
global $wp_registered_widgets;
|
||||
|
|
@ -157,7 +157,7 @@ function wp_list_widget_controls_dynamic_sidebar( $params ) {
|
|||
* @global array $wp_registered_widgets
|
||||
*
|
||||
* @param string $id_base
|
||||
* @return int
|
||||
* @return int Next available widget ID number.
|
||||
*/
|
||||
function next_widget_id_number( $id_base ) {
|
||||
global $wp_registered_widgets;
|
||||
|
|
@ -185,7 +185,7 @@ function next_widget_id_number( $id_base ) {
|
|||
* @global array $sidebars_widgets
|
||||
*
|
||||
* @param array $sidebar_args
|
||||
* @return array
|
||||
* @return array Passed through value of `$sidebar_args` param.
|
||||
*/
|
||||
function wp_widget_control( $sidebar_args ) {
|
||||
global $wp_registered_widgets, $wp_registered_widget_controls, $sidebars_widgets;
|
||||
|
|
@ -322,7 +322,7 @@ function wp_widget_control( $sidebar_args ) {
|
|||
|
||||
/**
|
||||
* @param string $classes
|
||||
* @return string
|
||||
* @return string Modified body classes.
|
||||
*/
|
||||
function wp_widgets_access_body_class( $classes ) {
|
||||
return "$classes widgets_access ";
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -27,7 +27,7 @@ function wp_get_elements_class_name( $block ) {
|
|||
*
|
||||
* @param array $block Block object.
|
||||
* @param array $options Per element type options e.g. whether to skip serialization.
|
||||
* @return boolean Whether the block needs an elements class name.
|
||||
* @return bool Whether the block needs an elements class name.
|
||||
*/
|
||||
function wp_should_add_elements_class_name( $block, $options ) {
|
||||
if ( ! isset( $block['attrs']['style']['elements'] ) ) {
|
||||
|
|
|
|||
|
|
@ -681,7 +681,7 @@ class WP_Theme_JSON_Resolver {
|
|||
*
|
||||
* @since 5.9.0
|
||||
*
|
||||
* @return integer|null
|
||||
* @return int|null ID for a post of type `wp_global_styles`, or null if not available.
|
||||
*/
|
||||
public static function get_user_global_styles_post_id() {
|
||||
if ( null !== static::$user_custom_post_type_id ) {
|
||||
|
|
@ -704,7 +704,7 @@ class WP_Theme_JSON_Resolver {
|
|||
* @since 5.9.0 Added a check in the parent theme.
|
||||
* @deprecated 6.2.0 Use wp_theme_has_theme_json() instead.
|
||||
*
|
||||
* @return bool
|
||||
* @return bool Whether the active theme has a theme.json file.
|
||||
*/
|
||||
public static function theme_has_support() {
|
||||
_deprecated_function( __METHOD__, '6.2.0', 'wp_theme_has_theme_json()' );
|
||||
|
|
@ -780,7 +780,7 @@ class WP_Theme_JSON_Resolver {
|
|||
*
|
||||
* @param array $variation Theme.json shaped style variation object.
|
||||
* @param string $scope Scope to check e.g. theme, block etc.
|
||||
* @return boolean
|
||||
* @return bool Whether the supplied style variation matches the provided scope.
|
||||
*/
|
||||
private static function style_variation_has_scope( $variation, $scope ) {
|
||||
if ( 'block' === $scope ) {
|
||||
|
|
@ -805,7 +805,7 @@ class WP_Theme_JSON_Resolver {
|
|||
* Added basic caching for read theme.json partial files.
|
||||
*
|
||||
* @param string $scope The scope or type of style variation to retrieve e.g. theme, block etc.
|
||||
* @return array
|
||||
* @return array The style variations defined by the theme.
|
||||
*/
|
||||
public static function get_style_variations( $scope = 'theme' ) {
|
||||
$variation_files = array();
|
||||
|
|
|
|||
|
|
@ -2769,7 +2769,7 @@ function wp_update_comment( $commentarr, $wp_error = false ) {
|
|||
* @since 2.5.0
|
||||
*
|
||||
* @param bool $defer
|
||||
* @return bool
|
||||
* @return bool Whether comment counting is deferred.
|
||||
*/
|
||||
function wp_defer_comment_counting( $defer = null ) {
|
||||
static $_defer = false;
|
||||
|
|
@ -3371,7 +3371,7 @@ function weblog_ping( $server = '', $path = '' ) {
|
|||
* @see wp_http_validate_url()
|
||||
*
|
||||
* @param string $source_uri
|
||||
* @return string
|
||||
* @return string Validated source URI.
|
||||
*/
|
||||
function pingback_ping_source_uri( $source_uri ) {
|
||||
return (string) wp_http_validate_url( $source_uri );
|
||||
|
|
|
|||
|
|
@ -65,6 +65,9 @@ class WP_Customize_Header_Image_Control extends WP_Customize_Image_Control {
|
|||
}
|
||||
|
||||
/**
|
||||
* Enqueues control related scripts/styles.
|
||||
*
|
||||
* @since 3.9.0
|
||||
*/
|
||||
public function enqueue() {
|
||||
wp_enqueue_media();
|
||||
|
|
@ -96,6 +99,10 @@ class WP_Customize_Header_Image_Control extends WP_Customize_Image_Control {
|
|||
}
|
||||
|
||||
/**
|
||||
* Prepares the control.
|
||||
*
|
||||
* @since 3.9.0
|
||||
*
|
||||
* @global Custom_Image_Header $custom_image_header
|
||||
*/
|
||||
public function prepare_control() {
|
||||
|
|
@ -113,6 +120,9 @@ class WP_Customize_Header_Image_Control extends WP_Customize_Image_Control {
|
|||
}
|
||||
|
||||
/**
|
||||
* Prints header image template.
|
||||
*
|
||||
* @since 3.9.0
|
||||
*/
|
||||
public function print_header_image_template() {
|
||||
?>
|
||||
|
|
@ -179,6 +189,10 @@ class WP_Customize_Header_Image_Control extends WP_Customize_Image_Control {
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets current image source.
|
||||
*
|
||||
* @since 3.9.0
|
||||
*
|
||||
* @return string|void
|
||||
*/
|
||||
public function get_current_image_src() {
|
||||
|
|
@ -190,6 +204,9 @@ class WP_Customize_Header_Image_Control extends WP_Customize_Image_Control {
|
|||
}
|
||||
|
||||
/**
|
||||
* Renders the control's content.
|
||||
*
|
||||
* @since 3.9.0
|
||||
*/
|
||||
public function render_content() {
|
||||
$visibility = $this->get_current_image_src() ? '' : ' style="display:none" ';
|
||||
|
|
|
|||
|
|
@ -803,7 +803,7 @@ function wp_replace_in_html_tags( $haystack, $replace_pairs ) {
|
|||
* @access private
|
||||
*
|
||||
* @param array $matches preg_replace_callback matches array
|
||||
* @return string
|
||||
* @return string Text with newlines replaced with placeholders.
|
||||
*/
|
||||
function _autop_newline_preservation_helper( $matches ) {
|
||||
return str_replace( "\n", '<WPPreserveNewline />', $matches[0] );
|
||||
|
|
@ -4680,7 +4680,7 @@ function esc_js( $text ) {
|
|||
* @since 2.8.0
|
||||
*
|
||||
* @param string $text
|
||||
* @return string
|
||||
* @return string Escaped text.
|
||||
*/
|
||||
function esc_html( $text ) {
|
||||
$safe_text = wp_check_invalid_utf8( $text );
|
||||
|
|
@ -4705,7 +4705,7 @@ function esc_html( $text ) {
|
|||
* @since 2.8.0
|
||||
*
|
||||
* @param string $text
|
||||
* @return string
|
||||
* @return string Escaped text.
|
||||
*/
|
||||
function esc_attr( $text ) {
|
||||
$safe_text = wp_check_invalid_utf8( $text );
|
||||
|
|
@ -4730,7 +4730,7 @@ function esc_attr( $text ) {
|
|||
* @since 3.1.0
|
||||
*
|
||||
* @param string $text
|
||||
* @return string
|
||||
* @return string Escaped text.
|
||||
*/
|
||||
function esc_textarea( $text ) {
|
||||
$safe_text = htmlspecialchars( $text, ENT_QUOTES, get_option( 'blog_charset' ) );
|
||||
|
|
@ -4809,7 +4809,7 @@ EOF;
|
|||
* @since 6.5.5 Allow hyphens in tag names (i.e. custom elements).
|
||||
*
|
||||
* @param string $tag_name
|
||||
* @return string
|
||||
* @return string Sanitized tag name.
|
||||
*/
|
||||
function tag_escape( $tag_name ) {
|
||||
$safe_tag = strtolower( preg_replace( '/[^a-zA-Z0-9-_:]/', '', $tag_name ) );
|
||||
|
|
@ -5683,7 +5683,7 @@ function _sanitize_text_fields( $str, $keep_newlines = false ) {
|
|||
*
|
||||
* @param string $path A path.
|
||||
* @param string $suffix If the filename ends in suffix this will also be cut off.
|
||||
* @return string
|
||||
* @return string The base name of the given path.
|
||||
*/
|
||||
function wp_basename( $path, $suffix = '' ) {
|
||||
return urldecode( basename( str_replace( array( '%2F', '%5C' ), '/', urlencode( $path ) ), $suffix ) );
|
||||
|
|
|
|||
|
|
@ -6568,7 +6568,7 @@ function wp_timezone_override_offset() {
|
|||
*
|
||||
* @param array $a
|
||||
* @param array $b
|
||||
* @return int
|
||||
* @return int Comparison result.
|
||||
*/
|
||||
function _wp_timezone_choice_usort_callback( $a, $b ) {
|
||||
// Don't use translated versions of Etc.
|
||||
|
|
@ -6625,7 +6625,7 @@ function _wp_timezone_choice_usort_callback( $a, $b ) {
|
|||
*
|
||||
* @param string $selected_zone Selected timezone.
|
||||
* @param string $locale Optional. Locale to load the timezones in. Default current site locale.
|
||||
* @return string
|
||||
* @return string HTML select element for timezones.
|
||||
*/
|
||||
function wp_timezone_choice( $selected_zone, $locale = null ) {
|
||||
static $mo_loaded = false, $locale_loaded = null;
|
||||
|
|
@ -6827,7 +6827,7 @@ function wp_timezone_choice( $selected_zone, $locale = null ) {
|
|||
* @see https://core.trac.wordpress.org/ticket/8497
|
||||
*
|
||||
* @param string $str Header comment to clean up.
|
||||
* @return string
|
||||
* @return string Cleaned header comment.
|
||||
*/
|
||||
function _cleanup_header_comment( $str ) {
|
||||
return trim( preg_replace( '/\s*(?:\*\/|\?>).*/', '', $str ) );
|
||||
|
|
|
|||
|
|
@ -606,7 +606,10 @@ function get_post_class( $css_class = '', $post = null ) {
|
|||
*/
|
||||
$classes = apply_filters( 'post_class', $classes, $css_class, $post->ID );
|
||||
|
||||
return array_unique( $classes );
|
||||
$classes = array_unique( $classes );
|
||||
$classes = array_values( $classes );
|
||||
|
||||
return $classes;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '7.0-alpha-61262';
|
||||
$wp_version = '7.0-alpha-61271';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue