diff --git a/wp-admin/includes/plugin-install.php b/wp-admin/includes/plugin-install.php index 6081bff05c..20aece0153 100644 --- a/wp-admin/includes/plugin-install.php +++ b/wp-admin/includes/plugin-install.php @@ -427,6 +427,7 @@ function install_plugin_install_status( $api, $loop = false ) { $status = 'install'; $url = false; $update_file = false; + $version = ''; /* * Check to see if this plugin is known to be installed, diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index a970116e68..0d599ef542 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -1099,18 +1099,24 @@ function wp_edit_posts_query( $q = false ) { } $avail_post_stati = get_available_post_statuses( $post_type ); + $post_status = ''; + $perm = ''; if ( isset( $q['post_status'] ) && in_array( $q['post_status'], $post_stati ) ) { $post_status = $q['post_status']; $perm = 'readable'; } + $orderby = ''; + if ( isset( $q['orderby'] ) ) { $orderby = $q['orderby']; } elseif ( isset( $q['post_status'] ) && in_array( $q['post_status'], array( 'pending', 'draft' ) ) ) { $orderby = 'modified'; } + $order = ''; + if ( isset( $q['order'] ) ) { $order = $q['order']; } elseif ( isset( $q['post_status'] ) && 'pending' == $q['post_status'] ) { diff --git a/wp-includes/class-wp-block-parser.php b/wp-includes/class-wp-block-parser.php index 439a2ce32b..216cb9a5f7 100644 --- a/wp-includes/class-wp-block-parser.php +++ b/wp-includes/class-wp-block-parser.php @@ -63,10 +63,10 @@ class WP_Block_Parser_Block { public $innerContent; function __construct( $name, $attrs, $innerBlocks, $innerHTML, $innerContent ) { - $this->blockName = $name; - $this->attrs = $attrs; - $this->innerBlocks = $innerBlocks; - $this->innerHTML = $innerHTML; + $this->blockName = $name; + $this->attrs = $attrs; + $this->innerBlocks = $innerBlocks; + $this->innerHTML = $innerHTML; $this->innerContent = $innerContent; } } @@ -269,17 +269,15 @@ class WP_Block_Parser { */ if ( 0 === $stack_depth ) { if ( isset( $leading_html_start ) ) { - $this->output[] = (array) self::freeform( - substr( - $this->document, - $leading_html_start, - $start_offset - $leading_html_start - ) - ); + $this->output[] = (array) self::freeform( substr( + $this->document, + $leading_html_start, + $start_offset - $leading_html_start + ) ); } $this->output[] = (array) new WP_Block_Parser_Block( $block_name, $attrs, array(), '', array() ); - $this->offset = $start_offset + $token_length; + $this->offset = $start_offset + $token_length; return true; } @@ -294,16 +292,13 @@ class WP_Block_Parser { case 'block-opener': // track all newly-opened blocks on the stack - array_push( - $this->stack, - new WP_Block_Parser_Frame( - new WP_Block_Parser_Block( $block_name, $attrs, array(), '', array() ), - $start_offset, - $token_length, - $start_offset + $token_length, - $leading_html_start - ) - ); + array_push( $this->stack, new WP_Block_Parser_Frame( + new WP_Block_Parser_Block( $block_name, $attrs, array(), '', array() ), + $start_offset, + $token_length, + $start_offset + $token_length, + $leading_html_start + ) ); $this->offset = $start_offset + $token_length; return true; @@ -334,11 +329,11 @@ class WP_Block_Parser { * otherwise we're nested and we have to close out the current * block and add it as a new innerBlock to the parent */ - $stack_top = array_pop( $this->stack ); - $html = substr( $this->document, $stack_top->prev_offset, $start_offset - $stack_top->prev_offset ); - $stack_top->block->innerHTML .= $html; + $stack_top = array_pop( $this->stack ); + $html = substr( $this->document, $stack_top->prev_offset, $start_offset - $stack_top->prev_offset ); + $stack_top->block->innerHTML .= $html; $stack_top->block->innerContent[] = $html; - $stack_top->prev_offset = $start_offset + $token_length; + $stack_top->prev_offset = $start_offset + $token_length; $this->add_inner_block( $stack_top->block, @@ -396,22 +391,22 @@ class WP_Block_Parser { return array( 'no-more-tokens', null, null, null, null ); } - list( $match, $started_at ) = $matches[0]; + list( $match, $started_at ) = $matches[ 0 ]; $length = strlen( $match ); - $is_closer = isset( $matches['closer'] ) && -1 !== $matches['closer'][1]; - $is_void = isset( $matches['void'] ) && -1 !== $matches['void'][1]; - $namespace = $matches['namespace']; - $namespace = ( isset( $namespace ) && -1 !== $namespace[1] ) ? $namespace[0] : 'core/'; - $name = $namespace . $matches['name'][0]; - $has_attrs = isset( $matches['attrs'] ) && -1 !== $matches['attrs'][1]; + $is_closer = isset( $matches[ 'closer' ] ) && -1 !== $matches[ 'closer' ][ 1 ]; + $is_void = isset( $matches[ 'void' ] ) && -1 !== $matches[ 'void' ][ 1 ]; + $namespace = $matches[ 'namespace' ]; + $namespace = ( isset( $namespace ) && -1 !== $namespace[ 1 ] ) ? $namespace[ 0 ] : 'core/'; + $name = $namespace . $matches[ 'name' ][ 0 ]; + $has_attrs = isset( $matches[ 'attrs' ] ) && -1 !== $matches[ 'attrs' ][ 1 ]; /* * Fun fact! It's not trivial in PHP to create "an empty associative array" since all arrays * are associative arrays. If we use `array()` we get a JSON `[]` */ $attrs = $has_attrs - ? json_decode( $matches['attrs'][0], /* as-associative */ true ) + ? json_decode( $matches[ 'attrs' ][ 0 ], /* as-associative */ true ) : $this->empty_attrs; /* @@ -476,17 +471,17 @@ class WP_Block_Parser { * @param int|null $last_offset last byte offset into document if continuing form earlier output */ function add_inner_block( WP_Block_Parser_Block $block, $token_start, $token_length, $last_offset = null ) { - $parent = $this->stack[ count( $this->stack ) - 1 ]; + $parent = $this->stack[ count( $this->stack ) - 1 ]; $parent->block->innerBlocks[] = (array) $block; - $html = substr( $this->document, $parent->prev_offset, $token_start - $parent->prev_offset ); + $html = substr( $this->document, $parent->prev_offset, $token_start - $parent->prev_offset ); if ( ! empty( $html ) ) { - $parent->block->innerHTML .= $html; + $parent->block->innerHTML .= $html; $parent->block->innerContent[] = $html; } $parent->block->innerContent[] = null; - $parent->prev_offset = $last_offset ? $last_offset : $token_start + $token_length; + $parent->prev_offset = $last_offset ? $last_offset : $token_start + $token_length; } /** @@ -505,18 +500,16 @@ class WP_Block_Parser { : substr( $this->document, $prev_offset ); if ( ! empty( $html ) ) { - $stack_top->block->innerHTML .= $html; + $stack_top->block->innerHTML .= $html; $stack_top->block->innerContent[] = $html; } if ( isset( $stack_top->leading_html_start ) ) { - $this->output[] = (array) self::freeform( - substr( - $this->document, - $stack_top->leading_html_start, - $stack_top->token_start - $stack_top->leading_html_start - ) - ); + $this->output[] = (array) self::freeform( substr( + $this->document, + $stack_top->leading_html_start, + $stack_top->token_start - $stack_top->leading_html_start + ) ); } $this->output[] = (array) $stack_top->block; diff --git a/wp-includes/version.php b/wp-includes/version.php index 618f820af0..9931f352ba 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.1-alpha-44296'; +$wp_version = '5.1-alpha-44297'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.