Skip to content

Commit

Permalink
Merge branch 'release/18.2' into trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
enricobattocchi committed Feb 11, 2022
2 parents abdf68b + 07d3eac commit c801101
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"typescript": "^4.2.4"
},
"yoast": {
"pluginVersion": "18.2-RC3"
"pluginVersion": "18.2-RC4"
},
"version": "0.0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,6 @@ export default class Question extends Component {
isSelected={ isSelected && subElement === "question" }
unstableOnFocus={ this.onFocusQuestion }
placeholder={ __( "Enter a question", "wordpress-seo" ) }
keepPlaceholderOnFocus={ true }
formattingControls={ [ "italic", "strikethrough", "link" ] }
/>
<RichText
Expand All @@ -357,7 +356,6 @@ export default class Question extends Component {
isSelected={ isSelected && subElement === "answer" }
unstableOnFocus={ this.onFocusAnswer }
placeholder={ __( "Enter the answer to the question", "wordpress-seo" ) }
keepPlaceholderOnFocus={ true }
/>
{ isSelected &&
<div className="schema-faq-section-controls-container">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,6 @@ export default class HowTo extends Component {
unstableOnFocus={ this.focusDescription }
onChange={ this.onChangeDescription }
placeholder={ __( "Enter a description", "wordpress-seo" ) }
keepPlaceholderOnFocus={ true }
/>
<ul className={ listClassNames }>
{ this.getSteps() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,6 @@ export default class HowToStep extends Component {
isSelected={ isSelected && subElement === "name" }
placeholder={ __( "Enter a step title", "wordpress-seo" ) }
unstableOnFocus={ this.onFocusTitle }
keepPlaceholderOnFocus={ true }
formattingControls={ [ "italic", "strikethrough", "link" ] }
/>
<RichTextWithAppendedSpace
Expand All @@ -346,7 +345,6 @@ export default class HowToStep extends Component {
isSelected={ isSelected && subElement === "text" }
placeholder={ __( "Enter a step description", "wordpress-seo" ) }
unstableOnFocus={ this.onFocusText }
keepPlaceholderOnFocus={ true }
/>
{ isSelected &&
<div className="schema-how-to-step-controls-container">
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ Bugfixes:

* Fixes a bug where the "Save changes" button would overlap with the admin sidebar on WordPress.com. Props to @DustyReagan.
* Fixes a bug where a (debug) deprecation message would show in the widget editor on WordPress 5.8 and above.
* Fixes a bug where a console warning would be thrown when adding a structured data block in the block editor, FSE editor or widget editor.

Other:

Expand Down
14 changes: 11 additions & 3 deletions src/integrations/blocks/structured-data-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ public function optimize_how_to_images( $attributes, $content ) {
*/
private function optimize_images( $elements, $key, $content ) {
global $post;
if ( ! $post ) {
return $content;
}

$this->add_images_from_attributes_to_used_cache( $post->ID, $elements, $key );

Expand All @@ -218,8 +221,8 @@ function ( $matches ) {
$image_size = 'full';
\preg_match( '/style="[^"]*width:\s*(\d+)px[^"]*"/', $matches[0], $style_matches );
if ( $style_matches && isset( $style_matches[1] ) ) {
$width = (int) $style_matches[1];
$meta_data = \wp_get_attachment_metadata( $attachment_id );
$width = (int) $style_matches[1];
$meta_data = \wp_get_attachment_metadata( $attachment_id );
if ( isset( $meta_data['height'] ) && isset( $meta_data['width'] ) && $meta_data['height'] > 0 && $meta_data['width'] > 0 ) {
$aspect_ratio = ( $meta_data['height'] / $meta_data['width'] );
$height = ( $width * $aspect_ratio );
Expand Down Expand Up @@ -349,6 +352,11 @@ private function add_images_from_attributes_to_used_cache( $post_id, $elements,
}
}

\array_merge( $this->used_caches[ $post_id ], $images );
if ( isset( $this->used_caches[ $post_id ] ) ) {
$this->used_caches[ $post_id ] = \array_merge( $this->used_caches[ $post_id ], $images );
}
else {
$this->used_caches[ $post_id ] = $images;
}
}
}
2 changes: 1 addition & 1 deletion wp-seo-main.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* {@internal Nobody should be able to overrule the real version number as this can cause
* serious issues with the options, so no if ( ! defined() ).}}
*/
define( 'WPSEO_VERSION', '18.2-RC3' );
define( 'WPSEO_VERSION', '18.2-RC4' );


if ( ! defined( 'WPSEO_PATH' ) ) {
Expand Down
2 changes: 1 addition & 1 deletion wp-seo.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* @wordpress-plugin
* Plugin Name: Yoast SEO
* Version: 18.2-RC3
* Version: 18.2-RC4
* Plugin URI: https://yoa.st/1uj
* Description: The first true all-in-one SEO solution for WordPress, including on-page content analysis, XML sitemaps and much more.
* Author: Team Yoast
Expand Down

0 comments on commit c801101

Please sign in to comment.