Skip to content

Commit

Permalink
Merge release/8.3 into trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
IreneStr committed Sep 17, 2018
2 parents 38e0c0f + dbbd0ec commit ff362d6
Show file tree
Hide file tree
Showing 100 changed files with 20,218 additions and 21,565 deletions.
13 changes: 13 additions & 0 deletions admin/class-admin-asset-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,20 @@ protected function scripts_to_be_registered() {
wp_deregister_script( 'tinymce-latest' );
wp_register_script( 'tinymce-latest', includes_url( 'js/tinymce/' ) . 'wp-tinymce.php', array( 'jquery' ), false, true );
}

// Use Gutenberg's babel-polyfill.
$babel_polyfill = 'wp-polyfill-ecmascript';
}
else {
// If Gutenberg's babel-polyfill is not registered, use our own.
if ( ! wp_script_is( 'wp-polyfill-ecmascript', 'registered' ) ) {
$this->register_script( new WPSEO_Admin_Asset( array(
'name' => 'babel-polyfill',
'src' => 'babel-polyfill-' . $flat_version,
) ) );
}
$babel_polyfill = self::PREFIX . 'babel-polyfill';

if ( wp_script_is( 'lodash', 'registered' ) ) {
$backport_wp_dependencies[] = 'lodash';
}
Expand All @@ -229,6 +241,7 @@ protected function scripts_to_be_registered() {
'name' => 'react-dependencies',
// Load webpack-commons for bundle support.
'src' => 'commons-' . $flat_version,
'deps' => array( $babel_polyfill ),
),
array(
'name' => 'search-appearance',
Expand Down
1 change: 1 addition & 0 deletions admin/config-ui/fields/class-field-separator.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public function __construct() {
$this->add_choice( 'sc-dash', '-', __( 'Dash', 'wordpress-seo' ) );
$this->add_choice( 'sc-ndash', '–', __( 'En dash', 'wordpress-seo' ) );
$this->add_choice( 'sc-mdash', '—', __( 'Em dash', 'wordpress-seo' ) );
$this->add_choice( 'sc-colon', ':', __( 'Colon', 'wordpress-seo' ) );
$this->add_choice( 'sc-middot', '·', __( 'Middle dot', 'wordpress-seo' ) );
$this->add_choice( 'sc-bull', '•', __( 'Bullet', 'wordpress-seo' ) );
$this->add_choice( 'sc-star', '*', __( 'Asterisk', 'wordpress-seo' ) );
Expand Down
9 changes: 8 additions & 1 deletion css/dist/structured-data-blocks-83-RC1-rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,18 @@ legend.schema-how-to-duration-legend {
}

.schema-how-to-step-name,
.schema-faq-title,
.schema-faq-question {
font-weight: 600;
}

.schema-how-to-description,
.schema-how-to-step-name,
.schema-how-to-step-text,
.schema-faq-question,
.schema-faq-answer {
line-height: inherit;
}

.schema-how-to-step-button-container {
text-align: left;
}
Expand Down
2 changes: 1 addition & 1 deletion css/dist/structured-data-blocks-83-RC1-rtl.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion css/dist/structured-data-blocks-83-RC1.css
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,18 @@ legend.schema-how-to-duration-legend {
}

.schema-how-to-step-name,
.schema-faq-title,
.schema-faq-question {
font-weight: 600;
}

.schema-how-to-description,
.schema-how-to-step-name,
.schema-how-to-step-text,
.schema-faq-question,
.schema-faq-answer {
line-height: inherit;
}

.schema-how-to-step-button-container {
text-align: right;
}
Expand Down
2 changes: 1 addition & 1 deletion css/dist/structured-data-blocks-83-RC1.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion css/src/structured-data-blocks.scss
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,20 @@ legend.schema-how-to-duration-legend {
text-align: right;
}

// TinyMCE fields and placeholders
.schema-how-to-step-name,
.schema-faq-title,
.schema-faq-question {
font-weight: 600;
}

.schema-how-to-description,
.schema-how-to-step-name,
.schema-how-to-step-text,
.schema-faq-question,
.schema-faq-answer {
line-height: inherit;
}

.schema-how-to-step-button-container {
text-align: right;

Expand Down
1 change: 1 addition & 0 deletions frontend/class-opengraph.php
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,7 @@ public function description( $echo = true ) {
if ( $ogdesc === '' ) {
$ogdesc = WPSEO_Taxonomy_Meta::get_meta_without_term( 'desc' );
}
$ogdesc = wpseo_replace_vars( $ogdesc, get_queried_object() );
}

// Strip shortcodes if any.
Expand Down
4 changes: 2 additions & 2 deletions inc/structured-data-blocks/class-faq-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function register_hooks() {
* @return string The block preceded by it's JSON LD script.
*/
public function render( $attributes, $content ) {
if ( ! is_array( $attributes ) ) {
if ( ! is_array( $attributes ) || ! is_singular() ) {
return $content;
}

Expand All @@ -53,7 +53,7 @@ public function render( $attributes, $content ) {
*/
protected function get_json_ld( array $attributes ) {
$json_ld = array(
'@context' => 'http://schema.org',
'@context' => 'https://schema.org',
'@graph' => array( $this->get_faq_json_ld() ),
);

Expand Down
57 changes: 27 additions & 30 deletions inc/structured-data-blocks/class-how-to-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function register_hooks() {
* @return string The block preceded by its JSON-LD script.
*/
public function render( $attributes, $content ) {
if ( ! is_array( $attributes ) ) {
if ( ! is_array( $attributes ) || ! is_singular() ) {
return $content;
}

Expand All @@ -53,7 +53,7 @@ public function render( $attributes, $content ) {
*/
protected function get_json_ld( array $attributes ) {
$json_ld = array(
'@context' => 'http://schema.org',
'@context' => 'https://schema.org',
'@type' => 'HowTo',
);

Expand All @@ -79,60 +79,57 @@ protected function get_json_ld( array $attributes ) {
if ( ! empty( $attributes['steps'] ) && is_array( $attributes['steps'] ) ) {
$json_ld['step'] = array();
$steps = array_filter( $attributes['steps'], 'is_array' );
foreach ( $steps as $index => $step ) {
$json_ld['step'][] = $this->get_section_json_ld( $step, $index );
foreach ( $steps as $step ) {
$json_ld['step'][] = $this->get_section_json_ld( $step );
}
}

return $json_ld;
}

/**
* Returns the JSON-LD for a step's description in a how-to block.
*
* @param array $step The attributes of a step(-section) in the how-to block.
* @param int $index The index of the section in the how-to block.
*
* @return array The JSON-LD representation of the step's description in a how-to block.
*/
protected function get_step_json_ld( array $step, $index ) {
$step_json_ld = array(
'@type' => 'HowToStep',
'position' => $index + 1,
);

if ( ! empty( $step['jsonText'] ) ) {
$step_json_ld['text'] = $step['jsonText'];
}

return $step_json_ld;
}

/**
* Returns the JSON-LD for a step-section in a how-to block.
*
* @param array $step The attributes of a step-section in the how-to block.
* @param int $index The index of the section in the how-to block.
* @param array $step The attributes of a step-section in the how-to block.
*
* @return array The JSON-LD representation of the step-section in a how-to block.
*/
protected function get_section_json_ld( array $step, $index ) {
protected function get_section_json_ld( array $step ) {
$section_json_ld = array(
'@type' => 'HowToSection',
'itemListElement' => $this->get_step_json_ld( $step, $index ),
'itemListElement' => $this->get_step_json_ld( $step ),
);

if ( ! empty( $step['jsonName'] ) ) {
$section_json_ld['name'] = $step['jsonName'];
}

if ( ! empty( $step['jsonImageSrc'] ) ) {
$section_json_ld['associatedMedia'] = array(
$section_json_ld['image'] = array(
'@type' => 'ImageObject',
'contentUrl' => $step['jsonImageSrc'],
);
}

return $section_json_ld;
}

/**
* Returns the JSON-LD for a step's description in a how-to block.
*
* @param array $step The attributes of a step(-section) in the how-to block.
*
* @return array The JSON-LD representation of the step's description in a how-to block.
*/
protected function get_step_json_ld( array $step ) {
$step_json_ld = array(
'@type' => 'HowToStep',
);

if ( ! empty( $step['jsonText'] ) ) {
$step_json_ld['text'] = $step['jsonText'];
}

return $step_json_ld;
}
}
5,389 changes: 2,557 additions & 2,832 deletions js/dist/analysis-83-RC1.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/dist/analysis-83-RC1.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit ff362d6

Please sign in to comment.