| 1 |
<?php |
| 2 |
/** |
| 3 |
* Recipe block schema template. |
| 4 |
* |
| 5 |
* @package Yoast\WP\SEO\Schema_Templates |
| 6 |
*/ |
| 7 |
|
| 8 |
/* translators: %1$s expands to Yoast */ |
| 9 |
$yoast_seo_block_title = sprintf( __( '%1$s Recipe', 'wordpress-seo' ), 'Yoast' ); |
| 10 |
|
| 11 |
$yoast_seo_block_template = [ |
| 12 |
[ 'yoast/recipe-name' ], |
| 13 |
[ 'yoast/cooking-time' ], |
| 14 |
[ 'yoast/preparation-time' ], |
| 15 |
[ 'core/image' ], |
| 16 |
[ 'yoast/recipe-description' ], |
| 17 |
[ 'yoast/recipe-ingredients' ], |
| 18 |
[ 'yoast/recipe-instructions' ], |
| 19 |
]; |
| 20 |
|
| 21 |
$yoast_seo_required_blocks = [ |
| 22 |
[ 'name' => 'yoast/recipe-name' ], |
| 23 |
[ 'name' => 'core/image' ], |
| 24 |
[ 'name' => 'yoast/recipe-ingredients' ], |
| 25 |
[ 'name' => 'yoast/recipe-instructions' ], |
| 26 |
]; |
| 27 |
|
| 28 |
$yoast_seo_recommended_blocks = [ |
| 29 |
[ 'name' => 'yoast/cooking-time' ], |
| 30 |
[ 'name' => 'yoast/preparation-time' ], |
| 31 |
[ 'name' => 'yoast/recipe-description' ], |
| 32 |
]; |
| 33 |
|
| 34 |
// phpcs:disable WordPress.Security.EscapeOutput -- Reason: WPSEO_Utils::format_json_encode is safe. |
| 35 |
?> |
| 36 |
{{block name="yoast/recipe" title="<?php echo esc_attr( $yoast_seo_block_title ); ?>" category="yoast-structured-data-blocks" keywords=[ "SEO", "Schema"] description="<?php esc_attr_e( 'Create a Recipe in an SEO-friendly way. You can only use one Recipe block per post.', 'wordpress-seo' ); ?>" supports={"multiple": false} }} |
| 37 |
{{sidebar-input name="yield" output=false type="number" label="<?php esc_attr_e( 'Serves #', 'wordpress-seo' ); ?>" }} |
| 38 |
<div class={{class-name}}> |
| 39 |
{{inner-blocks template=<?php echo WPSEO_Utils::format_json_encode( $yoast_seo_block_template ); ?> required-blocks=<?php echo WPSEO_Utils::format_json_encode( $yoast_seo_required_blocks ); ?> recommended-blocks=<?php echo WPSEO_Utils::format_json_encode( $yoast_seo_recommended_blocks ); ?> appender="button" appenderLabel="<?php esc_attr_e( 'Add a block to your recipe...', 'wordpress-seo' ); ?>" }} |
| 40 |
</div> |
| 41 |
|