Version Description
- Feature: Author schema integration with Yoast SEO
- Improvement: FlyingPress compatibility for comment ratings
- Fix: Sanitizing shortcode input correctly
- Fix: Deprecation warning because of add_submenu_page
Download this release
Release Info
Developer | BrechtVds |
Plugin | WP Recipe Maker |
Version | 8.6.1 |
Comparing to | |
See all releases |
Code changes from version 8.6.0 to 8.6.1
- includes/admin/class-wprm-import-manager.php +3 -3
- includes/admin/tools/class-wprm-tools-anonymize-ratings.php +1 -1
- includes/admin/tools/class-wprm-tools-create-reviews.php +1 -1
- includes/admin/tools/class-wprm-tools-find-ingredient-units.php +1 -1
- includes/admin/tools/class-wprm-tools-find-parents.php +1 -1
- includes/admin/tools/class-wprm-tools-find-ratings.php +1 -1
- includes/admin/tools/class-wprm-tools-fix-comment-ratings.php +1 -1
- includes/admin/tools/class-wprm-tools-health-check.php +1 -1
- includes/admin/tools/class-wprm-tools-refresh-video-metadata.php +1 -1
- includes/admin/tools/class-wprm-tools-wpurp-ingredients.php +1 -1
- includes/admin/tools/class-wprm-tools-wpurp-nutrition.php +1 -1
- includes/class-wp-recipe-maker.php +1 -1
- includes/public/class-wprm-comment-rating.php +6 -0
- includes/public/class-wprm-metadata-yoast-seo.php +17 -0
- includes/public/class-wprm-recipe-roundup.php +2 -2
- includes/public/class-wprm-shortcode-other.php +1 -1
- includes/public/class-wprm-shortcode-snippets.php +1 -1
- includes/public/class-wprm-shortcode.php +3 -3
- includes/public/class-wprm-template-editor.php +1 -1
- includes/public/shortcodes/class-wprm-shortcode-helper.php +9 -9
- includes/public/shortcodes/general/class-wprm-sc-general-image.php +8 -8
- includes/public/shortcodes/general/class-wprm-sc-icon.php +8 -8
- includes/public/shortcodes/general/class-wprm-sc-jump-to-comments.php +2 -2
- includes/public/shortcodes/general/class-wprm-sc-link.php +3 -3
- includes/public/shortcodes/general/class-wprm-sc-spacer.php +2 -2
- includes/public/shortcodes/general/class-wprm-sc-text.php +2 -2
- includes/public/shortcodes/recipe/class-wprm-sc-author.php +3 -3
- includes/public/shortcodes/recipe/class-wprm-sc-cost.php +1 -1
- includes/public/shortcodes/recipe/class-wprm-sc-counter.php +3 -3
- includes/public/shortcodes/recipe/class-wprm-sc-date.php +2 -2
- includes/public/shortcodes/recipe/class-wprm-sc-email-share.php +1 -1
- includes/public/shortcodes/recipe/class-wprm-sc-equipment.php +3 -3
- includes/public/shortcodes/recipe/class-wprm-sc-facebook-share.php +1 -1
- includes/public/shortcodes/recipe/class-wprm-sc-grow.php +2 -2
- includes/public/shortcodes/recipe/class-wprm-sc-image.php +3 -3
- includes/public/shortcodes/recipe/class-wprm-sc-ingredients.php +6 -6
- includes/public/shortcodes/recipe/class-wprm-sc-instructions.php +12 -12
- includes/public/shortcodes/recipe/class-wprm-sc-jump-video.php +1 -1
- includes/public/shortcodes/recipe/class-wprm-sc-jump.php +1 -1
- includes/public/shortcodes/recipe/class-wprm-sc-media-toggle.php +3 -3
- includes/public/shortcodes/recipe/class-wprm-sc-meta-container.php +1 -1
- includes/public/shortcodes/recipe/class-wprm-sc-my-emissions.php +1 -1
- includes/public/shortcodes/recipe/class-wprm-sc-name.php +2 -2
- includes/public/shortcodes/recipe/class-wprm-sc-notes.php +1 -1
- includes/public/shortcodes/recipe/class-wprm-sc-nutrition.php +2 -2
- includes/public/shortcodes/recipe/class-wprm-sc-pin.php +3 -3
- includes/public/shortcodes/recipe/class-wprm-sc-print.php +1 -1
- includes/public/shortcodes/recipe/class-wprm-sc-rating.php +7 -7
- includes/public/shortcodes/recipe/class-wprm-sc-roundup-link.php +1 -1
- includes/public/shortcodes/recipe/class-wprm-sc-servings-unit.php +1 -1
- includes/public/shortcodes/recipe/class-wprm-sc-servings.php +1 -1
- includes/public/shortcodes/recipe/class-wprm-sc-slickstream.php +2 -2
- includes/public/shortcodes/recipe/class-wprm-sc-summary.php +1 -1
- includes/public/shortcodes/recipe/class-wprm-sc-tag.php +1 -1
- includes/public/shortcodes/recipe/class-wprm-sc-text-share.php +1 -1
- includes/public/shortcodes/recipe/class-wprm-sc-time.php +1 -1
- includes/public/shortcodes/recipe/class-wprm-sc-twitter-share.php +1 -1
- includes/public/shortcodes/recipe/class-wprm-sc-url.php +3 -3
- includes/public/shortcodes/recipe/class-wprm-sc-video.php +1 -1
- news.json +18 -0
- readme.txt +9 -0
- templates/public/print.php +4 -1
- wp-recipe-maker.php +1 -1
includes/admin/class-wprm-import-manager.php
CHANGED
@@ -57,9 +57,9 @@ class WPRM_Import_Manager {
|
|
57 |
*/
|
58 |
public static function add_submenu_page() {
|
59 |
add_submenu_page( 'wprecipemaker', __( 'Import Recipes', 'wp-recipe-maker' ), __( 'Import Recipes', 'wp-recipe-maker' ), WPRM_Settings::get( 'features_import_access' ), 'wprm_import_overview', array( __CLASS__, 'overview_page_template' ) );
|
60 |
-
add_submenu_page(
|
61 |
-
add_submenu_page(
|
62 |
-
add_submenu_page(
|
63 |
}
|
64 |
|
65 |
/**
|
57 |
*/
|
58 |
public static function add_submenu_page() {
|
59 |
add_submenu_page( 'wprecipemaker', __( 'Import Recipes', 'wp-recipe-maker' ), __( 'Import Recipes', 'wp-recipe-maker' ), WPRM_Settings::get( 'features_import_access' ), 'wprm_import_overview', array( __CLASS__, 'overview_page_template' ) );
|
60 |
+
add_submenu_page( '', __( 'Import Recipes', 'wp-recipe-maker' ), __( 'Import Recipes', 'wp-recipe-maker' ), WPRM_Settings::get( 'features_import_access' ), 'wprm_import', array( __CLASS__, 'import_page_template' ) );
|
61 |
+
add_submenu_page( '', __( 'Search Recipes', 'wp-recipe-maker' ), __( 'Search Recipes', 'wp-recipe-maker' ), WPRM_Settings::get( 'features_import_access' ), 'wprm_import_search', array( __CLASS__, 'import_search_page_template' ) );
|
62 |
+
add_submenu_page( '', __( 'Importing Recipes', 'wp-recipe-maker' ), __( 'Importing Recipes', 'wp-recipe-maker' ), WPRM_Settings::get( 'features_import_access' ), 'wprm_importing', array( __CLASS__, 'importing_recipes' ) );
|
63 |
}
|
64 |
|
65 |
/**
|
includes/admin/tools/class-wprm-tools-anonymize-ratings.php
CHANGED
@@ -35,7 +35,7 @@ class WPRM_Tools_Anonymize_Ratings {
|
|
35 |
* @since 8.4.0
|
36 |
*/
|
37 |
public static function add_submenu_page() {
|
38 |
-
add_submenu_page(
|
39 |
}
|
40 |
|
41 |
/**
|
35 |
* @since 8.4.0
|
36 |
*/
|
37 |
public static function add_submenu_page() {
|
38 |
+
add_submenu_page( '', __( 'Anonymize Ratings', 'wp-recipe-maker' ), __( 'Anonymize Ratings', 'wp-recipe-maker' ), WPRM_Settings::get( 'features_tools_access' ), 'wprm_anonymize_ratings', array( __CLASS__, 'anonymize_ratings_template' ) );
|
39 |
}
|
40 |
|
41 |
/**
|
includes/admin/tools/class-wprm-tools-create-reviews.php
CHANGED
@@ -35,7 +35,7 @@ class WPRM_Tools_Create_Reviews {
|
|
35 |
* @since 7.5.0
|
36 |
*/
|
37 |
public static function add_submenu_page() {
|
38 |
-
add_submenu_page(
|
39 |
}
|
40 |
|
41 |
/**
|
35 |
* @since 7.5.0
|
36 |
*/
|
37 |
public static function add_submenu_page() {
|
38 |
+
add_submenu_page( '', __( 'Importing Reviews', 'wp-recipe-maker' ), __( 'Importing Reviews', 'wp-recipe-maker' ), WPRM_Settings::get( 'features_tools_access' ), 'wprm_create_reviews', array( __CLASS__, 'create_reviews' ) );
|
39 |
}
|
40 |
|
41 |
/**
|
includes/admin/tools/class-wprm-tools-find-ingredient-units.php
CHANGED
@@ -35,7 +35,7 @@ class WPRM_Tools_Find_Ingredient_Units {
|
|
35 |
* @since 7.6.0
|
36 |
*/
|
37 |
public static function add_submenu_page() {
|
38 |
-
add_submenu_page(
|
39 |
}
|
40 |
|
41 |
/**
|
35 |
* @since 7.6.0
|
36 |
*/
|
37 |
public static function add_submenu_page() {
|
38 |
+
add_submenu_page( '', __( 'Find Ingredient Units', 'wp-recipe-maker' ), __( 'Find Ingredient Units', 'wp-recipe-maker' ), WPRM_Settings::get( 'features_tools_access' ), 'wprm_find_ingredient_units', array( __CLASS__, 'find_ingredient_units' ) );
|
39 |
}
|
40 |
|
41 |
/**
|
includes/admin/tools/class-wprm-tools-find-parents.php
CHANGED
@@ -35,7 +35,7 @@ class WPRM_Tools_Find_Parents {
|
|
35 |
* @since 5.6.0
|
36 |
*/
|
37 |
public static function add_submenu_page() {
|
38 |
-
add_submenu_page(
|
39 |
}
|
40 |
|
41 |
/**
|
35 |
* @since 5.6.0
|
36 |
*/
|
37 |
public static function add_submenu_page() {
|
38 |
+
add_submenu_page( '', __( 'Finding Parents', 'wp-recipe-maker' ), __( 'Finding Parents', 'wp-recipe-maker' ), WPRM_Settings::get( 'features_tools_access' ), 'wprm_finding_parents', array( __CLASS__, 'finding_parents' ) );
|
39 |
}
|
40 |
|
41 |
/**
|
includes/admin/tools/class-wprm-tools-find-ratings.php
CHANGED
@@ -35,7 +35,7 @@ class WPRM_Tools_Find_Ratings {
|
|
35 |
* @since 5.6.0
|
36 |
*/
|
37 |
public static function add_submenu_page() {
|
38 |
-
add_submenu_page(
|
39 |
}
|
40 |
|
41 |
/**
|
35 |
* @since 5.6.0
|
36 |
*/
|
37 |
public static function add_submenu_page() {
|
38 |
+
add_submenu_page( '', __( 'Finding Ratings', 'wp-recipe-maker' ), __( 'Finding Ratings', 'wp-recipe-maker' ), WPRM_Settings::get( 'features_tools_access' ), 'wprm_finding_ratings', array( __CLASS__, 'finding_ratings' ) );
|
39 |
}
|
40 |
|
41 |
/**
|
includes/admin/tools/class-wprm-tools-fix-comment-ratings.php
CHANGED
@@ -35,7 +35,7 @@ class WPRM_Tools_Fix_Comment_Ratings {
|
|
35 |
* @since 5.9.0
|
36 |
*/
|
37 |
public static function add_submenu_page() {
|
38 |
-
add_submenu_page(
|
39 |
}
|
40 |
|
41 |
/**
|
35 |
* @since 5.9.0
|
36 |
*/
|
37 |
public static function add_submenu_page() {
|
38 |
+
add_submenu_page( '', __( 'Fix Comment Ratings', 'wp-recipe-maker' ), __( 'Fix Comment Ratings', 'wp-recipe-maker' ), WPRM_Settings::get( 'features_tools_access' ), 'wprm_fixing_comment_ratings', array( __CLASS__, 'fixing_comment_ratings' ) );
|
39 |
}
|
40 |
|
41 |
/**
|
includes/admin/tools/class-wprm-tools-health-check.php
CHANGED
@@ -35,7 +35,7 @@ class WPRM_Tools_Health_Check {
|
|
35 |
* @since 8.0.0
|
36 |
*/
|
37 |
public static function add_submenu_page() {
|
38 |
-
add_submenu_page(
|
39 |
}
|
40 |
|
41 |
/**
|
35 |
* @since 8.0.0
|
36 |
*/
|
37 |
public static function add_submenu_page() {
|
38 |
+
add_submenu_page( '', __( 'Health Check', 'wp-recipe-maker' ), __( 'Health Check', 'wp-recipe-maker' ), WPRM_Settings::get( 'features_tools_access' ), 'wprm_health_check', array( __CLASS__, 'health_check' ) );
|
39 |
}
|
40 |
|
41 |
/**
|
includes/admin/tools/class-wprm-tools-refresh-video-metadata.php
CHANGED
@@ -35,7 +35,7 @@ class WPRM_Tools_Refresh_Video_Metadata {
|
|
35 |
* @since 6.0.0
|
36 |
*/
|
37 |
public static function add_submenu_page() {
|
38 |
-
add_submenu_page(
|
39 |
}
|
40 |
|
41 |
/**
|
35 |
* @since 6.0.0
|
36 |
*/
|
37 |
public static function add_submenu_page() {
|
38 |
+
add_submenu_page( '', __( 'Refresh Video Metadata', 'wp-recipe-maker' ), __( 'Refresh Video Metadata', 'wp-recipe-maker' ), WPRM_Settings::get( 'features_tools_access' ), 'wprm_refresh_video_metadata', array( __CLASS__, 'refresh_video_metadata' ) );
|
39 |
}
|
40 |
|
41 |
/**
|
includes/admin/tools/class-wprm-tools-wpurp-ingredients.php
CHANGED
@@ -35,7 +35,7 @@ class WPRM_Tools_WPURP_Ingredients {
|
|
35 |
* @since 5.6.0
|
36 |
*/
|
37 |
public static function add_submenu_page() {
|
38 |
-
add_submenu_page(
|
39 |
}
|
40 |
|
41 |
/**
|
35 |
* @since 5.6.0
|
36 |
*/
|
37 |
public static function add_submenu_page() {
|
38 |
+
add_submenu_page( '', __( 'Importing Ingredients', 'wp-recipe-maker' ), __( 'Importing Ingredients', 'wp-recipe-maker' ), WPRM_Settings::get( 'features_tools_access' ), 'wprm_wpurp_ingredients', array( __CLASS__, 'wpurp_ingredients' ) );
|
39 |
}
|
40 |
|
41 |
/**
|
includes/admin/tools/class-wprm-tools-wpurp-nutrition.php
CHANGED
@@ -35,7 +35,7 @@ class WPRM_Tools_WPURP_Nutrition {
|
|
35 |
* @since 5.6.0
|
36 |
*/
|
37 |
public static function add_submenu_page() {
|
38 |
-
add_submenu_page(
|
39 |
}
|
40 |
|
41 |
/**
|
35 |
* @since 5.6.0
|
36 |
*/
|
37 |
public static function add_submenu_page() {
|
38 |
+
add_submenu_page( '', __( 'Importing Nutrition', 'wp-recipe-maker' ), __( 'Importing Nutrition', 'wp-recipe-maker' ), WPRM_Settings::get( 'features_tools_access' ), 'wprm_wpurp_nutrition', array( __CLASS__, 'wpurp_nutrition' ) );
|
39 |
}
|
40 |
|
41 |
/**
|
includes/class-wp-recipe-maker.php
CHANGED
@@ -31,7 +31,7 @@ class WP_Recipe_Maker {
|
|
31 |
* @since 1.0.0
|
32 |
*/
|
33 |
private function define_constants() {
|
34 |
-
define( 'WPRM_VERSION', '8.6.
|
35 |
define( 'WPRM_PREMIUM_VERSION_REQUIRED', '7.0.0' );
|
36 |
define( 'WPRM_POST_TYPE', 'wprm_recipe' );
|
37 |
define( 'WPRM_DIR', plugin_dir_path( dirname( __FILE__ ) ) );
|
31 |
* @since 1.0.0
|
32 |
*/
|
33 |
private function define_constants() {
|
34 |
+
define( 'WPRM_VERSION', '8.6.1' );
|
35 |
define( 'WPRM_PREMIUM_VERSION_REQUIRED', '7.0.0' );
|
36 |
define( 'WPRM_POST_TYPE', 'wprm_recipe' );
|
37 |
define( 'WPRM_DIR', plugin_dir_path( dirname( __FILE__ ) ) );
|
includes/public/class-wprm-comment-rating.php
CHANGED
@@ -197,6 +197,12 @@ class WPRM_Comment_Rating {
|
|
197 |
|
198 |
if ( $comment ) {
|
199 |
update_comment_meta( $comment_id, 'wprm-comment-rating', $comment_rating );
|
|
|
|
|
|
|
|
|
|
|
|
|
200 |
}
|
201 |
}
|
202 |
}
|
197 |
|
198 |
if ( $comment ) {
|
199 |
update_comment_meta( $comment_id, 'wprm-comment-rating', $comment_rating );
|
200 |
+
|
201 |
+
// FlyingPress compatibility.
|
202 |
+
if ( class_exists( 'FlyingPress\Purge' ) ) {
|
203 |
+
$post_link = get_permalink( $comment->comment_post_ID );
|
204 |
+
FlyingPress\Purge::purge_by_urls( array( $post_link ) );
|
205 |
+
}
|
206 |
}
|
207 |
}
|
208 |
}
|
includes/public/class-wprm-metadata-yoast-seo.php
CHANGED
@@ -101,13 +101,30 @@ class WPRM_Metadata_Yoast_Seo implements WPSEO_Graph_Piece {
|
|
101 |
|
102 |
if ( $metadata ) {
|
103 |
WPRM_Metadata::outputted_metadata_for( $this->recipe->id() );
|
|
|
|
|
|
|
|
|
104 |
$metadata['@id'] = $this->context->canonical . '#recipe';
|
105 |
|
|
|
106 |
$parent = $this->using_article ? $this->context->canonical . WPSEO_Schema_IDs::ARTICLE_HASH : $this->context->canonical . WPSEO_Schema_IDs::WEBPAGE_HASH;
|
107 |
|
108 |
$metadata['isPartOf'] = array( '@id' => $parent );
|
109 |
$metadata['mainEntityOfPage'] = $this->context->canonical . WPSEO_Schema_IDs::WEBPAGE_HASH;
|
110 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
return $metadata;
|
112 |
}
|
113 |
|
101 |
|
102 |
if ( $metadata ) {
|
103 |
WPRM_Metadata::outputted_metadata_for( $this->recipe->id() );
|
104 |
+
// Context is already set by Yoast.
|
105 |
+
unset( $metadata['@context'] );
|
106 |
+
|
107 |
+
// Give an ID to the recipe part.
|
108 |
$metadata['@id'] = $this->context->canonical . '#recipe';
|
109 |
|
110 |
+
// Recipe isPartOf an article of webpage, with the recipe the mainEntityOfPage.
|
111 |
$parent = $this->using_article ? $this->context->canonical . WPSEO_Schema_IDs::ARTICLE_HASH : $this->context->canonical . WPSEO_Schema_IDs::WEBPAGE_HASH;
|
112 |
|
113 |
$metadata['isPartOf'] = array( '@id' => $parent );
|
114 |
$metadata['mainEntityOfPage'] = $this->context->canonical . WPSEO_Schema_IDs::WEBPAGE_HASH;
|
115 |
|
116 |
+
// Unless author is custom (and actually set), use the author that Yoast already defines.
|
117 |
+
if ( 'custom' !== $this->recipe->author_display() || '' === $this->recipe->custom_author_name() ) {
|
118 |
+
// Only if Yoast's author is the same as the recipe author.
|
119 |
+
if ( $this->context->post->post_author === $this->recipe->post_author() ) {
|
120 |
+
$user_schema_id = YoastSEO()->helpers->schema->id->get_user_schema_id( $this->recipe->post_author(), $this->context );
|
121 |
+
|
122 |
+
if ( $user_schema_id ) {
|
123 |
+
$metadata['author'] = array( '@id' => $user_schema_id );
|
124 |
+
}
|
125 |
+
}
|
126 |
+
}
|
127 |
+
|
128 |
return $metadata;
|
129 |
}
|
130 |
|
includes/public/class-wprm-recipe-roundup.php
CHANGED
@@ -288,10 +288,10 @@ class WPRM_Recipe_Roundup {
|
|
288 |
|
289 |
$align_class = '';
|
290 |
if ( isset( $atts['align'] ) && $atts['align'] ) {
|
291 |
-
$align_class = ' align' . $atts['align'];
|
292 |
}
|
293 |
|
294 |
-
$output = '<div class="wprm-recipe wprm-recipe-roundup-item wprm-recipe-roundup-item-' . $recipe->id() . ' wprm-recipe-template-' . $template['slug'] . $align_class . '" data-servings="' . esc_attr( $recipe->servings() ). '">';
|
295 |
|
296 |
// Add filters for overrides and immediately remove after doing shortcode.
|
297 |
add_filter( 'wprm_recipe_roundup_link_text', array( __CLASS__, 'roundup_link_text_override' ) );
|
288 |
|
289 |
$align_class = '';
|
290 |
if ( isset( $atts['align'] ) && $atts['align'] ) {
|
291 |
+
$align_class = ' align' . esc_attr( $atts['align'] );
|
292 |
}
|
293 |
|
294 |
+
$output = '<div class="wprm-recipe wprm-recipe-roundup-item wprm-recipe-roundup-item-' . esc_attr( $recipe->id() ) . ' wprm-recipe-template-' . esc_attr( $template['slug'] ) . esc_attr( $align_class ) . '" data-servings="' . esc_attr( $recipe->servings() ). '">';
|
295 |
|
296 |
// Add filters for overrides and immediately remove after doing shortcode.
|
297 |
add_filter( 'wprm_recipe_roundup_link_text', array( __CLASS__, 'roundup_link_text_override' ) );
|
includes/public/class-wprm-shortcode-other.php
CHANGED
@@ -114,7 +114,7 @@ class WPRM_Shortcode_Other {
|
|
114 |
|
115 |
// Value output
|
116 |
$output .= '<span class="wprm-temperature-value">';
|
117 |
-
$output .= $value;
|
118 |
$output .= '</span>';
|
119 |
|
120 |
// Unit output
|
114 |
|
115 |
// Value output
|
116 |
$output .= '<span class="wprm-temperature-value">';
|
117 |
+
$output .= esc_html( $value );
|
118 |
$output .= '</span>';
|
119 |
|
120 |
// Unit output
|
includes/public/class-wprm-shortcode-snippets.php
CHANGED
@@ -75,7 +75,7 @@ class WPRM_Shortcode_Snippets {
|
|
75 |
// Add to used templates.
|
76 |
WPRM_Template_Manager::add_used_template( $template );
|
77 |
|
78 |
-
$output = '<div class="wprm-recipe wprm-recipe-snippet wprm-recipe-template-' . $template['slug'] . '">' . do_shortcode( $template['html'] ) . '</div>';
|
79 |
return apply_filters( 'wprm_recipe_snippet_shortcode_output', $output, $atts, $recipe_id, $template );
|
80 |
}
|
81 |
}
|
75 |
// Add to used templates.
|
76 |
WPRM_Template_Manager::add_used_template( $template );
|
77 |
|
78 |
+
$output = '<div class="wprm-recipe wprm-recipe-snippet wprm-recipe-template-' . esc_attr( $template['slug'] ) . '">' . do_shortcode( $template['html'] ) . '</div>';
|
79 |
return apply_filters( 'wprm_recipe_snippet_shortcode_output', $output, $atts, $recipe_id, $template );
|
80 |
}
|
81 |
}
|
includes/public/class-wprm-shortcode.php
CHANGED
@@ -384,13 +384,13 @@ class WPRM_Shortcode {
|
|
384 |
// Output full snippet or recipe template.
|
385 |
$align_class = '';
|
386 |
if ( isset( $atts['align'] ) && $atts['align'] ) {
|
387 |
-
$align_class = ' align' . $atts['align'];
|
388 |
}
|
389 |
|
390 |
if ( $recipe_template && 'snippet-' === substr( $recipe_template, 0, 8 ) ) {
|
391 |
-
$output = '<div id="wprm-recipe-snippet-container-' . esc_attr( $recipe->id() ) . '" class="wprm-recipe-snippet-container' . $align_class . '" data-recipe-id="' . esc_attr( $recipe->id() ) . '">';
|
392 |
} else {
|
393 |
-
$output = '<div id="wprm-recipe-container-' . esc_attr( $recipe->id() ) . '" class="wprm-recipe-container' . $align_class . '" data-recipe-id="' . esc_attr( $recipe->id() ) . '" data-servings="' . esc_attr( $recipe->servings() ) . '">';
|
394 |
}
|
395 |
|
396 |
if ( 'amp' === $type || 'single' === $type ) {
|
384 |
// Output full snippet or recipe template.
|
385 |
$align_class = '';
|
386 |
if ( isset( $atts['align'] ) && $atts['align'] ) {
|
387 |
+
$align_class = ' align' . esc_attr( $atts['align'] );
|
388 |
}
|
389 |
|
390 |
if ( $recipe_template && 'snippet-' === substr( $recipe_template, 0, 8 ) ) {
|
391 |
+
$output = '<div id="wprm-recipe-snippet-container-' . esc_attr( $recipe->id() ) . '" class="wprm-recipe-snippet-container' . esc_attr( $align_class ) . '" data-recipe-id="' . esc_attr( $recipe->id() ) . '">';
|
392 |
} else {
|
393 |
+
$output = '<div id="wprm-recipe-container-' . esc_attr( $recipe->id() ) . '" class="wprm-recipe-container' . esc_attr( $align_class ) . '" data-recipe-id="' . esc_attr( $recipe->id() ) . '" data-servings="' . esc_attr( $recipe->servings() ) . '">';
|
394 |
}
|
395 |
|
396 |
if ( 'amp' === $type || 'single' === $type ) {
|
includes/public/class-wprm-template-editor.php
CHANGED
@@ -33,7 +33,7 @@ class WPRM_Template_Editor {
|
|
33 |
* @since 4.0.0
|
34 |
*/
|
35 |
public static function add_submenu_page() {
|
36 |
-
add_submenu_page(
|
37 |
}
|
38 |
|
39 |
/**
|
33 |
* @since 4.0.0
|
34 |
*/
|
35 |
public static function add_submenu_page() {
|
36 |
+
add_submenu_page( '', __( 'WPRM Template Editor', 'wp-recipe-maker' ), __( 'Template Editor', 'wp-recipe-maker' ), 'manage_options', 'wprm_template_editor', array( __CLASS__, 'template_editor_page_template' ) );
|
37 |
}
|
38 |
|
39 |
/**
|
includes/public/shortcodes/class-wprm-shortcode-helper.php
CHANGED
@@ -164,7 +164,7 @@ class WPRM_Shortcode_Helper {
|
|
164 |
$icon_classes[] = 'wprm-recipe-' . $field . '-icon';
|
165 |
}
|
166 |
|
167 |
-
$icon = '<span class="' . implode( ' ', $icon_classes ) . '">' . $icon . '</span> ';
|
168 |
}
|
169 |
}
|
170 |
|
@@ -179,7 +179,7 @@ class WPRM_Shortcode_Helper {
|
|
179 |
$label_classes[] = 'wprm-recipe-' . $field . '-label';
|
180 |
}
|
181 |
|
182 |
-
$label = '<span class="' . implode( ' ', $label_classes ) . '">' . __( $atts['label'], 'wp-recipe-maker' ) . $atts['label_separator'] . '</span>';
|
183 |
}
|
184 |
|
185 |
// Inline style.
|
@@ -204,7 +204,7 @@ class WPRM_Shortcode_Helper {
|
|
204 |
$classes[] = 'wprm-recipe-' . $field . '-container';
|
205 |
}
|
206 |
|
207 |
-
$container = '<div class="' . implode( ' ', $classes ) . '" style="' . $style . '">';
|
208 |
$container .= $icon;
|
209 |
$container .= $label;
|
210 |
$container .= $content;
|
@@ -361,10 +361,10 @@ class WPRM_Shortcode_Helper {
|
|
361 |
$after_header = '';
|
362 |
if ( 'line' === $atts['header_decoration'] ) {
|
363 |
if ( 'left' === $atts['header_align'] || 'center' === $atts['header_align'] ) {
|
364 |
-
$after_header = '<div class="wprm-decoration-line" style="border-color: ' . $atts['header_line_color'] . '"></div>';
|
365 |
}
|
366 |
if ( 'right' === $atts['header_align'] || 'center' === $atts['header_align'] ) {
|
367 |
-
$before_header = '<div class="wprm-decoration-line" style="border-color: ' . $atts['header_line_color'] . '"></div>';
|
368 |
}
|
369 |
} elseif ( 'icon' === $atts['header_decoration'] ) {
|
370 |
$icon = '';
|
@@ -407,8 +407,8 @@ class WPRM_Shortcode_Helper {
|
|
407 |
}
|
408 |
}
|
409 |
|
410 |
-
$tag =
|
411 |
-
$header .= '<' . $tag . ' class="' . implode( ' ', $classes ) . '" style="' . $style . '">' . $before_header . $header_text . $after_header . '</' . $tag . '>';
|
412 |
}
|
413 |
|
414 |
return $header;
|
@@ -454,10 +454,10 @@ class WPRM_Shortcode_Helper {
|
|
454 |
);
|
455 |
|
456 |
if ( '#333333' !== $atts['switch_active'] ) {
|
457 |
-
$output .= '<style type="text/css">#wprm-toggle-switch-' . $uid . ' input:checked + .wprm-toggle-switch-slider { background-color: ' . $atts['switch_active'] . ' !important; }</style>';
|
458 |
}
|
459 |
|
460 |
-
$output .= '<label id="wprm-toggle-switch-' . $uid . '" class="' . esc_attr( implode( ' ', $classes ) ) . '" aria-label="' . __( 'Toggle switch', 'wp-recipe-maker' ) . '" style="' . esc_attr( $switch_style ) . '">';
|
461 |
$output .= '<input type="checkbox" id="' . esc_attr( $args['class'] . '-' . $uid ) . '" class="' . esc_attr( $args['class'] ) . '" />';
|
462 |
$output .= '<span class="wprm-toggle-switch-slider" style="' . esc_attr( $slider_style ) . '"></span>';
|
463 |
$output .= '</label>';
|
164 |
$icon_classes[] = 'wprm-recipe-' . $field . '-icon';
|
165 |
}
|
166 |
|
167 |
+
$icon = '<span class="' . esc_attr( implode( ' ', $icon_classes ) ) . '">' . $icon . '</span> ';
|
168 |
}
|
169 |
}
|
170 |
|
179 |
$label_classes[] = 'wprm-recipe-' . $field . '-label';
|
180 |
}
|
181 |
|
182 |
+
$label = '<span class="' . esc_attr( implode( ' ', $label_classes ) ) . '">' . esc_html( __( $atts['label'], 'wp-recipe-maker' ) ) . esc_html( $atts['label_separator'] ) . '</span>';
|
183 |
}
|
184 |
|
185 |
// Inline style.
|
204 |
$classes[] = 'wprm-recipe-' . $field . '-container';
|
205 |
}
|
206 |
|
207 |
+
$container = '<div class="' . esc_attr( implode( ' ', $classes ) ) . '" style="' . esc_attr( $style ) . '">';
|
208 |
$container .= $icon;
|
209 |
$container .= $label;
|
210 |
$container .= $content;
|
361 |
$after_header = '';
|
362 |
if ( 'line' === $atts['header_decoration'] ) {
|
363 |
if ( 'left' === $atts['header_align'] || 'center' === $atts['header_align'] ) {
|
364 |
+
$after_header = '<div class="wprm-decoration-line" style="border-color: ' . esc_attr( $atts['header_line_color'] ) . '"></div>';
|
365 |
}
|
366 |
if ( 'right' === $atts['header_align'] || 'center' === $atts['header_align'] ) {
|
367 |
+
$before_header = '<div class="wprm-decoration-line" style="border-color: ' . esc_attr( $atts['header_line_color'] ) . '"></div>';
|
368 |
}
|
369 |
} elseif ( 'icon' === $atts['header_decoration'] ) {
|
370 |
$icon = '';
|
407 |
}
|
408 |
}
|
409 |
|
410 |
+
$tag = sanitize_key( $atts['header_tag'] );
|
411 |
+
$header .= '<' . $tag . ' class="' . esc_attr( implode( ' ', $classes ) ) . '" style="' . esc_attr( $style ) . '">' . $before_header . esc_html( $header_text ) . $after_header . '</' . $tag . '>';
|
412 |
}
|
413 |
|
414 |
return $header;
|
454 |
);
|
455 |
|
456 |
if ( '#333333' !== $atts['switch_active'] ) {
|
457 |
+
$output .= '<style type="text/css">#wprm-toggle-switch-' . $uid . ' input:checked + .wprm-toggle-switch-slider { background-color: ' . esc_html( $atts['switch_active'] ) . ' !important; }</style>';
|
458 |
}
|
459 |
|
460 |
+
$output .= '<label id="wprm-toggle-switch-' . esc_attr( $uid ) . '" class="' . esc_attr( implode( ' ', $classes ) ) . '" aria-label="' . __( 'Toggle switch', 'wp-recipe-maker' ) . '" style="' . esc_attr( $switch_style ) . '">';
|
461 |
$output .= '<input type="checkbox" id="' . esc_attr( $args['class'] . '-' . $uid ) . '" class="' . esc_attr( $args['class'] ) . '" />';
|
462 |
$output .= '<span class="wprm-toggle-switch-slider" style="' . esc_attr( $slider_style ) . '"></span>';
|
463 |
$output .= '</label>';
|
includes/public/shortcodes/general/class-wprm-sc-general-image.php
CHANGED
@@ -105,7 +105,7 @@ class WPRM_SC_Regular_Image extends WPRM_Template_Shortcode {
|
|
105 |
// Output.
|
106 |
$classes = array(
|
107 |
'wprm-image',
|
108 |
-
'wprm-block-image-' . $atts['style'],
|
109 |
);
|
110 |
|
111 |
// Add custom class if set.
|
@@ -118,19 +118,19 @@ class WPRM_SC_Regular_Image extends WPRM_Template_Shortcode {
|
|
118 |
|
119 |
// Image Style.
|
120 |
$style = '';
|
121 |
-
$style .= 'border-width: ' . $atts['border_width'] . ';';
|
122 |
-
$style .= 'border-style: ' . $atts['border_style'] . ';';
|
123 |
-
$style .= 'border-color: ' . $atts['border_color'] . ';';
|
124 |
|
125 |
if ( 'rounded' === $atts['style'] ) {
|
126 |
-
$style .= 'border-radius: ' . $atts['rounded_radius'] . ';';
|
127 |
}
|
128 |
|
129 |
if ( $style ) {
|
130 |
if ( false !== stripos( $img, ' style="' ) ) {
|
131 |
-
$img = str_ireplace( ' style="', ' style="' . $style, $img );
|
132 |
} else {
|
133 |
-
$img = str_ireplace( '<img ', '<img style="' . $style . '" ', $img );
|
134 |
}
|
135 |
}
|
136 |
|
@@ -139,7 +139,7 @@ class WPRM_SC_Regular_Image extends WPRM_Template_Shortcode {
|
|
139 |
$img = str_ireplace( ' class="', ' class="skip-lazy disable-lazyload ', $img );
|
140 |
}
|
141 |
|
142 |
-
$output = '<div class="' . implode( ' ', $classes ) . '">' . $img . '</div>';
|
143 |
return apply_filters( parent::get_hook(), $output, $atts );
|
144 |
}
|
145 |
}
|
105 |
// Output.
|
106 |
$classes = array(
|
107 |
'wprm-image',
|
108 |
+
'wprm-block-image-' . esc_attr( $atts['style'] ),
|
109 |
);
|
110 |
|
111 |
// Add custom class if set.
|
118 |
|
119 |
// Image Style.
|
120 |
$style = '';
|
121 |
+
$style .= 'border-width: ' . esc_attr( $atts['border_width'] ) . ';';
|
122 |
+
$style .= 'border-style: ' . esc_attr( $atts['border_style'] ) . ';';
|
123 |
+
$style .= 'border-color: ' . esc_attr( $atts['border_color'] ) . ';';
|
124 |
|
125 |
if ( 'rounded' === $atts['style'] ) {
|
126 |
+
$style .= 'border-radius: ' . esc_attr( $atts['rounded_radius'] ) . ';';
|
127 |
}
|
128 |
|
129 |
if ( $style ) {
|
130 |
if ( false !== stripos( $img, ' style="' ) ) {
|
131 |
+
$img = str_ireplace( ' style="', ' style="' . esc_attr( $style ), $img );
|
132 |
} else {
|
133 |
+
$img = str_ireplace( '<img ', '<img style="' . esc_attr( $style ) . '" ', $img );
|
134 |
}
|
135 |
}
|
136 |
|
139 |
$img = str_ireplace( ' class="', ' class="skip-lazy disable-lazyload ', $img );
|
140 |
}
|
141 |
|
142 |
+
$output = '<div class="' . esc_attr( implode( ' ', $classes ) ) . '">' . $img . '</div>';
|
143 |
return apply_filters( parent::get_hook(), $output, $atts );
|
144 |
}
|
145 |
}
|
includes/public/shortcodes/general/class-wprm-sc-icon.php
CHANGED
@@ -144,7 +144,7 @@ class WPRM_SC_Icon extends WPRM_Template_Shortcode {
|
|
144 |
// Output.
|
145 |
$classes = array(
|
146 |
'wprm-icon-shortcode',
|
147 |
-
'wprm-icon-shortcode-' . $atts['style'],
|
148 |
);
|
149 |
|
150 |
// Add custom class if set.
|
@@ -155,25 +155,25 @@ class WPRM_SC_Icon extends WPRM_Template_Shortcode {
|
|
155 |
|
156 |
$style = '';
|
157 |
if ( '16px' !== $atts['icon_size'] ) {
|
158 |
-
$style .= 'font-size: ' . $atts['icon_size'] . ';';
|
159 |
-
$style .= 'height: ' . $atts['icon_size'] . ';';
|
160 |
}
|
161 |
|
162 |
if ( 'separate' === $atts['style'] ) {
|
163 |
-
$classes[] = 'wprm-align-' . $atts['align'];
|
164 |
-
$classes[] = 'wprm-icon-decoration-' . $atts['decoration'];
|
165 |
|
166 |
if ( 'line' === $atts['decoration'] ) {
|
167 |
if ( 'left' === $atts['align'] || 'center' === $atts['align'] ) {
|
168 |
-
$after_icon = '<div class="wprm-decoration-line" style="border-color: ' . $atts['line_color'] . '"></div>';
|
169 |
}
|
170 |
if ( 'right' === $atts['align'] || 'center' === $atts['align'] ) {
|
171 |
-
$before_icon = '<div class="wprm-decoration-line" style="border-color: ' . $atts['line_color'] . '"></div>';
|
172 |
}
|
173 |
}
|
174 |
}
|
175 |
|
176 |
-
$output = '<div class="' . implode( ' ', $classes ) . '" style="' . $style .'">' . $before_icon . $icon . $after_icon . '</div>';
|
177 |
return apply_filters( parent::get_hook(), $output, $atts );
|
178 |
}
|
179 |
}
|
144 |
// Output.
|
145 |
$classes = array(
|
146 |
'wprm-icon-shortcode',
|
147 |
+
'wprm-icon-shortcode-' . esc_attr( $atts['style'] ),
|
148 |
);
|
149 |
|
150 |
// Add custom class if set.
|
155 |
|
156 |
$style = '';
|
157 |
if ( '16px' !== $atts['icon_size'] ) {
|
158 |
+
$style .= 'font-size: ' . esc_attr( $atts['icon_size'] ) . ';';
|
159 |
+
$style .= 'height: ' . esc_attr( $atts['icon_size'] ) . ';';
|
160 |
}
|
161 |
|
162 |
if ( 'separate' === $atts['style'] ) {
|
163 |
+
$classes[] = 'wprm-align-' . esc_attr( $atts['align'] );
|
164 |
+
$classes[] = 'wprm-icon-decoration-' . esc_attr( $atts['decoration'] );
|
165 |
|
166 |
if ( 'line' === $atts['decoration'] ) {
|
167 |
if ( 'left' === $atts['align'] || 'center' === $atts['align'] ) {
|
168 |
+
$after_icon = '<div class="wprm-decoration-line" style="border-color: ' . esc_attr( $atts['line_color'] ) . '"></div>';
|
169 |
}
|
170 |
if ( 'right' === $atts['align'] || 'center' === $atts['align'] ) {
|
171 |
+
$before_icon = '<div class="wprm-decoration-line" style="border-color: ' . esc_attr( $atts['line_color'] ) . '"></div>';
|
172 |
}
|
173 |
}
|
174 |
}
|
175 |
|
176 |
+
$output = '<div class="' . esc_attr( implode( ' ', $classes ) ) . '" style="' . esc_attr( $style ) .'">' . $before_icon . $icon . $after_icon . '</div>';
|
177 |
return apply_filters( parent::get_hook(), $output, $atts );
|
178 |
}
|
179 |
}
|
includes/public/shortcodes/general/class-wprm-sc-jump-to-comments.php
CHANGED
@@ -156,7 +156,7 @@ class WPRM_SC_Jump_To_Comments extends WPRM_Template_Shortcode {
|
|
156 |
$classes = array(
|
157 |
'wprm-recipe-jump-to-comments',
|
158 |
'wprm-recipe-link',
|
159 |
-
'wprm-block-text-' . $atts['text_style'],
|
160 |
);
|
161 |
|
162 |
// Add custom class if set.
|
@@ -201,7 +201,7 @@ class WPRM_SC_Jump_To_Comments extends WPRM_Template_Shortcode {
|
|
201 |
$aria_label = ' aria-label="' . __( 'Rate this Recipe', 'wp-recipe-maker' ) . '"';
|
202 |
}
|
203 |
|
204 |
-
$output = '<a href="' . esc_url( $atts['link'] ) . '" style="' . $style . '" class="' . implode( ' ', $classes ) . '"' . $smooth_scroll_speed . $aria_label . '>' . $icon . $text . '</a>';
|
205 |
return apply_filters( parent::get_hook(), $output, $atts );
|
206 |
}
|
207 |
}
|
156 |
$classes = array(
|
157 |
'wprm-recipe-jump-to-comments',
|
158 |
'wprm-recipe-link',
|
159 |
+
'wprm-block-text-' . esc_attr( $atts['text_style'] ),
|
160 |
);
|
161 |
|
162 |
// Add custom class if set.
|
201 |
$aria_label = ' aria-label="' . __( 'Rate this Recipe', 'wp-recipe-maker' ) . '"';
|
202 |
}
|
203 |
|
204 |
+
$output = '<a href="' . esc_url( $atts['link'] ) . '" style="' . esc_attr( $style ) . '" class="' . esc_attr( implode( ' ', $classes ) ) . '"' . $smooth_scroll_speed . $aria_label . '>' . $icon . esc_html( $text ) . '</a>';
|
205 |
return apply_filters( parent::get_hook(), $output, $atts );
|
206 |
}
|
207 |
}
|
includes/public/shortcodes/general/class-wprm-sc-link.php
CHANGED
@@ -179,7 +179,7 @@ class WPRM_SC_Link extends WPRM_Template_Shortcode {
|
|
179 |
$classes = array(
|
180 |
'wprm-link',
|
181 |
'wprm-recipe-link',
|
182 |
-
'wprm-block-text-' . $atts['text_style'],
|
183 |
);
|
184 |
|
185 |
// Add custom class if set.
|
@@ -187,7 +187,7 @@ class WPRM_SC_Link extends WPRM_Template_Shortcode {
|
|
187 |
|
188 |
$style = 'color: ' . $atts['text_color'] . ';';
|
189 |
if ( 'text' !== $atts['style'] ) {
|
190 |
-
$classes[] = 'wprm-recipe-link-' . $atts['style'];
|
191 |
$classes[] = 'wprm-color-accent';
|
192 |
|
193 |
$style .= 'background-color: ' . $atts['button_color'] . ';';
|
@@ -197,7 +197,7 @@ class WPRM_SC_Link extends WPRM_Template_Shortcode {
|
|
197 |
}
|
198 |
|
199 |
$nofollow = 'nofollow' === $atts['link_nofollow'] ? ' rel="nofollow"' : '';
|
200 |
-
$output = '<a href="' . $link . '" target="' . $atts['link_target']. '" class="' . implode( ' ', $classes ) . '"' . $nofollow . ' style="' . $style . '">' . $icon . $text . '</a>';
|
201 |
return apply_filters( parent::get_hook(), $output, $atts );
|
202 |
}
|
203 |
}
|
179 |
$classes = array(
|
180 |
'wprm-link',
|
181 |
'wprm-recipe-link',
|
182 |
+
'wprm-block-text-' . esc_attr( $atts['text_style'] ),
|
183 |
);
|
184 |
|
185 |
// Add custom class if set.
|
187 |
|
188 |
$style = 'color: ' . $atts['text_color'] . ';';
|
189 |
if ( 'text' !== $atts['style'] ) {
|
190 |
+
$classes[] = 'wprm-recipe-link-' . esc_attr( $atts['style'] );
|
191 |
$classes[] = 'wprm-color-accent';
|
192 |
|
193 |
$style .= 'background-color: ' . $atts['button_color'] . ';';
|
197 |
}
|
198 |
|
199 |
$nofollow = 'nofollow' === $atts['link_nofollow'] ? ' rel="nofollow"' : '';
|
200 |
+
$output = '<a href="' . $link . '" target="' . esc_attr( $atts['link_target'] ) . '" class="' . esc_attr( implode( ' ', $classes ) ). '"' . $nofollow . ' style="' . esc_attr( $style ) . '">' . $icon . esc_html( $text ) . '</a>';
|
201 |
return apply_filters( parent::get_hook(), $output, $atts );
|
202 |
}
|
203 |
}
|
includes/public/shortcodes/general/class-wprm-sc-spacer.php
CHANGED
@@ -47,8 +47,8 @@ class WPRM_SC_Spacer extends WPRM_Template_Shortcode {
|
|
47 |
// Add custom class if set.
|
48 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
49 |
|
50 |
-
$style = '10px' === $atts['size'] ? '' : ' style="height: ' . $atts['size'] . '"';
|
51 |
-
$output = '<div class="' . implode( ' ', $classes ) . '"' . $style . '></div>';
|
52 |
|
53 |
return apply_filters( parent::get_hook(), $output, $atts );
|
54 |
}
|
47 |
// Add custom class if set.
|
48 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
49 |
|
50 |
+
$style = '10px' === $atts['size'] ? '' : ' style="height: ' . esc_attr( $atts['size'] ) . '"';
|
51 |
+
$output = '<div class="' . esc_attr( implode( ' ', $classes ) ) . '"' . $style . '></div>';
|
52 |
|
53 |
return apply_filters( parent::get_hook(), $output, $atts );
|
54 |
}
|
includes/public/shortcodes/general/class-wprm-sc-text.php
CHANGED
@@ -94,7 +94,7 @@ class WPRM_SC_Text extends WPRM_Template_Shortcode {
|
|
94 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
95 |
|
96 |
$output = '';
|
97 |
-
$tag =
|
98 |
|
99 |
// Alignment.
|
100 |
if ( 'span' !== $tag && 'left' !== $atts['align'] ) {
|
@@ -116,7 +116,7 @@ class WPRM_SC_Text extends WPRM_Template_Shortcode {
|
|
116 |
$output .= $header;
|
117 |
}
|
118 |
|
119 |
-
$output .= '<' . $tag . ' class="' . implode( ' ', $classes ) . '">' . $text . '</' . $tag . '>';
|
120 |
|
121 |
if ( $header ) {
|
122 |
$output .= '</div>';
|
94 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
95 |
|
96 |
$output = '';
|
97 |
+
$tag = sanitize_key( $atts['tag'] );
|
98 |
|
99 |
// Alignment.
|
100 |
if ( 'span' !== $tag && 'left' !== $atts['align'] ) {
|
116 |
$output .= $header;
|
117 |
}
|
118 |
|
119 |
+
$output .= '<' . $tag . ' class="' . esc_attr( implode( ' ', $classes ) ) . '">' . esc_html( $text ) . '</' . $tag . '>';
|
120 |
|
121 |
if ( $header ) {
|
122 |
$output .= '</div>';
|
includes/public/shortcodes/recipe/class-wprm-sc-author.php
CHANGED
@@ -137,7 +137,7 @@ class WPRM_SC_Author extends WPRM_Template_Shortcode {
|
|
137 |
// Add custom class if set.
|
138 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
139 |
|
140 |
-
$output .= '<span class="' . implode( ' ', $classes ) . '">' . $recipe->author() . '</span>';
|
141 |
|
142 |
// Optional author image.
|
143 |
$img = '';
|
@@ -180,9 +180,9 @@ class WPRM_SC_Author extends WPRM_Template_Shortcode {
|
|
180 |
|
181 |
if ( $style ) {
|
182 |
if ( false !== stripos( $img, ' style="' ) ) {
|
183 |
-
$img = str_ireplace( ' style="', ' style="' . $style, $img );
|
184 |
} else {
|
185 |
-
$img = str_ireplace( '<img ', '<img style="' . $style . '" ', $img );
|
186 |
}
|
187 |
}
|
188 |
|
137 |
// Add custom class if set.
|
138 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
139 |
|
140 |
+
$output .= '<span class="' . esc_attr( implode( ' ', $classes ) ) . '">' . $recipe->author() . '</span>';
|
141 |
|
142 |
// Optional author image.
|
143 |
$img = '';
|
180 |
|
181 |
if ( $style ) {
|
182 |
if ( false !== stripos( $img, ' style="' ) ) {
|
183 |
+
$img = str_ireplace( ' style="', ' style="' . esc_attr( $style ), $img );
|
184 |
} else {
|
185 |
+
$img = str_ireplace( '<img ', '<img style="' . esc_attr( $style ) . '" ', $img );
|
186 |
}
|
187 |
}
|
188 |
|
includes/public/shortcodes/recipe/class-wprm-sc-cost.php
CHANGED
@@ -57,7 +57,7 @@ class WPRM_SC_Cost extends WPRM_Template_Shortcode {
|
|
57 |
// Add custom class if set.
|
58 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
59 |
|
60 |
-
$output = '<span class="' . implode( ' ', $classes ) . '">' . $recipe->cost() . '</span>';
|
61 |
$output = WPRM_Shortcode_Helper::get_label_container( $atts, 'cost', $output );
|
62 |
|
63 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
57 |
// Add custom class if set.
|
58 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
59 |
|
60 |
+
$output = '<span class="' . esc_attr( implode( ' ', $classes ) ) . '">' . $recipe->cost() . '</span>';
|
61 |
$output = WPRM_Shortcode_Helper::get_label_container( $atts, 'cost', $output );
|
62 |
|
63 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
includes/public/shortcodes/recipe/class-wprm-sc-counter.php
CHANGED
@@ -93,11 +93,11 @@ class WPRM_SC_Counter extends WPRM_Template_Shortcode {
|
|
93 |
$target = $recipe->parent_url_new_tab() ? ' target="_blank"' : '';
|
94 |
$nofollow = $recipe->parent_url_nofollow() ? ' rel="nofollow"' : '';
|
95 |
|
96 |
-
$text = '<a href="' . esc_url( $recipe->permalink() ) . '"' . $target . $nofollow . '>' . $text . '</a>';
|
97 |
}
|
98 |
|
99 |
-
$tag =
|
100 |
-
$output = '<' . $tag . ' class="' . implode( ' ', $classes ) . '">' . $text . '</' . $tag . '>';
|
101 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
102 |
}
|
103 |
}
|
93 |
$target = $recipe->parent_url_new_tab() ? ' target="_blank"' : '';
|
94 |
$nofollow = $recipe->parent_url_nofollow() ? ' rel="nofollow"' : '';
|
95 |
|
96 |
+
$text = '<a href="' . esc_url( $recipe->permalink() ) . '"' . $target . $nofollow . '>' . esc_html( $text ) . '</a>';
|
97 |
}
|
98 |
|
99 |
+
$tag = sanitize_key( $atts['tag'] );
|
100 |
+
$output = '<' . $tag . ' class="' . esc_attr( implode( ' ', $classes ) ) . '">' . $text . '</' . $tag . '>';
|
101 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
102 |
}
|
103 |
}
|
includes/public/shortcodes/recipe/class-wprm-sc-date.php
CHANGED
@@ -67,7 +67,7 @@ class WPRM_SC_Date extends WPRM_Template_Shortcode {
|
|
67 |
// Add custom class if set.
|
68 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
69 |
|
70 |
-
$tag =
|
71 |
|
72 |
// Date format.
|
73 |
$format = $atts['date_format'];
|
@@ -76,7 +76,7 @@ class WPRM_SC_Date extends WPRM_Template_Shortcode {
|
|
76 |
}
|
77 |
$date = date_i18n( $format, strtotime( $recipe->date() ) );
|
78 |
|
79 |
-
$output = '<' . $tag . ' class="' . implode( ' ', $classes ) . '">' . $date . '</' . $tag . '>';
|
80 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
81 |
}
|
82 |
}
|
67 |
// Add custom class if set.
|
68 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
69 |
|
70 |
+
$tag = sanitize_key( $atts['tag'] );
|
71 |
|
72 |
// Date format.
|
73 |
$format = $atts['date_format'];
|
76 |
}
|
77 |
$date = date_i18n( $format, strtotime( $recipe->date() ) );
|
78 |
|
79 |
+
$output = '<' . $tag . ' class="' . esc_attr( implode( ' ', $classes ) ) . '">' . $date . '</' . $tag . '>';
|
80 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
81 |
}
|
82 |
}
|
includes/public/shortcodes/recipe/class-wprm-sc-email-share.php
CHANGED
@@ -215,7 +215,7 @@ class WPRM_SC_Email_Share extends WPRM_Template_Shortcode {
|
|
215 |
$aria_label = ' aria-label="' . __( 'Share by Email', 'wp-recipe-maker' ) . '"';
|
216 |
}
|
217 |
|
218 |
-
$output = '<a href="' . $mailto_url . '" data-recipe="' . esc_attr( $recipe->id() ) . '" style="' . $style . '" class="' . implode( ' ', $classes ) . '" target="_blank" rel="nofollow"' . $aria_label . '>' . $icon . $text . '</a>';
|
219 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
220 |
}
|
221 |
}
|
215 |
$aria_label = ' aria-label="' . __( 'Share by Email', 'wp-recipe-maker' ) . '"';
|
216 |
}
|
217 |
|
218 |
+
$output = '<a href="' . esc_attr( $mailto_url ) . '" data-recipe="' . esc_attr( $recipe->id() ) . '" style="' . esc_attr( $style ) . '" class="' . esc_attr( implode( ' ', $classes ) ) . '" target="_blank" rel="nofollow"' . $aria_label . '>' . $icon . esc_html( $text ) . '</a>';
|
219 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
220 |
}
|
221 |
}
|
includes/public/shortcodes/recipe/class-wprm-sc-equipment.php
CHANGED
@@ -171,7 +171,7 @@ class WPRM_SC_Equipment extends WPRM_Template_Shortcode {
|
|
171 |
// Add custom class if set.
|
172 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
173 |
|
174 |
-
$output = '<div class="' . implode( ' ', $classes ) . '" data-recipe="' . esc_attr( $recipe->id() ) . '">';
|
175 |
$output .= WPRM_Shortcode_Helper::get_section_header( $atts, 'equipment' );
|
176 |
|
177 |
if ( 'list' === $atts['display_style'] ) {
|
@@ -179,7 +179,7 @@ class WPRM_SC_Equipment extends WPRM_Template_Shortcode {
|
|
179 |
foreach ( $recipe->equipment() as $equipment ) {
|
180 |
$list_style_type = 'checkbox' === $atts['list_style'] || 'advanced' === $atts['list_style'] ? 'none' : $atts['list_style'];
|
181 |
$style = 'list-style-type: ' . $list_style_type . ';';
|
182 |
-
$output .= '<li class="wprm-recipe-equipment-item" style="' . $style . '">';
|
183 |
|
184 |
// Equipment link.
|
185 |
$name = apply_filters( 'wprm_recipe_equipment_shortcode_link', $equipment['name'], $equipment );
|
@@ -205,7 +205,7 @@ class WPRM_SC_Equipment extends WPRM_Template_Shortcode {
|
|
205 |
$separator = ' ';
|
206 |
}
|
207 |
|
208 |
-
$name = $name . $separator . '<span class="wprm-recipe-equipment-notes wprm-recipe-equipment-notes-' . $atts['notes_style'] . '">' . $notes . '</span>';
|
209 |
}
|
210 |
|
211 |
$equipment_output = '<div class="wprm-recipe-equipment-name">' . $name . '</div>';
|
171 |
// Add custom class if set.
|
172 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
173 |
|
174 |
+
$output = '<div class="' . esc_attr( implode( ' ', $classes ) ) . '" data-recipe="' . esc_attr( $recipe->id() ) . '">';
|
175 |
$output .= WPRM_Shortcode_Helper::get_section_header( $atts, 'equipment' );
|
176 |
|
177 |
if ( 'list' === $atts['display_style'] ) {
|
179 |
foreach ( $recipe->equipment() as $equipment ) {
|
180 |
$list_style_type = 'checkbox' === $atts['list_style'] || 'advanced' === $atts['list_style'] ? 'none' : $atts['list_style'];
|
181 |
$style = 'list-style-type: ' . $list_style_type . ';';
|
182 |
+
$output .= '<li class="wprm-recipe-equipment-item" style="' . esc_attr( $style ) . '">';
|
183 |
|
184 |
// Equipment link.
|
185 |
$name = apply_filters( 'wprm_recipe_equipment_shortcode_link', $equipment['name'], $equipment );
|
205 |
$separator = ' ';
|
206 |
}
|
207 |
|
208 |
+
$name = $name . $separator . '<span class="wprm-recipe-equipment-notes wprm-recipe-equipment-notes-' . esc_attr( $atts['notes_style'] ) . '">' . $notes . '</span>';
|
209 |
}
|
210 |
|
211 |
$equipment_output = '<div class="wprm-recipe-equipment-name">' . $name . '</div>';
|
includes/public/shortcodes/recipe/class-wprm-sc-facebook-share.php
CHANGED
@@ -179,7 +179,7 @@ class WPRM_SC_Facebook_Share extends WPRM_Template_Shortcode {
|
|
179 |
$aria_label = ' aria-label="' . __( 'Share on Facebook', 'wp-recipe-maker' ) . '"';
|
180 |
}
|
181 |
|
182 |
-
$output = '<a href="' . $share_url . '" ' . $facebook_script .' data-recipe="' . esc_attr( $recipe->id() ) . '" style="' . $style . '" class="' . implode( ' ', $classes ) . '" target="_blank" rel="nofollow noopener"' . $aria_label . '>' . $icon . $text . '</a>';
|
183 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
184 |
}
|
185 |
}
|
179 |
$aria_label = ' aria-label="' . __( 'Share on Facebook', 'wp-recipe-maker' ) . '"';
|
180 |
}
|
181 |
|
182 |
+
$output = '<a href="' . esc_attr( $share_url ) . '" ' . $facebook_script .' data-recipe="' . esc_attr( $recipe->id() ) . '" style="' . esc_attr( $style ) . '" class="' . esc_attr( implode( ' ', $classes ) ) . '" target="_blank" rel="nofollow noopener"' . $aria_label . '>' . $icon . esc_html( $text ) . '</a>';
|
183 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
184 |
}
|
185 |
}
|
includes/public/shortcodes/recipe/class-wprm-sc-grow.php
CHANGED
@@ -193,9 +193,9 @@ class WPRM_SC_Grow extends WPRM_Template_Shortcode {
|
|
193 |
$output = '';
|
194 |
|
195 |
$output .= '<span class="wprm-recipe-grow-container">';
|
196 |
-
$output .= '<a href="https://app.grow.me" target="_blank" rel="nofollow noreferrer" style="' . $style . '" class="wprm-recipe-grow-not-saved ' . implode( ' ', $classes ) . '" data-recipe-id="' . esc_attr( $recipe->id() ) . '"' . $aria_label . '>' . $icon . $text . '</a>';
|
197 |
$style .= 'display: none;';
|
198 |
-
$output .= '<a href="https://app.grow.me" target="_blank" rel="nofollow noreferrer" style="' . $style . '" class="wprm-recipe-grow-saved ' . implode( ' ', $classes ) . '" data-recipe-id="' . esc_attr( $recipe->id() ) . '"' . $aria_label_added . '>' . $icon_added . $text_added . '</a>';
|
199 |
$output .= '</span>';
|
200 |
|
201 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
193 |
$output = '';
|
194 |
|
195 |
$output .= '<span class="wprm-recipe-grow-container">';
|
196 |
+
$output .= '<a href="https://app.grow.me" target="_blank" rel="nofollow noreferrer" style="' . esc_attr( $style ) . '" class="wprm-recipe-grow-not-saved ' . esc_attr( implode( ' ', $classes ) ) . '" data-recipe-id="' . esc_attr( $recipe->id() ) . '"' . $aria_label . '>' . $icon . esc_html( $text ) . '</a>';
|
197 |
$style .= 'display: none;';
|
198 |
+
$output .= '<a href="https://app.grow.me" target="_blank" rel="nofollow noreferrer" style="' . esc_attr( $style ) . '" class="wprm-recipe-grow-saved ' . esc_attr( implode( ' ', $classes ) ) . '" data-recipe-id="' . esc_attr( $recipe->id() ) . '"' . $aria_label_added . '>' . $icon_added . esc_html( $text_added ) . '</a>';
|
199 |
$output .= '</span>';
|
200 |
|
201 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
includes/public/shortcodes/recipe/class-wprm-sc-image.php
CHANGED
@@ -123,9 +123,9 @@ class WPRM_SC_Image extends WPRM_Template_Shortcode {
|
|
123 |
|
124 |
if ( $style ) {
|
125 |
if ( false !== stripos( $img, ' style="' ) ) {
|
126 |
-
$img = str_ireplace( ' style="', ' style="' . $style, $img );
|
127 |
} else {
|
128 |
-
$img = str_ireplace( '<img ', '<img style="' . $style . '" ', $img );
|
129 |
}
|
130 |
}
|
131 |
|
@@ -148,7 +148,7 @@ class WPRM_SC_Image extends WPRM_Template_Shortcode {
|
|
148 |
}
|
149 |
}
|
150 |
|
151 |
-
$output = '<div class="' . implode( ' ', $classes ) . '">' . $img . '</div>';
|
152 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
153 |
}
|
154 |
}
|
123 |
|
124 |
if ( $style ) {
|
125 |
if ( false !== stripos( $img, ' style="' ) ) {
|
126 |
+
$img = str_ireplace( ' style="', ' style="' . esc_attr( $style ), $img );
|
127 |
} else {
|
128 |
+
$img = str_ireplace( '<img ', '<img style="' . esc_attr( $style ) . '" ', $img );
|
129 |
}
|
130 |
}
|
131 |
|
148 |
}
|
149 |
}
|
150 |
|
151 |
+
$output = '<div class="' . esc_attr( implode( ' ', $classes ) ). '">' . $img . '</div>';
|
152 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
153 |
}
|
154 |
}
|
includes/public/shortcodes/recipe/class-wprm-sc-ingredients.php
CHANGED
@@ -597,7 +597,7 @@ class WPRM_SC_Ingredients extends WPRM_Template_Shortcode {
|
|
597 |
'text_style' => $atts['advanced_servings_text_style'],
|
598 |
);
|
599 |
|
600 |
-
$output = '<div class="' . implode( ' ', $classes ) . '" data-recipe="' . esc_attr( $recipe->id() ) . '" data-servings="' . esc_attr( $recipe->servings() ) . '">';
|
601 |
$output .= WPRM_Shortcode_Helper::get_section_header( $atts, 'ingredients', array(
|
602 |
'unit_conversion_atts' => $unit_conversion_atts,
|
603 |
'adjustable_servings_atts' => $adjustable_servings_atts,
|
@@ -624,8 +624,8 @@ class WPRM_SC_Ingredients extends WPRM_Template_Shortcode {
|
|
624 |
'wprm-block-text-' . $atts['group_style'],
|
625 |
);
|
626 |
|
627 |
-
$tag =
|
628 |
-
$output .= '<' . $tag . ' class="' . implode( ' ', $classes ) . '">' . $ingredient_group['name'] . '</' . $tag . '>';
|
629 |
}
|
630 |
|
631 |
$output .= '<ul class="wprm-recipe-ingredients">';
|
@@ -644,7 +644,7 @@ class WPRM_SC_Ingredients extends WPRM_Template_Shortcode {
|
|
644 |
$style .= 'flex-basis: ' . $atts['group_width'] . ';';
|
645 |
}
|
646 |
|
647 |
-
$output .= '<li class="wprm-recipe-ingredient" style="' . $style . '"' . $uid . '>';
|
648 |
|
649 |
// Maybe replace fractions in amount.
|
650 |
if ( WPRM_Settings::get( 'automatic_amount_fraction_symbols' ) ) {
|
@@ -724,9 +724,9 @@ class WPRM_SC_Ingredients extends WPRM_Template_Shortcode {
|
|
724 |
|
725 |
if ( $ingredient['notes'] ) {
|
726 |
if ( 'parentheses' === $atts['ingredient_notes_separator'] ) {
|
727 |
-
$notes_output .= '<span class="wprm-recipe-ingredient-notes wprm-recipe-ingredient-notes-' . $atts['notes_style'] . '">(' . $ingredient['notes'] . ')</span>';
|
728 |
} else {
|
729 |
-
$notes_output .= '<span class="wprm-recipe-ingredient-notes wprm-recipe-ingredient-notes-' . $atts['notes_style'] . '">' . $ingredient['notes'] . '</span>';
|
730 |
}
|
731 |
} elseif( ! in_array( $atts['ingredients_style'], array( 'regular', 'grouped' ) ) ) {
|
732 |
$notes_output .= '<span class="wprm-recipe-ingredient-notes"></span>';
|
597 |
'text_style' => $atts['advanced_servings_text_style'],
|
598 |
);
|
599 |
|
600 |
+
$output = '<div class="' . esc_attr( implode( ' ', $classes ) ) . '" data-recipe="' . esc_attr( $recipe->id() ) . '" data-servings="' . esc_attr( $recipe->servings() ) . '">';
|
601 |
$output .= WPRM_Shortcode_Helper::get_section_header( $atts, 'ingredients', array(
|
602 |
'unit_conversion_atts' => $unit_conversion_atts,
|
603 |
'adjustable_servings_atts' => $adjustable_servings_atts,
|
624 |
'wprm-block-text-' . $atts['group_style'],
|
625 |
);
|
626 |
|
627 |
+
$tag = sanitize_key( $atts['group_tag'] );
|
628 |
+
$output .= '<' . $tag . ' class="' . esc_attr( implode( ' ', $classes ) ) . '">' . $ingredient_group['name'] . '</' . $tag . '>';
|
629 |
}
|
630 |
|
631 |
$output .= '<ul class="wprm-recipe-ingredients">';
|
644 |
$style .= 'flex-basis: ' . $atts['group_width'] . ';';
|
645 |
}
|
646 |
|
647 |
+
$output .= '<li class="wprm-recipe-ingredient" style="' . esc_attr( $style ) . '"' . $uid . '>';
|
648 |
|
649 |
// Maybe replace fractions in amount.
|
650 |
if ( WPRM_Settings::get( 'automatic_amount_fraction_symbols' ) ) {
|
724 |
|
725 |
if ( $ingredient['notes'] ) {
|
726 |
if ( 'parentheses' === $atts['ingredient_notes_separator'] ) {
|
727 |
+
$notes_output .= '<span class="wprm-recipe-ingredient-notes wprm-recipe-ingredient-notes-' . esc_attr( $atts['notes_style'] ) . '">(' . $ingredient['notes'] . ')</span>';
|
728 |
} else {
|
729 |
+
$notes_output .= '<span class="wprm-recipe-ingredient-notes wprm-recipe-ingredient-notes-' . esc_attr( $atts['notes_style'] ) . '">' . $ingredient['notes'] . '</span>';
|
730 |
}
|
731 |
} elseif( ! in_array( $atts['ingredients_style'], array( 'regular', 'grouped' ) ) ) {
|
732 |
$notes_output .= '<span class="wprm-recipe-ingredient-notes"></span>';
|
includes/public/shortcodes/recipe/class-wprm-sc-instructions.php
CHANGED
@@ -288,7 +288,7 @@ class WPRM_SC_Instructions extends WPRM_Template_Shortcode {
|
|
288 |
'off_text' => $atts['toggle_off_text'],
|
289 |
);
|
290 |
|
291 |
-
$output = '<div class="' . implode( ' ', $classes ) . '" data-recipe="' . esc_attr( $recipe->id() ) . '">';
|
292 |
$output .= WPRM_Shortcode_Helper::get_section_header( $atts, 'instructions', array(
|
293 |
'media_toggle_atts' => $media_toggle_atts,
|
294 |
) );
|
@@ -308,8 +308,8 @@ class WPRM_SC_Instructions extends WPRM_Template_Shortcode {
|
|
308 |
'wprm-block-text-' . $atts['group_style'],
|
309 |
);
|
310 |
|
311 |
-
$tag =
|
312 |
-
$output .= '<' . $tag . ' class="' . implode( ' ', $classes ) . '">' . $instruction_group['name'] . '</' . $tag . '>';
|
313 |
}
|
314 |
|
315 |
$output .= '<ul class="wprm-recipe-instructions">';
|
@@ -318,7 +318,7 @@ class WPRM_SC_Instructions extends WPRM_Template_Shortcode {
|
|
318 |
$list_style_type = 'checkbox' === $atts['list_style'] || 'advanced' === $atts['list_style'] ? 'none' : $atts['list_style'];
|
319 |
$style = 'list-style-type: ' . $list_style_type . ';';
|
320 |
|
321 |
-
$output .= '<li id="wprm-recipe-' . $recipe->id() . '-step-' . $group_index . '-' . $index . '" class="wprm-recipe-instruction" style="' . $style . '">';
|
322 |
|
323 |
if ( 'before' === $atts['ingredients_position'] ) {
|
324 |
$output .= self::instruction_ingredients( $recipe, $instruction, $atts );
|
@@ -331,7 +331,7 @@ class WPRM_SC_Instructions extends WPRM_Template_Shortcode {
|
|
331 |
$text_style = '';
|
332 |
|
333 |
if ( '0px' !== $atts['text_margin'] ) {
|
334 |
-
$text_style = ' style="margin-bottom: ' . $atts['text_margin'] . '";';
|
335 |
}
|
336 |
|
337 |
$instruction_text = '<div class="wprm-recipe-instruction-text"' . $text_style . '>' . $text . '</div>';
|
@@ -407,11 +407,11 @@ class WPRM_SC_Instructions extends WPRM_Template_Shortcode {
|
|
407 |
|
408 |
$style = '';
|
409 |
if ( 'after' === $atts['ingredients_position'] && '0px' !== $atts['text_margin'] ) {
|
410 |
-
$style = ' style="margin-top: -' . $atts['text_margin'] . '; margin-bottom: ' . $atts['text_margin'] . ';"';
|
411 |
}
|
412 |
|
413 |
$i = 0;
|
414 |
-
$output .= '<div class="'. implode( ' ', $classes ) . '"' . $style . '>';
|
415 |
$tag = 'inline' === $atts['ingredients_display'] ? 'span' : 'div';
|
416 |
|
417 |
foreach ( $ingredients_to_output as $uid => $text ) {
|
@@ -422,7 +422,7 @@ class WPRM_SC_Instructions extends WPRM_Template_Shortcode {
|
|
422 |
|
423 |
$style = '';
|
424 |
if ( '0px' !== $atts['ingredients_text_margin'] ) {
|
425 |
-
$style = ' style="margin-bottom: ' . $atts['ingredients_text_margin'] . ';"';
|
426 |
}
|
427 |
|
428 |
// Optional separator, if not last item.
|
@@ -434,7 +434,7 @@ class WPRM_SC_Instructions extends WPRM_Template_Shortcode {
|
|
434 |
}
|
435 |
|
436 |
// Output.
|
437 |
-
$output .= '<' . $tag . ' class="'. implode( ' ', $classes ) . '" data-separator="' . esc_attr( $separator ) . '"' . $style . '>';
|
438 |
$output .= wp_strip_all_tags( $text );
|
439 |
$output .= $separator;
|
440 |
|
@@ -462,7 +462,7 @@ class WPRM_SC_Instructions extends WPRM_Template_Shortcode {
|
|
462 |
$output = '';
|
463 |
|
464 |
if ( $instruction['image'] ) {
|
465 |
-
$output = '<div class="wprm-recipe-instruction-media wprm-recipe-instruction-image" style="text-align: ' . $atts['image_alignment'] . ';">' . self::instruction_image( $recipe, $instruction, $atts['image_size'] ) . '</div> ';
|
466 |
} else if ( isset( $instruction['video'] ) && isset( $instruction['video']['type'] ) && in_array( $instruction['video']['type'], array( 'upload', 'embed' ) ) ) {
|
467 |
$output = '<div class="wprm-recipe-instruction-media wprm-recipe-instruction-video">' . self::instruction_video( $recipe, $instruction ) . '</div> ';
|
468 |
}
|
@@ -496,9 +496,9 @@ class WPRM_SC_Instructions extends WPRM_Template_Shortcode {
|
|
496 |
$style = 'max-width: ' . $image_data[1] . 'px;';
|
497 |
|
498 |
if ( false !== stripos( $img, ' style="' ) ) {
|
499 |
-
$img = str_ireplace( ' style="', ' style="' . $style, $img );
|
500 |
} else {
|
501 |
-
$img = str_ireplace( '<img ', '<img style="' . $style . '" ', $img );
|
502 |
}
|
503 |
}
|
504 |
}
|
288 |
'off_text' => $atts['toggle_off_text'],
|
289 |
);
|
290 |
|
291 |
+
$output = '<div class="' . esc_attr( implode( ' ', $classes ) ) . '" data-recipe="' . esc_attr( $recipe->id() ) . '">';
|
292 |
$output .= WPRM_Shortcode_Helper::get_section_header( $atts, 'instructions', array(
|
293 |
'media_toggle_atts' => $media_toggle_atts,
|
294 |
) );
|
308 |
'wprm-block-text-' . $atts['group_style'],
|
309 |
);
|
310 |
|
311 |
+
$tag = sanitize_key( $atts['group_tag'] );
|
312 |
+
$output .= '<' . $tag . ' class="' . esc_attr( implode( ' ', $classes ) ) . '">' . $instruction_group['name'] . '</' . $tag . '>';
|
313 |
}
|
314 |
|
315 |
$output .= '<ul class="wprm-recipe-instructions">';
|
318 |
$list_style_type = 'checkbox' === $atts['list_style'] || 'advanced' === $atts['list_style'] ? 'none' : $atts['list_style'];
|
319 |
$style = 'list-style-type: ' . $list_style_type . ';';
|
320 |
|
321 |
+
$output .= '<li id="wprm-recipe-' . esc_attr( $recipe->id() ) . '-step-' . esc_attr( $group_index ) . '-' . esc_attr( $index ) . '" class="wprm-recipe-instruction" style="' . esc_attr( $style ) . '">';
|
322 |
|
323 |
if ( 'before' === $atts['ingredients_position'] ) {
|
324 |
$output .= self::instruction_ingredients( $recipe, $instruction, $atts );
|
331 |
$text_style = '';
|
332 |
|
333 |
if ( '0px' !== $atts['text_margin'] ) {
|
334 |
+
$text_style = ' style="margin-bottom: ' . esc_attr( $atts['text_margin'] ) . '";';
|
335 |
}
|
336 |
|
337 |
$instruction_text = '<div class="wprm-recipe-instruction-text"' . $text_style . '>' . $text . '</div>';
|
407 |
|
408 |
$style = '';
|
409 |
if ( 'after' === $atts['ingredients_position'] && '0px' !== $atts['text_margin'] ) {
|
410 |
+
$style = ' style="margin-top: -' . esc_attr( $atts['text_margin'] ) . '; margin-bottom: ' . esc_attr( $atts['text_margin'] ) . ';"';
|
411 |
}
|
412 |
|
413 |
$i = 0;
|
414 |
+
$output .= '<div class="'. esc_attr( implode( ' ', $classes ) ) . '"' . $style . '>';
|
415 |
$tag = 'inline' === $atts['ingredients_display'] ? 'span' : 'div';
|
416 |
|
417 |
foreach ( $ingredients_to_output as $uid => $text ) {
|
422 |
|
423 |
$style = '';
|
424 |
if ( '0px' !== $atts['ingredients_text_margin'] ) {
|
425 |
+
$style = ' style="margin-bottom: ' . esc_attr( $atts['ingredients_text_margin'] ) . ';"';
|
426 |
}
|
427 |
|
428 |
// Optional separator, if not last item.
|
434 |
}
|
435 |
|
436 |
// Output.
|
437 |
+
$output .= '<' . $tag . ' class="'. esc_attr( implode( ' ', $classes ) ) . '" data-separator="' . esc_attr( $separator ) . '"' . $style . '>';
|
438 |
$output .= wp_strip_all_tags( $text );
|
439 |
$output .= $separator;
|
440 |
|
462 |
$output = '';
|
463 |
|
464 |
if ( $instruction['image'] ) {
|
465 |
+
$output = '<div class="wprm-recipe-instruction-media wprm-recipe-instruction-image" style="text-align: ' . esc_attr( $atts['image_alignment'] ) . ';">' . self::instruction_image( $recipe, $instruction, $atts['image_size'] ) . '</div> ';
|
466 |
} else if ( isset( $instruction['video'] ) && isset( $instruction['video']['type'] ) && in_array( $instruction['video']['type'], array( 'upload', 'embed' ) ) ) {
|
467 |
$output = '<div class="wprm-recipe-instruction-media wprm-recipe-instruction-video">' . self::instruction_video( $recipe, $instruction ) . '</div> ';
|
468 |
}
|
496 |
$style = 'max-width: ' . $image_data[1] . 'px;';
|
497 |
|
498 |
if ( false !== stripos( $img, ' style="' ) ) {
|
499 |
+
$img = str_ireplace( ' style="', ' style="' . esc_attr( $style ), $img );
|
500 |
} else {
|
501 |
+
$img = str_ireplace( '<img ', '<img style="' . esc_attr( $style ) . '" ', $img );
|
502 |
}
|
503 |
}
|
504 |
}
|
includes/public/shortcodes/recipe/class-wprm-sc-jump-video.php
CHANGED
@@ -195,7 +195,7 @@ class WPRM_SC_Jump_Video extends WPRM_Template_Shortcode {
|
|
195 |
}
|
196 |
|
197 |
// "wprm-jump-to-video-shortcode" class for backwards compatibility.
|
198 |
-
$output = '<a href="#wprm-recipe-video-container-' . esc_attr( $recipe->id() ) . '" data-recipe="' . esc_attr( $recipe->id() ) . '" style="' . $style . '" class="' . implode( ' ', $classes ) . '"' . $smooth_scroll_speed . $aria_label . '>' . $icon . $text . '</a>';
|
199 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
200 |
}
|
201 |
}
|
195 |
}
|
196 |
|
197 |
// "wprm-jump-to-video-shortcode" class for backwards compatibility.
|
198 |
+
$output = '<a href="#wprm-recipe-video-container-' . esc_attr( $recipe->id() ) . '" data-recipe="' . esc_attr( $recipe->id() ) . '" style="' . esc_attr( $style ) . '" class="' . esc_attr( implode( ' ', $classes ) ) . '"' . $smooth_scroll_speed . $aria_label . '>' . $icon . esc_html( $text ) . '</a>';
|
199 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
200 |
}
|
201 |
}
|
includes/public/shortcodes/recipe/class-wprm-sc-jump.php
CHANGED
@@ -195,7 +195,7 @@ class WPRM_SC_Jump extends WPRM_Template_Shortcode {
|
|
195 |
}
|
196 |
|
197 |
// "wprm-jump-to-recipe-shortcode" class for backwards compatibility.
|
198 |
-
$output = '<a href="#wprm-recipe-container-' . esc_attr( $recipe->id() ) . '" data-recipe="' . esc_attr( $recipe->id() ) . '" style="' . $style . '" class="' . implode( ' ', $classes ) . '"' . $smooth_scroll_speed . $aria_label . '>' . $icon . $text . '</a>';
|
199 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
200 |
}
|
201 |
}
|
195 |
}
|
196 |
|
197 |
// "wprm-jump-to-recipe-shortcode" class for backwards compatibility.
|
198 |
+
$output = '<a href="#wprm-recipe-container-' . esc_attr( $recipe->id() ) . '" data-recipe="' . esc_attr( $recipe->id() ) . '" style="' . esc_attr( $style ) . '" class="' . esc_attr( implode( ' ', $classes ) ) . '"' . $smooth_scroll_speed . $aria_label . '>' . $icon . esc_html( $text ) . '</a>';
|
199 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
200 |
}
|
201 |
}
|
includes/public/shortcodes/recipe/class-wprm-sc-media-toggle.php
CHANGED
@@ -127,7 +127,7 @@ class WPRM_SC_Media_Toggle extends WPRM_Template_Shortcode {
|
|
127 |
// Get button text.
|
128 |
$button_text = '';
|
129 |
if ( $atts[ $button . '_text'] ) {
|
130 |
-
$button_text .= '<span class="wprm-toggle-text">' . $atts[ $button . '_text'] . '</span>';
|
131 |
}
|
132 |
|
133 |
// Get optional icon.
|
@@ -144,11 +144,11 @@ class WPRM_SC_Media_Toggle extends WPRM_Template_Shortcode {
|
|
144 |
}
|
145 |
|
146 |
$active = 'on' === $button ? ' wprm-toggle-active' : '';
|
147 |
-
$buttons_output .= '<button class="wprm-recipe-media-toggle wprm-toggle' . $active . '" data-state="' . $button . '" data-recipe="' . esc_attr( $recipe->id() ) . '" style="' . $button_style .'" aria-label="' . $label . '">' . $button_text . '</button>';
|
148 |
}
|
149 |
|
150 |
// Output.
|
151 |
-
$output = '<div class="' . implode( ' ', $classes ) . '" style="' . $style . '">' . $buttons_output . '</div>';
|
152 |
|
153 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
154 |
}
|
127 |
// Get button text.
|
128 |
$button_text = '';
|
129 |
if ( $atts[ $button . '_text'] ) {
|
130 |
+
$button_text .= '<span class="wprm-toggle-text">' . esc_html( $atts[ $button . '_text'] ) . '</span>';
|
131 |
}
|
132 |
|
133 |
// Get optional icon.
|
144 |
}
|
145 |
|
146 |
$active = 'on' === $button ? ' wprm-toggle-active' : '';
|
147 |
+
$buttons_output .= '<button class="wprm-recipe-media-toggle wprm-toggle' . $active . '" data-state="' . esc_attr( $button ) . '" data-recipe="' . esc_attr( $recipe->id() ) . '" style="' . esc_attr( $button_style ) .'" aria-label="' . $label . '">' . $button_text . '</button>';
|
148 |
}
|
149 |
|
150 |
// Output.
|
151 |
+
$output = '<div class="' . esc_attr( implode( ' ', $classes ) ) . '" style="' . esc_attr( $style ) . '">' . $buttons_output . '</div>';
|
152 |
|
153 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
154 |
}
|
includes/public/shortcodes/recipe/class-wprm-sc-meta-container.php
CHANGED
@@ -627,7 +627,7 @@ class WPRM_SC_Meta_Container extends WPRM_Template_Shortcode {
|
|
627 |
}
|
628 |
}
|
629 |
|
630 |
-
$output = $show_container ? '<div class="' . implode( ' ', $classes ) . '" style="' . $style . '">' : '';
|
631 |
|
632 |
foreach ( $fields_output as $field_output ) {
|
633 |
$output .= $field_output;
|
627 |
}
|
628 |
}
|
629 |
|
630 |
+
$output = $show_container ? '<div class="' . esc_attr( implode( ' ', $classes ) ) . '" style="' . esc_attr( $style ) . '">' : '';
|
631 |
|
632 |
foreach ( $fields_output as $field_output ) {
|
633 |
$output .= $field_output;
|
includes/public/shortcodes/recipe/class-wprm-sc-my-emissions.php
CHANGED
@@ -77,7 +77,7 @@ class WPRM_SC_My_Emissions extends WPRM_Template_Shortcode {
|
|
77 |
// Add custom class if set.
|
78 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
79 |
|
80 |
-
$output = '<div class="' . implode( ' ', $classes ) . '">';
|
81 |
$output .= WPRM_Shortcode_Helper::get_section_header( $atts, 'my-emissions' );
|
82 |
$output .= '<div class="wprm-recipe-my-emissions">';
|
83 |
|
77 |
// Add custom class if set.
|
78 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
79 |
|
80 |
+
$output = '<div class="' . esc_attr( implode( ' ', $classes ) ) . '">';
|
81 |
$output .= WPRM_Shortcode_Helper::get_section_header( $atts, 'my-emissions' );
|
82 |
$output .= '<div class="wprm-recipe-my-emissions">';
|
83 |
|
includes/public/shortcodes/recipe/class-wprm-sc-name.php
CHANGED
@@ -66,7 +66,7 @@ class WPRM_SC_Name extends WPRM_Template_Shortcode {
|
|
66 |
// Add custom class if set.
|
67 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
68 |
|
69 |
-
$tag =
|
70 |
$name = $recipe->name();
|
71 |
|
72 |
if ( $atts['link'] && $recipe->permalink() ) {
|
@@ -76,7 +76,7 @@ class WPRM_SC_Name extends WPRM_Template_Shortcode {
|
|
76 |
$name = '<a href="' . esc_url( $recipe->permalink() ) . '"' . $target . $nofollow . '>' . $name . '</a>';
|
77 |
}
|
78 |
|
79 |
-
$output = '<' . $tag . ' class="' . implode( ' ', $classes ) . '">' . $name . '</' . $tag . '>';
|
80 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
81 |
}
|
82 |
}
|
66 |
// Add custom class if set.
|
67 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
68 |
|
69 |
+
$tag = sanitize_key( $atts['tag'] );
|
70 |
$name = $recipe->name();
|
71 |
|
72 |
if ( $atts['link'] && $recipe->permalink() ) {
|
76 |
$name = '<a href="' . esc_url( $recipe->permalink() ) . '"' . $target . $nofollow . '>' . $name . '</a>';
|
77 |
}
|
78 |
|
79 |
+
$output = '<' . $tag . ' class="' . esc_attr( implode( ' ', $classes ) ) . '">' . $name . '</' . $tag . '>';
|
80 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
81 |
}
|
82 |
}
|
includes/public/shortcodes/recipe/class-wprm-sc-notes.php
CHANGED
@@ -56,7 +56,7 @@ class WPRM_SC_Notes extends WPRM_Template_Shortcode {
|
|
56 |
// Add custom class if set.
|
57 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
58 |
|
59 |
-
$output = '<div class="' . implode( ' ', $classes ) . '">';
|
60 |
$output .= WPRM_Shortcode_Helper::get_section_header( $atts, 'notes' );
|
61 |
|
62 |
$notes = parent::clean_paragraphs( $recipe->notes() );
|
56 |
// Add custom class if set.
|
57 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
58 |
|
59 |
+
$output = '<div class="' . esc_attr( implode( ' ', $classes ) ) . '">';
|
60 |
$output .= WPRM_Shortcode_Helper::get_section_header( $atts, 'notes' );
|
61 |
|
62 |
$notes = parent::clean_paragraphs( $recipe->notes() );
|
includes/public/shortcodes/recipe/class-wprm-sc-nutrition.php
CHANGED
@@ -99,7 +99,7 @@ class WPRM_SC_Nutrition extends WPRM_Template_Shortcode {
|
|
99 |
// Add custom class if set.
|
100 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
101 |
|
102 |
-
$output = '<span class="' . implode( ' ', $classes ) . '">' . $nutrient['value'] . '</span>';
|
103 |
|
104 |
if ( $show_unit && $nutrient['unit'] ) {
|
105 |
$classes = array(
|
@@ -109,7 +109,7 @@ class WPRM_SC_Nutrition extends WPRM_Template_Shortcode {
|
|
109 |
'wprm-block-text-' . $atts['text_style'],
|
110 |
);
|
111 |
|
112 |
-
$output = '<span class="wprm-recipe-nutrition-with-unit">' . $output . $atts['unit_separator'] . '<span class="' . implode( ' ', $classes ) . '">' . $nutrient['unit'] . '</span></span>';
|
113 |
}
|
114 |
|
115 |
$output = WPRM_Shortcode_Helper::get_label_container( $atts, array( 'nutrition', $atts['field'] ), $output );
|
99 |
// Add custom class if set.
|
100 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
101 |
|
102 |
+
$output = '<span class="' . esc_attr( implode( ' ', $classes ) ) . '">' . $nutrient['value'] . '</span>';
|
103 |
|
104 |
if ( $show_unit && $nutrient['unit'] ) {
|
105 |
$classes = array(
|
109 |
'wprm-block-text-' . $atts['text_style'],
|
110 |
);
|
111 |
|
112 |
+
$output = '<span class="wprm-recipe-nutrition-with-unit">' . $output . esc_html( $atts['unit_separator'] ) . '<span class="' . esc_attr( implode( ' ', $classes ) ) . '">' . $nutrient['unit'] . '</span></span>';
|
113 |
}
|
114 |
|
115 |
$output = WPRM_Shortcode_Helper::get_label_container( $atts, array( 'nutrition', $atts['field'] ), $output );
|
includes/public/shortcodes/recipe/class-wprm-sc-pin.php
CHANGED
@@ -185,8 +185,8 @@ class WPRM_SC_Pin extends WPRM_Template_Shortcode {
|
|
185 |
|
186 |
// Construct link attributes.
|
187 |
$attributes = '';
|
188 |
-
$attributes .= ' style="' . $style . '"';
|
189 |
-
$attributes .= ' class="' . implode( ' ', $classes ) . '"';
|
190 |
$attributes .= ' target="_blank"';
|
191 |
$attributes .= ' rel="nofollow noopener"';
|
192 |
$attributes .= ' data-recipe="' . esc_attr( $recipe->id() ) . '"';
|
@@ -196,7 +196,7 @@ class WPRM_SC_Pin extends WPRM_Template_Shortcode {
|
|
196 |
$attributes .= ' data-repin="' . esc_attr( $recipe->pin_image_repin_id() ) . '"';
|
197 |
$attributes .= $aria_label;
|
198 |
|
199 |
-
$output = '<a href="' . $pin_url . '"' . $attributes . '>' . $icon . $text . '</a>';
|
200 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
201 |
}
|
202 |
}
|
185 |
|
186 |
// Construct link attributes.
|
187 |
$attributes = '';
|
188 |
+
$attributes .= ' style="' . esc_attr( $style ) . '"';
|
189 |
+
$attributes .= ' class="' . esc_attr( implode( ' ', $classes ) ) . '"';
|
190 |
$attributes .= ' target="_blank"';
|
191 |
$attributes .= ' rel="nofollow noopener"';
|
192 |
$attributes .= ' data-recipe="' . esc_attr( $recipe->id() ) . '"';
|
196 |
$attributes .= ' data-repin="' . esc_attr( $recipe->pin_image_repin_id() ) . '"';
|
197 |
$attributes .= $aria_label;
|
198 |
|
199 |
+
$output = '<a href="' . esc_attr( $pin_url ) . '"' . $attributes . '>' . $icon . esc_html( $text ) . '</a>';
|
200 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
201 |
}
|
202 |
}
|
includes/public/shortcodes/recipe/class-wprm-sc-print.php
CHANGED
@@ -189,7 +189,7 @@ class WPRM_SC_Print extends WPRM_Template_Shortcode {
|
|
189 |
$aria_label = ' aria-label="' . __( 'Print Recipe', 'wp-recipe-maker' ) . '"';
|
190 |
}
|
191 |
|
192 |
-
$output = '<a href="' . $recipe->print_url( $template ) . '" style="' . $style . '" class="' . implode( ' ', $classes ) . '" data-recipe-id="' . esc_attr( $recipe->id() ) . '" data-template="' . esc_attr( $template ) . '"' . $target . ' rel="nofollow"' . $aria_label . '>' . $icon . $text . '</a>';
|
193 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
194 |
}
|
195 |
}
|
189 |
$aria_label = ' aria-label="' . __( 'Print Recipe', 'wp-recipe-maker' ) . '"';
|
190 |
}
|
191 |
|
192 |
+
$output = '<a href="' . esc_attr( $recipe->print_url( $template ) ) . '" style="' . esc_attr( $style ) . '" class="' . esc_attr( implode( ' ', $classes ) ) . '" data-recipe-id="' . esc_attr( $recipe->id() ) . '" data-template="' . esc_attr( $template ) . '"' . $target . ' rel="nofollow"' . $aria_label . '>' . $icon . esc_html( $text ) . '</a>';
|
193 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
194 |
}
|
195 |
}
|
includes/public/shortcodes/recipe/class-wprm-sc-rating.php
CHANGED
@@ -153,7 +153,7 @@ class WPRM_SC_Rating extends WPRM_Template_Shortcode {
|
|
153 |
// Add custom class if set.
|
154 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
155 |
|
156 |
-
$output .= '<div class="' . implode( ' ', $classes ) . '">' . WPRM_Rating::get_formatted_rating( $rating, $decimals ) . '</div>';
|
157 |
} elseif ( 'average' === $atts['display'] ) {
|
158 |
$classes = array(
|
159 |
'wprm-recipe-rating-average',
|
@@ -163,7 +163,7 @@ class WPRM_SC_Rating extends WPRM_Template_Shortcode {
|
|
163 |
// Add custom class if set.
|
164 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
165 |
|
166 |
-
$output .= '<div class="' . implode( ' ', $classes ) . '">' . $formatted_average . '</div>';
|
167 |
} elseif ( 'count' === $atts['display'] ) {
|
168 |
$classes = array(
|
169 |
'wprm-recipe-rating-count',
|
@@ -173,7 +173,7 @@ class WPRM_SC_Rating extends WPRM_Template_Shortcode {
|
|
173 |
// Add custom class if set.
|
174 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
175 |
|
176 |
-
$output .= '<div class="' . implode( ' ', $classes ) . '">' . $rating['count'] . '</div>';
|
177 |
}
|
178 |
|
179 |
$output .= '</div>';
|
@@ -199,8 +199,8 @@ class WPRM_SC_Rating extends WPRM_Template_Shortcode {
|
|
199 |
|
200 |
// Backwards compatibility.
|
201 |
$voteable = (bool) $atts['voteable'];
|
202 |
-
$icon = $atts['icon'];
|
203 |
-
$color = $atts['icon_color'];
|
204 |
|
205 |
// Only output when there is an actual rating or users can rate.
|
206 |
if ( $rating_value ) {
|
@@ -238,7 +238,7 @@ class WPRM_SC_Rating extends WPRM_Template_Shortcode {
|
|
238 |
}
|
239 |
|
240 |
// Output stars.
|
241 |
-
$output .= '<div id="' . $id . '" class="' . implode( ' ', $classes ) . '">';
|
242 |
for ( $i = 1; $i <= 5; $i++ ) {
|
243 |
// Get star class.
|
244 |
if ( $i <= $rating_value ) {
|
@@ -258,7 +258,7 @@ class WPRM_SC_Rating extends WPRM_Template_Shortcode {
|
|
258 |
}
|
259 |
}
|
260 |
|
261 |
-
$output .= '<span class="wprm-rating-star wprm-rating-star-' . $i . ' ' . $class . '" data-rating="' . $i . '" data-color="' . $color . '">';
|
262 |
$output .= apply_filters( 'wprm_recipe_rating_star_icon', WPRM_Icon::get( $icon, $color) );
|
263 |
$output .= '</span>';
|
264 |
}
|
153 |
// Add custom class if set.
|
154 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
155 |
|
156 |
+
$output .= '<div class="' . esc_attr( implode( ' ', $classes ) ) . '">' . WPRM_Rating::get_formatted_rating( $rating, $decimals ) . '</div>';
|
157 |
} elseif ( 'average' === $atts['display'] ) {
|
158 |
$classes = array(
|
159 |
'wprm-recipe-rating-average',
|
163 |
// Add custom class if set.
|
164 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
165 |
|
166 |
+
$output .= '<div class="' . esc_attr( implode( ' ', $classes ) ) . '">' . $formatted_average . '</div>';
|
167 |
} elseif ( 'count' === $atts['display'] ) {
|
168 |
$classes = array(
|
169 |
'wprm-recipe-rating-count',
|
173 |
// Add custom class if set.
|
174 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
175 |
|
176 |
+
$output .= '<div class="' . esc_attr( implode( ' ', $classes ) ) . '">' . $rating['count'] . '</div>';
|
177 |
}
|
178 |
|
179 |
$output .= '</div>';
|
199 |
|
200 |
// Backwards compatibility.
|
201 |
$voteable = (bool) $atts['voteable'];
|
202 |
+
$icon = esc_attr( $atts['icon'] );
|
203 |
+
$color = esc_attr( $atts['icon_color'] );
|
204 |
|
205 |
// Only output when there is an actual rating or users can rate.
|
206 |
if ( $rating_value ) {
|
238 |
}
|
239 |
|
240 |
// Output stars.
|
241 |
+
$output .= '<div id="' . esc_attr( $id ) . '" class="' . esc_attr( implode( ' ', $classes ) ) . '">';
|
242 |
for ( $i = 1; $i <= 5; $i++ ) {
|
243 |
// Get star class.
|
244 |
if ( $i <= $rating_value ) {
|
258 |
}
|
259 |
}
|
260 |
|
261 |
+
$output .= '<span class="wprm-rating-star wprm-rating-star-' . $i . ' ' . esc_attr( $class ) . '" data-rating="' . esc_attr( $i ) . '" data-color="' . esc_attr( $color ) . '">';
|
262 |
$output .= apply_filters( 'wprm_recipe_rating_star_icon', WPRM_Icon::get( $icon, $color) );
|
263 |
$output .= '</span>';
|
264 |
}
|
includes/public/shortcodes/recipe/class-wprm-sc-roundup-link.php
CHANGED
@@ -168,7 +168,7 @@ class WPRM_SC_Roundup_Link extends WPRM_Template_Shortcode {
|
|
168 |
$text = __( $text, 'wp-recipe-maker' );
|
169 |
$text = apply_filters( 'wprm_recipe_roundup_link_text', $text );
|
170 |
|
171 |
-
$output = '<a href="' . esc_url( $recipe->permalink() ) . '" style="' . $style . '" class="' . implode( ' ', $classes ) . '"' . $target . $nofollow . ' aria-label="' . esc_attr( $recipe->name() ) . '">' . $icon . $text . '</a>';
|
172 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
173 |
}
|
174 |
}
|
168 |
$text = __( $text, 'wp-recipe-maker' );
|
169 |
$text = apply_filters( 'wprm_recipe_roundup_link_text', $text );
|
170 |
|
171 |
+
$output = '<a href="' . esc_url( $recipe->permalink() ) . '" style="' . esc_attr( $style ) . '" class="' . esc_attr( implode( ' ', $classes ) ) . '"' . $target . $nofollow . ' aria-label="' . esc_attr( $recipe->name() ) . '">' . $icon . esc_html( $text ) . '</a>';
|
172 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
173 |
}
|
174 |
}
|
includes/public/shortcodes/recipe/class-wprm-sc-servings-unit.php
CHANGED
@@ -58,7 +58,7 @@ class WPRM_SC_Servings_Unit extends WPRM_Template_Shortcode {
|
|
58 |
// Add custom class if set.
|
59 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
60 |
|
61 |
-
$output = '<span class="' . implode( ' ', $classes ) . '">' . $recipe->servings_unit() . '</span>';
|
62 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
63 |
}
|
64 |
}
|
58 |
// Add custom class if set.
|
59 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
60 |
|
61 |
+
$output = '<span class="' . esc_attr( implode( ' ', $classes ) ) . '">' . $recipe->servings_unit() . '</span>';
|
62 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
63 |
}
|
64 |
}
|
includes/public/shortcodes/recipe/class-wprm-sc-servings.php
CHANGED
@@ -86,7 +86,7 @@ class WPRM_SC_Servings extends WPRM_Template_Shortcode {
|
|
86 |
// Add custom class if set.
|
87 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
88 |
|
89 |
-
$output = '<span class="' . implode( ' ', $classes ) . '">' . $recipe->servings() . '</span>';
|
90 |
|
91 |
if ( (bool) $atts['label_container'] ) {
|
92 |
$unit = WPRM_SC_Servings_Unit::shortcode( $atts );
|
86 |
// Add custom class if set.
|
87 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
88 |
|
89 |
+
$output = '<span class="' . esc_attr( implode( ' ', $classes ) ) . '">' . $recipe->servings() . '</span>';
|
90 |
|
91 |
if ( (bool) $atts['label_container'] ) {
|
92 |
$unit = WPRM_SC_Servings_Unit::shortcode( $atts );
|
includes/public/shortcodes/recipe/class-wprm-sc-slickstream.php
CHANGED
@@ -197,9 +197,9 @@ class WPRM_SC_Slickstream extends WPRM_Template_Shortcode {
|
|
197 |
$aria_label_added = ' aria-label="' . __( 'Unsave from Slickstream', 'wp-recipe-maker' ) . '"';
|
198 |
}
|
199 |
|
200 |
-
$output .= '<a href="#" rel="nofollow noreferrer" style="' . $style . '" class="wprm-recipe-slickstream-not-saved ' . implode( ' ', $classes ) . '" data-recipe-id="' . esc_attr( $recipe->id() ) . '"' . $aria_label . '>' . $icon . $text . '</a>';
|
201 |
$style .= 'display: none;';
|
202 |
-
$output .= '<a href="#" rel="nofollow noreferrer" style="' . $style . '" class="wprm-recipe-slickstream-saved ' . implode( ' ', $classes ) . '" data-recipe-id="' . esc_attr( $recipe->id() ) . '"' . $aria_label_added . '>' . $icon_added . $text_added . '</a>';
|
203 |
|
204 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
205 |
}
|
197 |
$aria_label_added = ' aria-label="' . __( 'Unsave from Slickstream', 'wp-recipe-maker' ) . '"';
|
198 |
}
|
199 |
|
200 |
+
$output .= '<a href="#" rel="nofollow noreferrer" style="' . esc_attr( $style ) . '" class="wprm-recipe-slickstream-not-saved ' . esc_attr( implode( ' ', $classes ) ) . '" data-recipe-id="' . esc_attr( $recipe->id() ) . '"' . $aria_label . '>' . $icon . esc_html( $text ) . '</a>';
|
201 |
$style .= 'display: none;';
|
202 |
+
$output .= '<a href="#" rel="nofollow noreferrer" style="' . esc_attr( $style ) . '" class="wprm-recipe-slickstream-saved ' . esc_attr( implode( ' ', $classes ) ) . '" data-recipe-id="' . esc_attr( $recipe->id() ) . '"' . $aria_label_added . '>' . $icon_added . esc_html( $text_added ) . '</a>';
|
203 |
|
204 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
205 |
}
|
includes/public/shortcodes/recipe/class-wprm-sc-summary.php
CHANGED
@@ -59,7 +59,7 @@ class WPRM_SC_Summary extends WPRM_Template_Shortcode {
|
|
59 |
// Add custom class if set.
|
60 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
61 |
|
62 |
-
$output = '<div class="' . implode( ' ', $classes ) . '">' . do_shortcode( $summary ) . '</div>';
|
63 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
64 |
}
|
65 |
}
|
59 |
// Add custom class if set.
|
60 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
61 |
|
62 |
+
$output = '<div class="' . esc_attr( implode( ' ', $classes ) ) . '">' . do_shortcode( $summary ) . '</div>';
|
63 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
64 |
}
|
65 |
}
|
includes/public/shortcodes/recipe/class-wprm-sc-tag.php
CHANGED
@@ -101,7 +101,7 @@ class WPRM_SC_Tag extends WPRM_Template_Shortcode {
|
|
101 |
// Add custom class if set.
|
102 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
103 |
|
104 |
-
$output = '<span class="' . implode( ' ', $classes ) . '">';
|
105 |
|
106 |
foreach ( $terms as $index => $term ) {
|
107 |
if ( 0 !== $index ) {
|
101 |
// Add custom class if set.
|
102 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
103 |
|
104 |
+
$output = '<span class="' . esc_attr( implode( ' ', $classes ) ) . '">';
|
105 |
|
106 |
foreach ( $terms as $index => $term ) {
|
107 |
if ( 0 !== $index ) {
|
includes/public/shortcodes/recipe/class-wprm-sc-text-share.php
CHANGED
@@ -227,7 +227,7 @@ class WPRM_SC_Text_Share extends WPRM_Template_Shortcode {
|
|
227 |
$aria_label = ' aria-label="' . __( 'Share by Text', 'wp-recipe-maker' ) . '"';
|
228 |
}
|
229 |
|
230 |
-
$output = '<a href="' . $text_url . '" data-recipe="' . esc_attr( $recipe->id() ) . '" style="' . $style . '" class="' . implode( ' ', $classes ) . '" target="_blank" rel="nofollow"' . $aria_label . '>' . $icon . $text . '</a>';
|
231 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
232 |
}
|
233 |
}
|
227 |
$aria_label = ' aria-label="' . __( 'Share by Text', 'wp-recipe-maker' ) . '"';
|
228 |
}
|
229 |
|
230 |
+
$output = '<a href="' . esc_attr( $text_url ) . '" data-recipe="' . esc_attr( $recipe->id() ) . '" style="' . esc_attr( $style ) . '" class="' . esc_attr( implode( ' ', $classes ) ) . '" target="_blank" rel="nofollow"' . $aria_label . '>' . $icon . esc_html( $text ) . '</a>';
|
231 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
232 |
}
|
233 |
}
|
includes/public/shortcodes/recipe/class-wprm-sc-time.php
CHANGED
@@ -160,7 +160,7 @@ class WPRM_SC_Time extends WPRM_Template_Shortcode {
|
|
160 |
// Add custom class if set.
|
161 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
162 |
|
163 |
-
$output = '<span class="' . implode( ' ', $classes ) . '">' . $output . '</span>';
|
164 |
}
|
165 |
|
166 |
return $output;
|
160 |
// Add custom class if set.
|
161 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
162 |
|
163 |
+
$output = '<span class="' . esc_attr( implode( ' ', $classes ) ) . '">' . $output . '</span>';
|
164 |
}
|
165 |
|
166 |
return $output;
|
includes/public/shortcodes/recipe/class-wprm-sc-twitter-share.php
CHANGED
@@ -187,7 +187,7 @@ class WPRM_SC_Twitter_Share extends WPRM_Template_Shortcode {
|
|
187 |
$aria_label = ' aria-label="' . __( 'Share on Twitter', 'wp-recipe-maker' ) . '"';
|
188 |
}
|
189 |
|
190 |
-
$output = '<a href="' . $share_url . '" data-recipe="' . esc_attr( $recipe->id() ) . '" style="' . $style . '" class="' . implode( ' ', $classes ) . '" target="_blank" rel="nofollow noopener"' . $aria_label . '>' . $icon . $text . '</a>';
|
191 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
192 |
}
|
193 |
}
|
187 |
$aria_label = ' aria-label="' . __( 'Share on Twitter', 'wp-recipe-maker' ) . '"';
|
188 |
}
|
189 |
|
190 |
+
$output = '<a href="' . esc_attr( $share_url ) . '" data-recipe="' . esc_attr( $recipe->id() ) . '" style="' . esc_attr( $style ) . '" class="' . esc_attr( implode( ' ', $classes ) ) . '" target="_blank" rel="nofollow noopener"' . $aria_label . '>' . $icon . esc_html( $text ) . '</a>';
|
191 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
192 |
}
|
193 |
}
|
includes/public/shortcodes/recipe/class-wprm-sc-url.php
CHANGED
@@ -78,7 +78,7 @@ class WPRM_SC_Url extends WPRM_Template_Shortcode {
|
|
78 |
// Add custom class if set.
|
79 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
80 |
|
81 |
-
$tag =
|
82 |
|
83 |
// Text to show.
|
84 |
$text = $url;
|
@@ -112,10 +112,10 @@ class WPRM_SC_Url extends WPRM_Template_Shortcode {
|
|
112 |
$target = $recipe->parent_url_new_tab() ? ' target="_blank"' : '';
|
113 |
$nofollow = $recipe->parent_url_nofollow() ? ' rel="nofollow"' : '';
|
114 |
|
115 |
-
$text = '<a href="' . esc_url( $url ) . '"' . $target . $nofollow . '>' . $text . '</a>';
|
116 |
}
|
117 |
|
118 |
-
$output = '<' . $tag . ' class="' . implode( ' ', $classes ) . '">' . $text . '</' . $tag . '>';
|
119 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
120 |
}
|
121 |
}
|
78 |
// Add custom class if set.
|
79 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
80 |
|
81 |
+
$tag = sanitize_key( $atts['tag'] );
|
82 |
|
83 |
// Text to show.
|
84 |
$text = $url;
|
112 |
$target = $recipe->parent_url_new_tab() ? ' target="_blank"' : '';
|
113 |
$nofollow = $recipe->parent_url_nofollow() ? ' rel="nofollow"' : '';
|
114 |
|
115 |
+
$text = '<a href="' . esc_url( $url ) . '"' . $target . $nofollow . '>' . esc_html( $text ) . '</a>';
|
116 |
}
|
117 |
|
118 |
+
$output = '<' . $tag . ' class="' . esc_attr( implode( ' ', $classes ) ) . '">' . $text . '</' . $tag . '>';
|
119 |
return apply_filters( parent::get_hook(), $output, $atts, $recipe );
|
120 |
}
|
121 |
}
|
includes/public/shortcodes/recipe/class-wprm-sc-video.php
CHANGED
@@ -56,7 +56,7 @@ class WPRM_SC_Video extends WPRM_Template_Shortcode {
|
|
56 |
// Add custom class if set.
|
57 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
58 |
|
59 |
-
$output = '<div id="wprm-recipe-video-container-' . $recipe->id() . '" class="' . implode( ' ', $classes ) . '">';
|
60 |
$output .= WPRM_Shortcode_Helper::get_section_header( $atts, 'video' );
|
61 |
|
62 |
$output .= '<div class="wprm-recipe-video">' . do_shortcode( $recipe->video() ) . '</div>';
|
56 |
// Add custom class if set.
|
57 |
if ( $atts['class'] ) { $classes[] = esc_attr( $atts['class'] ); }
|
58 |
|
59 |
+
$output = '<div id="wprm-recipe-video-container-' . esc_attr( $recipe->id() ) . '" class="' . esc_attr( implode( ' ', $classes ) ) . '">';
|
60 |
$output .= WPRM_Shortcode_Helper::get_section_header( $atts, 'video' );
|
61 |
|
62 |
$output .= '<div class="wprm-recipe-video">' . do_shortcode( $recipe->video() ) . '</div>';
|
news.json
CHANGED
@@ -1,5 +1,23 @@
|
|
1 |
{
|
2 |
"news": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
{
|
4 |
"date": "2022-11-14",
|
5 |
"label": "Release",
|
1 |
{
|
2 |
"news": [
|
3 |
+
{
|
4 |
+
"date": "2022-12-09",
|
5 |
+
"label": "Blog",
|
6 |
+
"title": "How to Make Cooking Videos At Home (Step-by-Step)",
|
7 |
+
"url": "https://bootstrapped.ventures/how-to-make-cooking-videos/"
|
8 |
+
},
|
9 |
+
{
|
10 |
+
"date": "2022-12-01",
|
11 |
+
"label": "Blog",
|
12 |
+
"title": "How To Write an Introduction Page For Your Food Blog",
|
13 |
+
"url": "https://bootstrapped.ventures/food-blog-introduction-sample/"
|
14 |
+
},
|
15 |
+
{
|
16 |
+
"date": "2022-11-23",
|
17 |
+
"label": "Blog",
|
18 |
+
"title": "How to Make the Most of Your Food Blog with Recipe Videos",
|
19 |
+
"url": "https://bootstrapped.ventures/how-to-make-a-food-video/"
|
20 |
+
},
|
21 |
{
|
22 |
"date": "2022-11-14",
|
23 |
"label": "Release",
|
readme.txt
CHANGED
@@ -136,6 +136,12 @@ Yes! We pride ourselves on offering awesome support and almost always answer sup
|
|
136 |
6. Fully compatible with the Classic Editor.
|
137 |
|
138 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
= 8.6.0 =
|
140 |
* Feature: Add Recipe Roundup Item widgets in Elementor
|
141 |
* Improvement: Match exact ID when searching for recipes
|
@@ -1429,6 +1435,9 @@ Yes! We pride ourselves on offering awesome support and almost always answer sup
|
|
1429 |
* Feature: Fallback recipe when the plugin is disabled
|
1430 |
|
1431 |
== Upgrade notice ==
|
|
|
|
|
|
|
1432 |
= 8.6.0 =
|
1433 |
Some quality of life improvements and better Elementor compatibility
|
1434 |
|
136 |
6. Fully compatible with the Classic Editor.
|
137 |
|
138 |
== Changelog ==
|
139 |
+
= 8.6.1 =
|
140 |
+
* Feature: Author schema integration with Yoast SEO
|
141 |
+
* Improvement: FlyingPress compatibility for comment ratings
|
142 |
+
* Fix: Sanitizing shortcode input correctly
|
143 |
+
* Fix: Deprecation warning because of add_submenu_page
|
144 |
+
|
145 |
= 8.6.0 =
|
146 |
* Feature: Add Recipe Roundup Item widgets in Elementor
|
147 |
* Improvement: Match exact ID when searching for recipes
|
1435 |
* Feature: Fallback recipe when the plugin is disabled
|
1436 |
|
1437 |
== Upgrade notice ==
|
1438 |
+
= 8.6.1 =
|
1439 |
+
Security fix update
|
1440 |
+
|
1441 |
= 8.6.0 =
|
1442 |
Some quality of life improvements and better Elementor compatibility
|
1443 |
|
templates/public/print.php
CHANGED
@@ -84,7 +84,10 @@
|
|
84 |
$classes = isset( $output['classes'] ) ? $output['classes'] : array();
|
85 |
|
86 |
echo '<div id="wprm-print-content" class="' . implode( ' ', $classes ) . '">';
|
87 |
-
|
|
|
|
|
|
|
88 |
echo '</div>';
|
89 |
?>
|
90 |
<?php
|
84 |
$classes = isset( $output['classes'] ) ? $output['classes'] : array();
|
85 |
|
86 |
echo '<div id="wprm-print-content" class="' . implode( ' ', $classes ) . '">';
|
87 |
+
|
88 |
+
$html = do_shortcode( $output['html'] );
|
89 |
+
echo apply_filters( 'wprm_print_output_html', $html );
|
90 |
+
|
91 |
echo '</div>';
|
92 |
?>
|
93 |
<?php
|
wp-recipe-maker.php
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* Plugin Name: WP Recipe Maker
|
16 |
* Plugin URI: http://bootstrapped.ventures/wp-recipe-maker/
|
17 |
* Description: The easy and user-friendly recipe plugin for everyone. Automatic JSON-LD metadata for better SEO will get you more visitors!
|
18 |
-
* Version: 8.6.
|
19 |
* Author: Bootstrapped Ventures
|
20 |
* Author URI: http://bootstrapped.ventures/
|
21 |
* License: GPL-2.0+
|
15 |
* Plugin Name: WP Recipe Maker
|
16 |
* Plugin URI: http://bootstrapped.ventures/wp-recipe-maker/
|
17 |
* Description: The easy and user-friendly recipe plugin for everyone. Automatic JSON-LD metadata for better SEO will get you more visitors!
|
18 |
+
* Version: 8.6.1
|
19 |
* Author: Bootstrapped Ventures
|
20 |
* Author URI: http://bootstrapped.ventures/
|
21 |
* License: GPL-2.0+
|