Version Description
- Feature: Show recipe rating on manage page
- Feature: Remove inline metadata for recipes, using JSON-LD metadata only now
- Feature: Present multiple image sizes to Google in the metadata
- Feature: Setting to opt out of Pinterest Rich Pins
- Feature: Import from FoodiePress
- Improvement: Top margin for nutrition label inside recipe box
- Improvement: Don't fill in serving unit automatically when empty
- Fix: Correct font from settings applied to Tastefully Simple template
Download this release
Release Info
Developer | BrechtVds |
Plugin | WP Recipe Maker |
Version | 1.25.0 |
Comparing to | |
See all releases |
Code changes from version 1.24.0 to 1.25.0
- assets/css/admin/manage.min.css +1 -1
- assets/css/admin/manage.scss +5 -0
- assets/css/public/_template_reset.scss +4 -0
- assets/css/public/public.min.css +1 -1
- assets/js/admin/manage.js +3 -3
- includes/admin/class-wprm-giveaway.php +4 -4
- includes/admin/class-wprm-import-manager.php +17 -0
- includes/admin/class-wprm-migrations.php +3 -0
- includes/admin/import/class-wprm-import-foodiepress.php +427 -0
- includes/admin/manage/class-wprm-manage-recipes.php +30 -0
- includes/admin/manage/class-wprm-manage.php +7 -0
- includes/admin/migrations/wprm-1-25-0-metadata.php +16 -0
- includes/class-wp-recipe-maker.php +1 -1
- includes/public/class-wprm-metadata.php +42 -1
- includes/public/class-wprm-recipe.php +19 -3
- includes/public/class-wprm-settings.php +3 -0
- includes/public/class-wprm-template-helper.php +2 -18
- includes/public/class-wprm-template-manager.php +2 -0
- readme.txt +15 -1
- templates/admin/manage/recipes.php +1 -0
- templates/admin/menu/faq/whats_new.php +19 -0
- templates/admin/settings/advanced.php +17 -0
- templates/recipe/simple/simple.php +9 -15
- templates/recipe/tastefully-simple/tastefully-simple.min.css +1 -1
- templates/recipe/tastefully-simple/tastefully-simple.php +9 -15
- templates/recipe/tastefully-simple/tastefully-simple.scss +5 -1
- wp-recipe-maker.php +1 -1
assets/css/admin/manage.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.wprm-manage .dataTables_wrapper,.wprm-manage .wprm-manage-header{margin-top:20px}.wprm-manage .wprm-manage-recipes-filters .select2_wprm-container,.wprm-manage .wprm-manage-recipes-filters .wprm-manage-recipes-filter{margin-left:5px;z-index:100}.wprm-manage .wprm-manage-datatable{display:none}.wprm-manage .wprm-manage-datatable .wprm-icon{cursor:pointer;color:#444}.wprm-manage .dataTables_wrapper .wprm-manage-datatable{display:table}.wprm-manage .wprm-manage-recipes-seo{margin:0 auto;width:15px;height:15px;border:1px solid #444;border-radius:50%}.wprm-manage .wprm-manage-recipes-seo.wprm-manage-recipes-seo-bad{background-color:#e74c3c}.wprm-manage .wprm-manage-recipes-seo.wprm-manage-recipes-seo-warning{background-color:#e67e22}.wprm-manage .wprm-manage-recipes-seo.wprm-manage-recipes-seo-rating{background-color:#f1c40f}.wprm-manage .wprm-manage-recipes-seo.wprm-manage-recipes-seo-good{background-color:#27ae60}.wprm-manage .wprm-manage-recipes-seo:hover{cursor:pointer}.wprm-manage .wprm-manage-recipes-seo-tooltip{display:none}.wprm-manage-custom-taxonomies-actions-tooltip,.wprm-manage-ingredients-actions-tooltip,.wprm-manage-recipes-actions-tooltip,.wprm-manage-taxonomies-actions-tooltip{text-align:right;min-width:250px;min-height:70px;font-size:14px}.wprm-manage-custom-taxonomies-actions-tooltip .tooltip-header,.wprm-manage-ingredients-actions-tooltip .tooltip-header,.wprm-manage-recipes-actions-tooltip .tooltip-header,.wprm-manage-taxonomies-actions-tooltip .tooltip-header{margin-bottom:5px;font-weight:700}.wprm-manage-custom-taxonomies-actions-tooltip a,.wprm-manage-ingredients-actions-tooltip a,.wprm-manage-recipes-actions-tooltip a,.wprm-manage-taxonomies-actions-tooltip a{color:#fff;display:block;text-decoration:none}.wprm-manage-custom-taxonomies-actions-tooltip a:hover,.wprm-manage-ingredients-actions-tooltip a:hover,.wprm-manage-recipes-actions-tooltip a:hover,.wprm-manage-taxonomies-actions-tooltip a:hover{text-decoration:underline}
|
1 |
+
.wprm-manage .dataTables_wrapper,.wprm-manage .wprm-manage-header{margin-top:20px}.wprm-manage .wprm-manage-recipes-filters .select2_wprm-container,.wprm-manage .wprm-manage-recipes-filters .wprm-manage-recipes-filter{margin-left:5px;z-index:100;max-width:100%}.wprm-manage .wprm-manage-datatable{display:none}.wprm-manage .wprm-manage-datatable .wprm-icon{cursor:pointer;color:#444}.wprm-manage .dataTables_wrapper .wprm-manage-datatable{display:table}.wprm-manage .wprm-manage-recipes-rating-details{font-size:.7em}.wprm-manage .wprm-manage-recipes-seo{margin:0 auto;width:15px;height:15px;border:1px solid #444;border-radius:50%}.wprm-manage .wprm-manage-recipes-seo.wprm-manage-recipes-seo-bad{background-color:#e74c3c}.wprm-manage .wprm-manage-recipes-seo.wprm-manage-recipes-seo-warning{background-color:#e67e22}.wprm-manage .wprm-manage-recipes-seo.wprm-manage-recipes-seo-rating{background-color:#f1c40f}.wprm-manage .wprm-manage-recipes-seo.wprm-manage-recipes-seo-good{background-color:#27ae60}.wprm-manage .wprm-manage-recipes-seo:hover{cursor:pointer}.wprm-manage .wprm-manage-recipes-seo-tooltip{display:none}.wprm-manage-custom-taxonomies-actions-tooltip,.wprm-manage-ingredients-actions-tooltip,.wprm-manage-recipes-actions-tooltip,.wprm-manage-taxonomies-actions-tooltip{text-align:right;min-width:250px;min-height:70px;font-size:14px}.wprm-manage-custom-taxonomies-actions-tooltip .tooltip-header,.wprm-manage-ingredients-actions-tooltip .tooltip-header,.wprm-manage-recipes-actions-tooltip .tooltip-header,.wprm-manage-taxonomies-actions-tooltip .tooltip-header{margin-bottom:5px;font-weight:700}.wprm-manage-custom-taxonomies-actions-tooltip a,.wprm-manage-ingredients-actions-tooltip a,.wprm-manage-recipes-actions-tooltip a,.wprm-manage-taxonomies-actions-tooltip a{color:#fff;display:block;text-decoration:none}.wprm-manage-custom-taxonomies-actions-tooltip a:hover,.wprm-manage-ingredients-actions-tooltip a:hover,.wprm-manage-recipes-actions-tooltip a:hover,.wprm-manage-taxonomies-actions-tooltip a:hover{text-decoration:underline}
|
assets/css/admin/manage.scss
CHANGED
@@ -9,6 +9,7 @@
|
|
9 |
.select2_wprm-container {
|
10 |
margin-left: 5px;
|
11 |
z-index: 100;
|
|
|
12 |
}
|
13 |
}
|
14 |
|
@@ -29,6 +30,10 @@
|
|
29 |
}
|
30 |
}
|
31 |
|
|
|
|
|
|
|
|
|
32 |
.wprm-manage-recipes-seo {
|
33 |
margin: 0 auto;
|
34 |
width: 15px;
|
9 |
.select2_wprm-container {
|
10 |
margin-left: 5px;
|
11 |
z-index: 100;
|
12 |
+
max-width: 100%;
|
13 |
}
|
14 |
}
|
15 |
|
30 |
}
|
31 |
}
|
32 |
|
33 |
+
.wprm-manage-recipes-rating-details {
|
34 |
+
font-size: 0.7em;
|
35 |
+
}
|
36 |
+
|
37 |
.wprm-manage-recipes-seo {
|
38 |
margin: 0 auto;
|
39 |
width: 15px;
|
assets/css/public/_template_reset.scss
CHANGED
@@ -16,4 +16,8 @@
|
|
16 |
li:before {
|
17 |
display: none;
|
18 |
}
|
|
|
|
|
|
|
|
|
19 |
}
|
16 |
li:before {
|
17 |
display: none;
|
18 |
}
|
19 |
+
|
20 |
+
.wprm-nutrition-label {
|
21 |
+
margin-top: 10px;
|
22 |
+
}
|
23 |
}
|
assets/css/public/public.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.wprm-print .wprm-recipe-print,.wprm-print .wprm-unit-conversion-container,.wprm-recipe li:before{display:none}.comment-form-wprm-rating .wprm-rating-star{cursor:pointer}.wprm-rating-star svg{vertical-align:middle;width:16px;height:16px;margin:0}.wprm-rating-star.rated svg polygon{fill:#000}.wprm-print .wprm-recipe{max-width:750px;margin:0 auto}.wprm-recipe{overflow:auto;zoom:1}.wprm-recipe li,.wprm-recipe p{font-size:1em}.wprm-recipe li,.wprm-recipe li.wprm-recipe-instruction{list-style-position:outside}
|
1 |
+
.wprm-print .wprm-recipe-print,.wprm-print .wprm-unit-conversion-container,.wprm-recipe li:before{display:none}.comment-form-wprm-rating .wprm-rating-star{cursor:pointer}.wprm-rating-star svg{vertical-align:middle;width:16px;height:16px;margin:0}.wprm-rating-star.rated svg polygon{fill:#000}.wprm-print .wprm-recipe{max-width:750px;margin:0 auto}.wprm-recipe{overflow:auto;zoom:1}.wprm-recipe li,.wprm-recipe p{font-size:1em}.wprm-recipe li,.wprm-recipe li.wprm-recipe-instruction{list-style-position:outside}.wprm-recipe .wprm-nutrition-label{margin-top:10px}
|
assets/js/admin/manage.js
CHANGED
@@ -138,7 +138,7 @@ jQuery(document).ready(function($) {
|
|
138 |
|
139 |
// Add tooltips.
|
140 |
jQuery('.wprm-manage-ingredients-actions').tooltipster({
|
141 |
-
content: '<div class="wprm-manage-ingredients-actions-tooltip"
|
142 |
contentAsHTML: true,
|
143 |
functionBefore: function() {
|
144 |
var instances = jQuery.tooltipster.instances();
|
@@ -175,7 +175,7 @@ jQuery(document).ready(function($) {
|
|
175 |
});
|
176 |
|
177 |
jQuery('.wprm-manage-taxonomies-actions').tooltipster({
|
178 |
-
content: '<div class="wprm-manage-taxonomies-actions-tooltip"
|
179 |
contentAsHTML: true,
|
180 |
functionBefore: function() {
|
181 |
var instances = jQuery.tooltipster.instances();
|
@@ -206,7 +206,7 @@ jQuery(document).ready(function($) {
|
|
206 |
});
|
207 |
|
208 |
jQuery('.wprm-manage-recipes-actions').tooltipster({
|
209 |
-
content: '<div class="wprm-manage-recipes-actions-tooltip"
|
210 |
contentAsHTML: true,
|
211 |
functionBefore: function() {
|
212 |
var instances = jQuery.tooltipster.instances();
|
138 |
|
139 |
// Add tooltips.
|
140 |
jQuery('.wprm-manage-ingredients-actions').tooltipster({
|
141 |
+
content: '<div class="wprm-manage-ingredients-actions-tooltip">' + wprm_manage.tooltip.ingredients + '</div>',
|
142 |
contentAsHTML: true,
|
143 |
functionBefore: function() {
|
144 |
var instances = jQuery.tooltipster.instances();
|
175 |
});
|
176 |
|
177 |
jQuery('.wprm-manage-taxonomies-actions').tooltipster({
|
178 |
+
content: '<div class="wprm-manage-taxonomies-actions-tooltip">' + wprm_manage.tooltip.taxonomies + '</div>',
|
179 |
contentAsHTML: true,
|
180 |
functionBefore: function() {
|
181 |
var instances = jQuery.tooltipster.instances();
|
206 |
});
|
207 |
|
208 |
jQuery('.wprm-manage-recipes-actions').tooltipster({
|
209 |
+
content: '<div class="wprm-manage-recipes-actions-tooltip">' + wprm_manage.tooltip.recipes + '</div>',
|
210 |
contentAsHTML: true,
|
211 |
functionBefore: function() {
|
212 |
var instances = jQuery.tooltipster.instances();
|
includes/admin/class-wprm-giveaway.php
CHANGED
@@ -26,8 +26,8 @@ class WPRM_Giveaway {
|
|
26 |
*/
|
27 |
public static function init() {
|
28 |
$now = new DateTime();
|
29 |
-
$giveaway_start = new DateTime( '2017-
|
30 |
-
$giveaway_end = new DateTime( '2017-
|
31 |
|
32 |
if ( $giveaway_start < $now && $now < $giveaway_end ) {
|
33 |
add_action( 'admin_menu', array( __CLASS__, 'add_submenu_page' ), 99 );
|
@@ -52,7 +52,7 @@ class WPRM_Giveaway {
|
|
52 |
public static function page_template() {
|
53 |
echo '<div class="wrap">';
|
54 |
echo '<h1>Plugin Giveaway</h1>';
|
55 |
-
echo '<a class="e-widget no-button" href="https://gleam.io/
|
56 |
echo '<script type="text/javascript" src="https://js.gleam.io/e.js" async="true"></script>';
|
57 |
echo '</div>';
|
58 |
}
|
@@ -65,7 +65,7 @@ class WPRM_Giveaway {
|
|
65 |
public static function modal_notice() {
|
66 |
if ( ! WPRM_Addons::is_active( 'premium' ) ) {
|
67 |
echo '<div class="wprm-giveaway-notice">';
|
68 |
-
echo '<strong>Feeling lucky?</strong> Win plugins in our <a href="' . esc_url( admin_url( 'admin.php?page=wprm_giveaway' ) ) . '" target="_blank">
|
69 |
echo '</div>';
|
70 |
}
|
71 |
}
|
26 |
*/
|
27 |
public static function init() {
|
28 |
$now = new DateTime();
|
29 |
+
$giveaway_start = new DateTime( '2017-11-16 10:00:00', new DateTimeZone( 'Europe/Brussels' ) );
|
30 |
+
$giveaway_end = new DateTime( '2017-11-24 10:00:00', new DateTimeZone( 'Europe/Brussels' ) );
|
31 |
|
32 |
if ( $giveaway_start < $now && $now < $giveaway_end ) {
|
33 |
add_action( 'admin_menu', array( __CLASS__, 'add_submenu_page' ), 99 );
|
52 |
public static function page_template() {
|
53 |
echo '<div class="wrap">';
|
54 |
echo '<h1>Plugin Giveaway</h1>';
|
55 |
+
echo '<a class="e-widget no-button" href="https://gleam.io/dY9yY/black-friday-2017" rel="nofollow">Black Friday Giveaway 2017</a>';
|
56 |
echo '<script type="text/javascript" src="https://js.gleam.io/e.js" async="true"></script>';
|
57 |
echo '</div>';
|
58 |
}
|
65 |
public static function modal_notice() {
|
66 |
if ( ! WPRM_Addons::is_active( 'premium' ) ) {
|
67 |
echo '<div class="wprm-giveaway-notice">';
|
68 |
+
echo '<strong>Feeling lucky?</strong> Win plugins in our <a href="' . esc_url( admin_url( 'admin.php?page=wprm_giveaway' ) ) . '" target="_blank">Black Friday Giveaway</a>!';
|
69 |
echo '</div>';
|
70 |
}
|
71 |
}
|
includes/admin/class-wprm-import-manager.php
CHANGED
@@ -19,6 +19,15 @@
|
|
19 |
*/
|
20 |
class WPRM_Import_Manager {
|
21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
/**
|
23 |
* Importers that can be used to import recipes from other sources.
|
24 |
*
|
@@ -106,6 +115,14 @@ class WPRM_Import_Manager {
|
|
106 |
$importer = self::get_importer( $importer_uid );
|
107 |
|
108 |
if ( $importer && count( $recipes ) > 0 ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
wp_localize_script( 'wprm-import', 'wprm_import', array(
|
110 |
'importer_uid' => $importer_uid,
|
111 |
'post_data' => $_POST,
|
19 |
*/
|
20 |
class WPRM_Import_Manager {
|
21 |
|
22 |
+
/**
|
23 |
+
* Only to be enabled when debugging the import.
|
24 |
+
*
|
25 |
+
* @since 1.25.0
|
26 |
+
* @access private
|
27 |
+
* @var boolean $debugging Wether or not we are debugging the import.
|
28 |
+
*/
|
29 |
+
private static $debugging = false;
|
30 |
+
|
31 |
/**
|
32 |
* Importers that can be used to import recipes from other sources.
|
33 |
*
|
115 |
$importer = self::get_importer( $importer_uid );
|
116 |
|
117 |
if ( $importer && count( $recipes ) > 0 ) {
|
118 |
+
// Only when debugging.
|
119 |
+
if ( self::$debugging ) {
|
120 |
+
$result = self::import_recipes( $importer, $recipes, $_POST ); // Input var okay.
|
121 |
+
var_dump( $result );
|
122 |
+
die();
|
123 |
+
}
|
124 |
+
|
125 |
+
// Import recipes via AJAX.
|
126 |
wp_localize_script( 'wprm-import', 'wprm_import', array(
|
127 |
'importer_uid' => $importer_uid,
|
128 |
'post_data' => $_POST,
|
includes/admin/class-wprm-migrations.php
CHANGED
@@ -58,6 +58,9 @@ class WPRM_Migrations {
|
|
58 |
if ( version_compare( $migrated_to_version, '1.23.0' ) < 0 ) {
|
59 |
require_once( WPRM_DIR . 'includes/admin/migrations/wprm-1-23-0-categories.php' );
|
60 |
}
|
|
|
|
|
|
|
61 |
|
62 |
if ( '0.0.0' === $migrated_to_version ) {
|
63 |
self::$notices = array();
|
58 |
if ( version_compare( $migrated_to_version, '1.23.0' ) < 0 ) {
|
59 |
require_once( WPRM_DIR . 'includes/admin/migrations/wprm-1-23-0-categories.php' );
|
60 |
}
|
61 |
+
if ( version_compare( $migrated_to_version, '1.25.0' ) < 0 ) {
|
62 |
+
require_once( WPRM_DIR . 'includes/admin/migrations/wprm-1-25-0-metadata.php' );
|
63 |
+
}
|
64 |
|
65 |
if ( '0.0.0' === $migrated_to_version ) {
|
66 |
self::$notices = array();
|
includes/admin/import/class-wprm-import-foodiepress.php
ADDED
@@ -0,0 +1,427 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* FoodiePress importer.
|
4 |
+
*
|
5 |
+
* @link http://bootstrapped.ventures
|
6 |
+
* @since 1.25.0
|
7 |
+
*
|
8 |
+
* @package WP_Recipe_Maker
|
9 |
+
* @subpackage WP_Recipe_Maker/includes/admin/import
|
10 |
+
*/
|
11 |
+
|
12 |
+
/**
|
13 |
+
* FoodiePress importer.
|
14 |
+
*
|
15 |
+
* @since 1.25.0
|
16 |
+
* @package WP_Recipe_Maker
|
17 |
+
* @subpackage WP_Recipe_Maker/includes/admin/import
|
18 |
+
* @author Brecht Vandersmissen <brecht@bootstrapped.ventures>
|
19 |
+
*/
|
20 |
+
class WPRM_Import_Foodiepress extends WPRM_Import {
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Get the UID of this import source.
|
24 |
+
*
|
25 |
+
* @since 1.25.0
|
26 |
+
*/
|
27 |
+
public function get_uid() {
|
28 |
+
return 'foodiepress';
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Wether or not this importer requires a manual search for recipes.
|
33 |
+
*
|
34 |
+
* @since 1.25.0
|
35 |
+
*/
|
36 |
+
public function requires_search() {
|
37 |
+
return false;
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Get the name of this import source.
|
42 |
+
*
|
43 |
+
* @since 1.25.0
|
44 |
+
*/
|
45 |
+
public function get_name() {
|
46 |
+
return 'FoodiePress';
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Get HTML for the import settings.
|
51 |
+
*
|
52 |
+
* @since 1.25.0
|
53 |
+
*/
|
54 |
+
public function get_settings_html() {
|
55 |
+
return '';
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Get the total number of recipes to import.
|
60 |
+
*
|
61 |
+
* @since 1.25.0
|
62 |
+
*/
|
63 |
+
public function get_recipe_count() {
|
64 |
+
$args = array(
|
65 |
+
'post_type' => 'post',
|
66 |
+
'post_status' => 'any',
|
67 |
+
'posts_per_page' => 1,
|
68 |
+
'meta_query' => array(
|
69 |
+
array(
|
70 |
+
'key' => 'cookingpressingridients',
|
71 |
+
'compare' => '!=',
|
72 |
+
'value' => 'a:0:{}',
|
73 |
+
),
|
74 |
+
),
|
75 |
+
);
|
76 |
+
|
77 |
+
$query = new WP_Query( $args );
|
78 |
+
return $query->found_posts;
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Get a list of recipes that are available to import.
|
83 |
+
*
|
84 |
+
* @since 1.25.0
|
85 |
+
* @param int $page Page of recipes to get.
|
86 |
+
*/
|
87 |
+
public function get_recipes( $page = 0 ) {
|
88 |
+
$recipes = array();
|
89 |
+
|
90 |
+
$limit = 100;
|
91 |
+
$offset = $limit * $page;
|
92 |
+
|
93 |
+
$args = array(
|
94 |
+
'post_type' => 'post',
|
95 |
+
'post_status' => 'any',
|
96 |
+
'meta_query' => array(
|
97 |
+
array(
|
98 |
+
'key' => 'cookingpressingridients',
|
99 |
+
'compare' => '!=',
|
100 |
+
'value' => 'a:0:{}',
|
101 |
+
),
|
102 |
+
),
|
103 |
+
'orderby' => 'date',
|
104 |
+
'order' => 'DESC',
|
105 |
+
'posts_per_page' => $limit,
|
106 |
+
'offset' => $offset,
|
107 |
+
);
|
108 |
+
|
109 |
+
$query = new WP_Query( $args );
|
110 |
+
|
111 |
+
if ( $query->have_posts() ) {
|
112 |
+
$posts = $query->posts;
|
113 |
+
|
114 |
+
foreach ( $posts as $post ) {
|
115 |
+
$recipes[ $post->ID ] = array(
|
116 |
+
'name' => $post->post_title,
|
117 |
+
'url' => get_edit_post_link( $post->ID ),
|
118 |
+
);
|
119 |
+
}
|
120 |
+
}
|
121 |
+
|
122 |
+
return $recipes;
|
123 |
+
}
|
124 |
+
|
125 |
+
/**
|
126 |
+
* Get recipe with the specified ID in the import format.
|
127 |
+
*
|
128 |
+
* @since 1.25.0
|
129 |
+
* @param mixed $id ID of the recipe we want to import.
|
130 |
+
* @param array $post_data POST data passed along when submitting the form.
|
131 |
+
*/
|
132 |
+
public function get_recipe( $id, $post_data ) {
|
133 |
+
$recipe = array(
|
134 |
+
'import_id' => 0,
|
135 |
+
'import_backup' => array(
|
136 |
+
'foodiepress_post_id' => intval( $id ),
|
137 |
+
),
|
138 |
+
);
|
139 |
+
|
140 |
+
$post = get_post( $id );
|
141 |
+
$post_meta = get_post_custom( $id );
|
142 |
+
|
143 |
+
// Take over these fields.
|
144 |
+
$recipe['name'] = $post_meta['cookingpresstitle'][0];
|
145 |
+
$recipe['summary'] = $post_meta['cookingpresssummary'][0];
|
146 |
+
$recipe['image_id'] = intval( $post_meta['cookingpressphoto'][0] );
|
147 |
+
|
148 |
+
// Servings.
|
149 |
+
$foodiepress_recipe_options = maybe_unserialize( $post_meta['cookingpressrecipeoptions'][0] );
|
150 |
+
$foodiepress_yield = $foodiepress_recipe_options[2];
|
151 |
+
|
152 |
+
$match = preg_match( '/^\s*\d+/', $foodiepress_yield, $servings_array );
|
153 |
+
if ( 1 === $match ) {
|
154 |
+
$servings = str_replace( ' ','', $servings_array[0] );
|
155 |
+
} else {
|
156 |
+
$servings = '';
|
157 |
+
}
|
158 |
+
|
159 |
+
$servings_unit = preg_replace( '/^\s*\d+\s*/', '', $foodiepress_yield );
|
160 |
+
|
161 |
+
$recipe['servings'] = $servings;
|
162 |
+
$recipe['servings_unit'] = $servings_unit;
|
163 |
+
|
164 |
+
// Recipe Times.
|
165 |
+
$recipe['prep_time'] = intval( $foodiepress_recipe_options[0] );
|
166 |
+
$recipe['cook_time'] = intval( $foodiepress_recipe_options[1] );
|
167 |
+
$recipe['total_time'] = $recipe['prep_time'] + $recipe['cook_time'];
|
168 |
+
|
169 |
+
// Recipe Ingredients.
|
170 |
+
$ingredients = maybe_unserialize( $post_meta['cookingpressingridients'][0] );
|
171 |
+
$recipe['ingredients'] = array();
|
172 |
+
|
173 |
+
$current_group = array(
|
174 |
+
'name' => '',
|
175 |
+
'ingredients' => array(),
|
176 |
+
);
|
177 |
+
foreach ( $ingredients as $ingredient ) {
|
178 |
+
if ( isset( $ingredient['note'] ) && 'separator' === $ingredient['note'] ) {
|
179 |
+
$recipe['ingredients'][] = $current_group;
|
180 |
+
$current_group = array(
|
181 |
+
'name' => $ingredient['name'],
|
182 |
+
'ingredients' => array(),
|
183 |
+
);
|
184 |
+
} else {
|
185 |
+
$current_group['ingredients'][] = array(
|
186 |
+
'raw' => $ingredient['note'] . ' ' . $ingredient['name'],
|
187 |
+
);
|
188 |
+
}
|
189 |
+
}
|
190 |
+
$recipe['ingredients'][] = $current_group;
|
191 |
+
|
192 |
+
// Instructions.
|
193 |
+
$foodiepress_instructions = $this->parse_recipe_component_list( $post_meta['cookingpressinstructions'][0] );
|
194 |
+
|
195 |
+
$instructions = array();
|
196 |
+
|
197 |
+
foreach ( $foodiepress_instructions as $foodiepress_group ) {
|
198 |
+
$group = array(
|
199 |
+
'name' => $foodiepress_group['name'],
|
200 |
+
'instructions' => array(),
|
201 |
+
);
|
202 |
+
|
203 |
+
foreach ( $foodiepress_group['items'] as $foodiepress_item ) {
|
204 |
+
$text = trim( strip_tags( $foodiepress_item ) );
|
205 |
+
|
206 |
+
// Find any images.
|
207 |
+
preg_match_all( '/<img[^>]+>/i', $foodiepress_item, $img_tags );
|
208 |
+
|
209 |
+
foreach ( $img_tags as $img_tag ) {
|
210 |
+
if ( isset( $img_tag[0] ) ) {
|
211 |
+
preg_match_all( '/src="([^"]*)"/i', $img_tag[0], $img );
|
212 |
+
|
213 |
+
if ( $img[1] ) {
|
214 |
+
$img_src = $img[1][0];
|
215 |
+
$image_id = $this->get_or_upload_attachment( $id, $img_src );
|
216 |
+
|
217 |
+
if ( $image_id ) {
|
218 |
+
$group['instructions'][] = array(
|
219 |
+
'text' => $text,
|
220 |
+
'image' => $image_id,
|
221 |
+
);
|
222 |
+
$text = ''; // Only add same text once.
|
223 |
+
}
|
224 |
+
}
|
225 |
+
}
|
226 |
+
}
|
227 |
+
|
228 |
+
if ( ! empty( $text ) ) {
|
229 |
+
$group['instructions'][] = array(
|
230 |
+
'text' => $text,
|
231 |
+
);
|
232 |
+
}
|
233 |
+
}
|
234 |
+
|
235 |
+
$instructions[] = $group;
|
236 |
+
}
|
237 |
+
$recipe['instructions'] = $instructions;
|
238 |
+
|
239 |
+
// Nutrition Facts.
|
240 |
+
$nutrition = maybe_unserialize( $post_meta['cookingpressntfacts'][0] );
|
241 |
+
|
242 |
+
$recipe['nutrition'] = array(
|
243 |
+
'serving_size' => $nutrition['servingSize'],
|
244 |
+
'calories' => $nutrition['calories'],
|
245 |
+
'carbohydrates' => $nutrition['carbohydrateContent'],
|
246 |
+
'protein' => $nutrition['proteinContent'],
|
247 |
+
'fat' => $nutrition['fatContent'],
|
248 |
+
'saturated_fat' => $nutrition['saturatedFatContent'],
|
249 |
+
'polyunsaturated_fat' => $nutrition['unsaturatedFatContent'],
|
250 |
+
'monounsaturated_fat' => '',
|
251 |
+
'trans_fat' => $nutrition['transFatContent'],
|
252 |
+
'cholesterol' => $nutrition['cholesterolContent'],
|
253 |
+
'sodium' => $nutrition['sodiumContent'],
|
254 |
+
'potassium' => '',
|
255 |
+
'fiber' => $nutrition['fiberContent'],
|
256 |
+
'sugar' => $nutrition['sugarContent'],
|
257 |
+
'vitamin_a' => '',
|
258 |
+
'vitamin_c' => '',
|
259 |
+
'calcium' => '',
|
260 |
+
'iron' => '',
|
261 |
+
);
|
262 |
+
|
263 |
+
return $recipe;
|
264 |
+
}
|
265 |
+
|
266 |
+
/**
|
267 |
+
* Replace the original recipe with the newly imported WPRM one.
|
268 |
+
*
|
269 |
+
* @since 1.25.0
|
270 |
+
* @param mixed $id ID of the recipe we want replace.
|
271 |
+
* @param mixed $wprm_id ID of the WPRM recipe to replace with.
|
272 |
+
* @param array $post_data POST data passed along when submitting the form.
|
273 |
+
*/
|
274 |
+
public function replace_recipe( $id, $wprm_id, $post_data ) {
|
275 |
+
$post = get_post( $id );
|
276 |
+
|
277 |
+
// Hide Foodiepress.
|
278 |
+
$ingredients = get_post_meta( $id, 'cookingpressingridients', true );
|
279 |
+
add_post_meta( $id, 'cookingpressingridients_bkp', $ingredients );
|
280 |
+
delete_post_meta( $id, 'cookingpressingridients' );
|
281 |
+
|
282 |
+
// Update or add shortcode.
|
283 |
+
$content = $post->post_content;
|
284 |
+
|
285 |
+
if ( 0 === substr_count( $content, '[foodiepress]' ) ) {
|
286 |
+
$content .= ' [wprm-recipe id="' . $wprm_id . '"]';
|
287 |
+
} else {
|
288 |
+
$content = str_ireplace( '[foodiepress]', '[wprm-recipe id="' . $wprm_id . '"]', $content );
|
289 |
+
}
|
290 |
+
|
291 |
+
$update_content = array(
|
292 |
+
'ID' => $id,
|
293 |
+
'post_type' => 'post',
|
294 |
+
'post_content' => $content,
|
295 |
+
);
|
296 |
+
wp_update_post( $update_content );
|
297 |
+
}
|
298 |
+
|
299 |
+
/**
|
300 |
+
* Blob to array.
|
301 |
+
*
|
302 |
+
* @since 1.25.0
|
303 |
+
* @param mixed $component Component to parse.
|
304 |
+
*/
|
305 |
+
private function parse_recipe_component_list( $component ) {
|
306 |
+
$component_list = array();
|
307 |
+
$component_group = array(
|
308 |
+
'name' => '',
|
309 |
+
'items' => array(),
|
310 |
+
);
|
311 |
+
|
312 |
+
$bits = explode( PHP_EOL, $component );
|
313 |
+
foreach ( $bits as $bit ) {
|
314 |
+
|
315 |
+
$test_bit = trim( $bit );
|
316 |
+
if ( empty( $test_bit ) ) {
|
317 |
+
continue;
|
318 |
+
}
|
319 |
+
if ( $this->is_heading( $bit ) ) {
|
320 |
+
$component_list[] = $component_group;
|
321 |
+
|
322 |
+
$component_group = array(
|
323 |
+
'name' => strip_tags( trim( $bit ) ),
|
324 |
+
'items' => array(),
|
325 |
+
);
|
326 |
+
} else {
|
327 |
+
$component_group['items'][] = trim( $bit );
|
328 |
+
}
|
329 |
+
}
|
330 |
+
|
331 |
+
$component_list[] = $component_group;
|
332 |
+
|
333 |
+
return $component_list;
|
334 |
+
}
|
335 |
+
|
336 |
+
/**
|
337 |
+
* Check if line is heading.
|
338 |
+
*
|
339 |
+
* @since 1.25.0
|
340 |
+
* @param mixed $string String to parse.
|
341 |
+
*/
|
342 |
+
private function is_heading( $string ) {
|
343 |
+
$string = trim( $string );
|
344 |
+
// For The Red Beans:.
|
345 |
+
if ( ':' === substr( $string, -1, 1 ) ) {
|
346 |
+
return true;
|
347 |
+
}
|
348 |
+
// <strong>For The Red Beans</strong>.
|
349 |
+
if ( '<strong>' === substr( $string, 0, 8 ) && '</strong>' === substr( $string, -9, 9 ) ) {
|
350 |
+
return true;
|
351 |
+
}
|
352 |
+
// <h3>For The Red Beans</h3>.
|
353 |
+
if ( preg_match( '#^<h[1-6]>.+<\/h[1-6]>$#', $string ) ) {
|
354 |
+
return true;
|
355 |
+
}
|
356 |
+
return false;
|
357 |
+
}
|
358 |
+
|
359 |
+
/**
|
360 |
+
* Get image attachment ID from a given URL or sideload the image if not on the website.
|
361 |
+
*
|
362 |
+
* @since 1.23.0
|
363 |
+
* @param int $post_id Post to associate the image with.
|
364 |
+
* @param mixed $url Image URL.
|
365 |
+
*/
|
366 |
+
private function get_or_upload_attachment( $post_id, $url ) {
|
367 |
+
$url = str_replace( array( "\n", "\t", "\r" ), '', $url );
|
368 |
+
$image_id = $this->get_attachment_id_from_url( $url );
|
369 |
+
|
370 |
+
if ( $image_id ) {
|
371 |
+
return $image_id;
|
372 |
+
} else {
|
373 |
+
$media = media_sideload_image( $url, $post_id );
|
374 |
+
|
375 |
+
$attachments = get_posts( array(
|
376 |
+
'numberposts' => '1',
|
377 |
+
'post_parent' => $post_id,
|
378 |
+
'post_type' => 'attachment',
|
379 |
+
'post_mime_type' => 'image',
|
380 |
+
'orderby' => 'post_date',
|
381 |
+
'order' => 'DESC',
|
382 |
+
)
|
383 |
+
);
|
384 |
+
|
385 |
+
if ( count( $attachments ) > 0 ) {
|
386 |
+
return $attachments[0]->ID;
|
387 |
+
}
|
388 |
+
}
|
389 |
+
|
390 |
+
return false;
|
391 |
+
}
|
392 |
+
|
393 |
+
/**
|
394 |
+
* Get image attachment ID from a given URL.
|
395 |
+
* Source: https://philipnewcomer.net/2012/11/get-the-attachment-id-from-an-image-url-in-wordpress/
|
396 |
+
*
|
397 |
+
* @since 1.23.0
|
398 |
+
* @param mixed $attachment_url Image URL.
|
399 |
+
*/
|
400 |
+
private function get_attachment_id_from_url( $attachment_url = '' ) {
|
401 |
+
global $wpdb;
|
402 |
+
$attachment_id = false;
|
403 |
+
|
404 |
+
// If there is no url, return.
|
405 |
+
if ( '' === $attachment_url ) {
|
406 |
+
return;
|
407 |
+
}
|
408 |
+
|
409 |
+
// Get the upload directory paths.
|
410 |
+
$upload_dir_paths = wp_upload_dir();
|
411 |
+
|
412 |
+
// Make sure the upload path base directory exists in the attachment URL, to verify that we're working with a media library image.
|
413 |
+
if ( false !== strpos( $attachment_url, $upload_dir_paths['baseurl'] ) ) {
|
414 |
+
|
415 |
+
// If this is the URL of an auto-generated thumbnail, get the URL of the original image.
|
416 |
+
$attachment_url = preg_replace( '/-\d+x\d+(?=\.(jpg|jpeg|png|gif)$)/i', '', $attachment_url );
|
417 |
+
|
418 |
+
// Remove the upload path base directory from the attachment URL.
|
419 |
+
$attachment_url = str_replace( $upload_dir_paths['baseurl'] . '/', '', $attachment_url );
|
420 |
+
|
421 |
+
// Finally, run a custom database query to get the attachment ID from the modified attachment URL.
|
422 |
+
$attachment_id = $wpdb->get_var( $wpdb->prepare( "SELECT wposts.ID FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta WHERE wposts.ID = wpostmeta.post_id AND wpostmeta.meta_key = '_wp_attached_file' AND wpostmeta.meta_value = '%s' AND wposts.post_type = 'attachment'", $attachment_url ) ); // @codingStandardsIgnoreLine
|
423 |
+
}
|
424 |
+
|
425 |
+
return $attachment_id;
|
426 |
+
}
|
427 |
+
}
|
includes/admin/manage/class-wprm-manage-recipes.php
CHANGED
@@ -76,6 +76,12 @@ class WPRM_Manage_Recipes {
|
|
76 |
's' => $search,
|
77 |
);
|
78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
$query = new WP_Query( $args );
|
80 |
|
81 |
$posts = $query->posts;
|
@@ -89,6 +95,29 @@ class WPRM_Manage_Recipes {
|
|
89 |
$parent_post_link = '';
|
90 |
}
|
91 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
// Recipe SEO.
|
93 |
$seo = WPRM_Seo_Checker::check_recipe( $recipe );
|
94 |
|
@@ -97,6 +126,7 @@ class WPRM_Manage_Recipes {
|
|
97 |
get_the_date( 'Y/m/d', $recipe->id() ),
|
98 |
'<span id="wprm-manage-recipes-name-' . esc_attr( $recipe->id() ) . '">' . $recipe->name() . '</span>',
|
99 |
$parent_post_link,
|
|
|
100 |
'<div class="wprm-manage-recipes-seo wprm-manage-recipes-seo-' . esc_attr( $seo['type'] ) . '" data-tooltip-content="#wprm-manage-recipes-seo-' . esc_attr( $recipe->id() ) . '" data-id="' . esc_attr( $recipe->id() ) . '"></div><span class="wprm-manage-recipes-seo-tooltip" id="wprm-manage-recipes-seo-' . esc_attr( $recipe->id() ) . '">' . $seo['message'] . '</span>',
|
101 |
'<span class="dashicons dashicons-admin-tools wprm-icon wprm-manage-recipes-actions" data-id="' . esc_attr( $recipe->id() ) . '"></span>',
|
102 |
);
|
76 |
's' => $search,
|
77 |
);
|
78 |
|
79 |
+
// Order by rating.
|
80 |
+
if ( 4 === $datatable['orderby'] ) {
|
81 |
+
$args['orderby'] = 'meta_value_num';
|
82 |
+
$args['meta_key'] = 'wprm_rating_average';
|
83 |
+
}
|
84 |
+
|
85 |
$query = new WP_Query( $args );
|
86 |
|
87 |
$posts = $query->posts;
|
95 |
$parent_post_link = '';
|
96 |
}
|
97 |
|
98 |
+
// Comment rating.
|
99 |
+
$comment_rating = '';
|
100 |
+
if ( $recipe->parent_post_id() && WPRM_Settings::get( 'features_comment_ratings' ) ) {
|
101 |
+
$count = 0;
|
102 |
+
$total = 0;
|
103 |
+
|
104 |
+
$comments = get_approved_comments( $recipe->parent_post_id() );
|
105 |
+
|
106 |
+
foreach ( $comments as $comment ) {
|
107 |
+
$rating = intval( get_comment_meta( $comment->comment_ID, 'wprm-comment-rating', true ) );
|
108 |
+
|
109 |
+
if ( $rating ) {
|
110 |
+
$count++;
|
111 |
+
$total += $rating;
|
112 |
+
}
|
113 |
+
}
|
114 |
+
|
115 |
+
if ( $count ) {
|
116 |
+
$average = ceil( $total / $count * 100 ) / 100;
|
117 |
+
$comment_rating = $average . ' <span class="wprm-manage-recipes-rating-details">(' . $count . ' ' . _n( 'comment', 'comments', $count, 'wp-recipe-maker' ) . ')</span>';
|
118 |
+
}
|
119 |
+
}
|
120 |
+
|
121 |
// Recipe SEO.
|
122 |
$seo = WPRM_Seo_Checker::check_recipe( $recipe );
|
123 |
|
126 |
get_the_date( 'Y/m/d', $recipe->id() ),
|
127 |
'<span id="wprm-manage-recipes-name-' . esc_attr( $recipe->id() ) . '">' . $recipe->name() . '</span>',
|
128 |
$parent_post_link,
|
129 |
+
$comment_rating,
|
130 |
'<div class="wprm-manage-recipes-seo wprm-manage-recipes-seo-' . esc_attr( $seo['type'] ) . '" data-tooltip-content="#wprm-manage-recipes-seo-' . esc_attr( $recipe->id() ) . '" data-id="' . esc_attr( $recipe->id() ) . '"></div><span class="wprm-manage-recipes-seo-tooltip" id="wprm-manage-recipes-seo-' . esc_attr( $recipe->id() ) . '">' . $seo['message'] . '</span>',
|
131 |
'<span class="dashicons dashicons-admin-tools wprm-icon wprm-manage-recipes-actions" data-id="' . esc_attr( $recipe->id() ) . '"></span>',
|
132 |
);
|
includes/admin/manage/class-wprm-manage.php
CHANGED
@@ -58,6 +58,11 @@ class WPRM_Manage {
|
|
58 |
wp_localize_script( 'wprm-manage', 'wprm_manage', array(
|
59 |
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
60 |
'nonce' => wp_create_nonce( 'wprm' ),
|
|
|
|
|
|
|
|
|
|
|
61 |
));
|
62 |
}
|
63 |
}
|
@@ -343,6 +348,8 @@ class WPRM_Manage {
|
|
343 |
$data = WPRM_Manage_Taxonomies::get_datatable( $datatable, $taxonomy );
|
344 |
}
|
345 |
|
|
|
|
|
346 |
echo wp_json_encode( $data );
|
347 |
}
|
348 |
|
58 |
wp_localize_script( 'wprm-manage', 'wprm_manage', array(
|
59 |
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
60 |
'nonce' => wp_create_nonce( 'wprm' ),
|
61 |
+
'tooltip' => array(
|
62 |
+
'recipes' => apply_filters( 'wprm_manage_datatable_tooltip', '<div class="tooltip-header"> </div><a href="#" class="wprm-manage-recipes-actions-edit">Edit Recipe</a><a href="#" class="wprm-manage-recipes-actions-delete">Delete Recipe</a>', 'recipes' ),
|
63 |
+
'ingredients' => apply_filters( 'wprm_manage_datatable_tooltip', '<div class="tooltip-header"> </div><a href="#" class="wprm-manage-ingredients-actions-rename">Rename Ingredient</a><a href="#" class="wprm-manage-ingredients-actions-link">Edit Ingredient Link</a><a href="#" class="wprm-manage-ingredients-actions-merge">Merge into Another Ingredient</a><a href="#" class="wprm-manage-ingredients-actions-delete">Delete Ingredient</a>', 'ingredients' ),
|
64 |
+
'taxonomies' => apply_filters( 'wprm_manage_datatable_tooltip', '<div class="tooltip-header"> </div><a href="#" class="wprm-manage-taxonomies-actions-rename">Rename Term</a><a href="#" class="wprm-manage-taxonomies-actions-merge">Merge into Another Term</a><a href="#" class="wprm-manage-taxonomies-actions-delete">Delete Term</a>', 'taxonomies' ),
|
65 |
+
),
|
66 |
));
|
67 |
}
|
68 |
}
|
348 |
$data = WPRM_Manage_Taxonomies::get_datatable( $datatable, $taxonomy );
|
349 |
}
|
350 |
|
351 |
+
$data = apply_filters( 'wprm_manage_datatable_data', $data, $table );
|
352 |
+
|
353 |
echo wp_json_encode( $data );
|
354 |
}
|
355 |
|
includes/admin/migrations/wprm-1-25-0-metadata.php
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Notice about removing the inline metadata.
|
4 |
+
*
|
5 |
+
* @link http://bootstrapped.ventures
|
6 |
+
* @since 1.25.0
|
7 |
+
*
|
8 |
+
* @package WP_Recipe_Maker
|
9 |
+
* @subpackage WP_Recipe_Maker/includes/admin/migrations
|
10 |
+
*/
|
11 |
+
|
12 |
+
$notice = 'We removed inline metadata from our default templates and only use JSON-LD now.<br/>';
|
13 |
+
$notice .= 'If you are using a custom template you should consider removing the inline metadata there as well.<br/>';
|
14 |
+
$notice .= 'Those who prefer using both JSON-LD and inline metadata can add it in their own <a href="https://bootstrapped.ventures/wp-recipe-maker/create-your-own-template/" target="_blank">custom template</a>.';
|
15 |
+
|
16 |
+
self::$notices[] = $notice;
|
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', '1.
|
35 |
define( 'WPRM_PREMIUM_VERSION_REQUIRED', '1.6.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', '1.25.0' );
|
35 |
define( 'WPRM_PREMIUM_VERSION_REQUIRED', '1.6.0' );
|
36 |
define( 'WPRM_POST_TYPE', 'wprm_recipe' );
|
37 |
define( 'WPRM_DIR', plugin_dir_path( dirname( __FILE__ ) ) );
|
includes/public/class-wprm-metadata.php
CHANGED
@@ -25,6 +25,36 @@ class WPRM_Metadata {
|
|
25 |
* @since 1.0.0
|
26 |
*/
|
27 |
public static function init() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
}
|
29 |
|
30 |
/**
|
@@ -73,10 +103,21 @@ class WPRM_Metadata {
|
|
73 |
'name' => $recipe->author_meta(),
|
74 |
),
|
75 |
'datePublished' => $recipe->date(),
|
76 |
-
'image' => $recipe->image_url( 'full' ),
|
77 |
'description' => wp_strip_all_tags( $recipe->summary() ),
|
78 |
);
|
79 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
// Yield.
|
81 |
if ( $recipe->servings() ) {
|
82 |
$metadata['recipeYield'] = $recipe->servings() . ' ' . $recipe->servings_unit();
|
25 |
* @since 1.0.0
|
26 |
*/
|
27 |
public static function init() {
|
28 |
+
add_action( 'wp_head', array( __CLASS__, 'metadata_in_head' ), 1 );
|
29 |
+
add_action( 'after_setup_theme', array( __CLASS__, 'metadata_image_sizes' ) );
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Output metadata in the HTML head.
|
34 |
+
*
|
35 |
+
* @since 1.25.0
|
36 |
+
*/
|
37 |
+
public static function metadata_in_head() {
|
38 |
+
if ( WPRM_Settings::get( 'metadata_pinterest_optout' ) ) {
|
39 |
+
echo '<meta name="pinterest-rich-pin" content="false" />';
|
40 |
+
}
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Register image sizes for the recipe metadata.
|
45 |
+
*
|
46 |
+
* @since 1.25.0
|
47 |
+
*/
|
48 |
+
public static function metadata_image_sizes() {
|
49 |
+
if ( function_exists( 'fly_add_image_size' ) ) {
|
50 |
+
fly_add_image_size( 'wprm-metadata-1_1', 500, 500, true );
|
51 |
+
fly_add_image_size( 'wprm-metadata-4_3', 500, 375, true );
|
52 |
+
fly_add_image_size( 'wprm-metadata-16_9', 480, 270, true );
|
53 |
+
} else {
|
54 |
+
add_image_size( 'wprm-metadata-1_1', 500, 500, true );
|
55 |
+
add_image_size( 'wprm-metadata-4_3', 500, 375, true );
|
56 |
+
add_image_size( 'wprm-metadata-16_9', 480, 270, true );
|
57 |
+
}
|
58 |
}
|
59 |
|
60 |
/**
|
103 |
'name' => $recipe->author_meta(),
|
104 |
),
|
105 |
'datePublished' => $recipe->date(),
|
|
|
106 |
'description' => wp_strip_all_tags( $recipe->summary() ),
|
107 |
);
|
108 |
|
109 |
+
// Recipe image.
|
110 |
+
if ( $recipe->image_id() ) {
|
111 |
+
$image_sizes = array(
|
112 |
+
$recipe->image_url( 'full' ),
|
113 |
+
$recipe->image_url( 'wprm-metadata-1_1' ),
|
114 |
+
$recipe->image_url( 'wprm-metadata-4_3' ),
|
115 |
+
$recipe->image_url( 'wprm-metadata-16_9' ),
|
116 |
+
);
|
117 |
+
|
118 |
+
$metadata['image'] = array_unique( $image_sizes );
|
119 |
+
}
|
120 |
+
|
121 |
// Yield.
|
122 |
if ( $recipe->servings() ) {
|
123 |
$metadata['recipeYield'] = $recipe->servings() . ' ' . $recipe->servings_unit();
|
includes/public/class-wprm-recipe.php
CHANGED
@@ -273,7 +273,13 @@ class WPRM_Recipe {
|
|
273 |
* @param mixed $size Thumbnail name or size array of the image we want.
|
274 |
*/
|
275 |
public function image_data( $size = 'thumbnail' ) {
|
276 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
277 |
}
|
278 |
|
279 |
/**
|
@@ -304,8 +310,18 @@ class WPRM_Recipe {
|
|
304 |
* @param mixed $size Thumbnail name or size array of the image we want.
|
305 |
*/
|
306 |
public function image_url( $size = 'thumbnail' ) {
|
307 |
-
$
|
308 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
309 |
|
310 |
return $image_url;
|
311 |
}
|
273 |
* @param mixed $size Thumbnail name or size array of the image we want.
|
274 |
*/
|
275 |
public function image_data( $size = 'thumbnail' ) {
|
276 |
+
if ( function_exists( 'fly_get_attachment_image_src' ) ) {
|
277 |
+
$thumb = fly_get_attachment_image_src( $this->image_id(), $size );
|
278 |
+
} else {
|
279 |
+
$thumb = wp_get_attachment_image_src( $this->image_id(), $size );
|
280 |
+
}
|
281 |
+
|
282 |
+
return $thumb;
|
283 |
}
|
284 |
|
285 |
/**
|
310 |
* @param mixed $size Thumbnail name or size array of the image we want.
|
311 |
*/
|
312 |
public function image_url( $size = 'thumbnail' ) {
|
313 |
+
$image_url = '';
|
314 |
+
|
315 |
+
if ( function_exists( 'fly_get_attachment_image_src' ) ) {
|
316 |
+
$thumb = fly_get_attachment_image_src( $this->image_id(), $size );
|
317 |
+
|
318 |
+
if ( $thumb ) {
|
319 |
+
$image_url = isset( $thumb[0] ) ? $thumb[0] : $thumb['src'];
|
320 |
+
}
|
321 |
+
} else {
|
322 |
+
$thumb = wp_get_attachment_image_src( $this->image_id(), $size );
|
323 |
+
$image_url = $thumb && isset( $thumb[0] ) ? $thumb[0] : '';
|
324 |
+
}
|
325 |
|
326 |
return $image_url;
|
327 |
}
|
includes/public/class-wprm-settings.php
CHANGED
@@ -70,6 +70,7 @@ class WPRM_Settings {
|
|
70 |
'features_adjustable_servings' => true,
|
71 |
'features_user_ratings' => false,
|
72 |
// Advanced.
|
|
|
73 |
'recipe_css' => '',
|
74 |
'print_css' => '',
|
75 |
);
|
@@ -384,11 +385,13 @@ class WPRM_Settings {
|
|
384 |
*/
|
385 |
public static function form_save_settings_advanced() {
|
386 |
if ( isset( $_POST['wprm_settings'] ) && wp_verify_nonce( sanitize_key( $_POST['wprm_settings'] ), 'wprm_settings' ) ) { // Input var okay.
|
|
|
387 |
$recipe_css = isset( $_POST['recipe_css'] ) ? wp_kses_post( wp_unslash( $_POST['recipe_css'] ) ) : ''; // Input var okay.
|
388 |
$print_css = isset( $_POST['print_css'] ) ? wp_kses_post( wp_unslash( $_POST['print_css'] ) ) : ''; // Input var okay.
|
389 |
|
390 |
$settings = array();
|
391 |
|
|
|
392 |
$settings['recipe_css'] = $recipe_css;
|
393 |
$settings['print_css'] = $print_css;
|
394 |
|
70 |
'features_adjustable_servings' => true,
|
71 |
'features_user_ratings' => false,
|
72 |
// Advanced.
|
73 |
+
'metadata_pinterest_optout' => false,
|
74 |
'recipe_css' => '',
|
75 |
'print_css' => '',
|
76 |
);
|
385 |
*/
|
386 |
public static function form_save_settings_advanced() {
|
387 |
if ( isset( $_POST['wprm_settings'] ) && wp_verify_nonce( sanitize_key( $_POST['wprm_settings'] ), 'wprm_settings' ) ) { // Input var okay.
|
388 |
+
$metadata_pinterest_optout = isset( $_POST['metadata_pinterest_optout'] ) && sanitize_key( $_POST['metadata_pinterest_optout'] ) ? true : false; // Input var okay.
|
389 |
$recipe_css = isset( $_POST['recipe_css'] ) ? wp_kses_post( wp_unslash( $_POST['recipe_css'] ) ) : ''; // Input var okay.
|
390 |
$print_css = isset( $_POST['print_css'] ) ? wp_kses_post( wp_unslash( $_POST['print_css'] ) ) : ''; // Input var okay.
|
391 |
|
392 |
$settings = array();
|
393 |
|
394 |
+
$settings['metadata_pinterest_optout'] = $metadata_pinterest_optout;
|
395 |
$settings['recipe_css'] = $recipe_css;
|
396 |
$settings['print_css'] = $print_css;
|
397 |
|
includes/public/class-wprm-template-helper.php
CHANGED
@@ -250,16 +250,7 @@ class WPRM_Template_Helper {
|
|
250 |
}
|
251 |
|
252 |
if ( $show_details ) {
|
253 |
-
|
254 |
-
$output .= '<div class="wprm-recipe-rating-details" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"><span class="wprm-recipe-rating-average" itemprop="ratingValue">' . $rating['average'] . '</span> ' . __( 'from', 'wp-recipe-maker' ) . ' <span class="wprm-recipe-rating-count" itemprop="ratingCount">' . $rating['count'] . '</span> ' . _n( 'vote', 'votes', $rating['count'], 'wp-recipe-maker' ) . '</div>';
|
255 |
-
} else {
|
256 |
-
$output .= '<div class="wprm-recipe-rating-details"><span class="wprm-recipe-rating-average">' . $rating['average'] . '</span> ' . __( 'from', 'wp-recipe-maker' ) . ' <span class="wprm-recipe-rating-count">' . $rating['count'] . '</span> ' . _n( 'vote', 'votes', $rating['count'], 'wp-recipe-maker' ) . '</div>';
|
257 |
-
}
|
258 |
-
} else {
|
259 |
-
$output .= '<div class="wprm-recipe-rating-details-meta" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">';
|
260 |
-
$output .= '<meta itemprop="ratingValue" content="' . $rating['average'] . '">';
|
261 |
-
$output .= '<meta itemprop="ratingCount" content="' . $rating['count'] . '">';
|
262 |
-
$output .= '</div>';
|
263 |
}
|
264 |
|
265 |
$output .= '</div>';
|
@@ -288,14 +279,7 @@ class WPRM_Template_Helper {
|
|
288 |
* @param mixed $key Tag we're adding the metadata for.
|
289 |
*/
|
290 |
public static function tags_meta( $key ) {
|
291 |
-
|
292 |
-
if ( 'course' === $key ) {
|
293 |
-
$meta = ' itemprop="recipeCategory"';
|
294 |
-
} elseif ( 'cuisine' === $key ) {
|
295 |
-
$meta = ' itemprop="recipeCuisine"';
|
296 |
-
}
|
297 |
-
|
298 |
-
return $meta;
|
299 |
}
|
300 |
|
301 |
/**
|
250 |
}
|
251 |
|
252 |
if ( $show_details ) {
|
253 |
+
$output .= '<div class="wprm-recipe-rating-details"><span class="wprm-recipe-rating-average">' . $rating['average'] . '</span> ' . __( 'from', 'wp-recipe-maker' ) . ' <span class="wprm-recipe-rating-count">' . $rating['count'] . '</span> ' . _n( 'vote', 'votes', $rating['count'], 'wp-recipe-maker' ) . '</div>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
254 |
}
|
255 |
|
256 |
$output .= '</div>';
|
279 |
* @param mixed $key Tag we're adding the metadata for.
|
280 |
*/
|
281 |
public static function tags_meta( $key ) {
|
282 |
+
return ''; // No inline metadata anymore.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
283 |
}
|
284 |
|
285 |
/**
|
includes/public/class-wprm-template-manager.php
CHANGED
@@ -67,6 +67,8 @@ class WPRM_Template_Manager {
|
|
67 |
}
|
68 |
if ( WPRM_Settings::get( 'template_font_regular' ) ) {
|
69 |
$output .= $selector . ' .wprm-recipe { font-family: ' . WPRM_Settings::get( 'template_font_regular' ) . '; }';
|
|
|
|
|
70 |
}
|
71 |
if ( WPRM_Settings::get( 'template_font_header' ) ) {
|
72 |
$output .= $selector . ' .wprm-recipe .wprm-recipe-name { font-family: ' . WPRM_Settings::get( 'template_font_header' ) . '; }';
|
67 |
}
|
68 |
if ( WPRM_Settings::get( 'template_font_regular' ) ) {
|
69 |
$output .= $selector . ' .wprm-recipe { font-family: ' . WPRM_Settings::get( 'template_font_regular' ) . '; }';
|
70 |
+
$output .= $selector . ' .wprm-recipe p { font-family: ' . WPRM_Settings::get( 'template_font_regular' ) . '; }';
|
71 |
+
$output .= $selector . ' .wprm-recipe li { font-family: ' . WPRM_Settings::get( 'template_font_regular' ) . '; }';
|
72 |
}
|
73 |
if ( WPRM_Settings::get( 'template_font_header' ) ) {
|
74 |
$output .= $selector . ' .wprm-recipe .wprm-recipe-name { font-family: ' . WPRM_Settings::get( 'template_font_header' ) . '; }';
|
readme.txt
CHANGED
@@ -22,7 +22,7 @@ An overview of WP Recipe Maker features:
|
|
22 |
|
23 |
* **Easy workflow** to add recipes to any post or page
|
24 |
* Uses schema.org/Recipe JSON-LD metadata optimised for **Google Recipe search**
|
25 |
-
*
|
26 |
* **Recipe ratings** in the user comments
|
27 |
* Clean **print recipe** version for your visitors with optional credit to your website
|
28 |
* **Fallback recipe** shows up when the plugin is disabled
|
@@ -67,6 +67,7 @@ Currently using another recipe plugin? No problem! You can easily migrate all yo
|
|
67 |
* Yummly
|
68 |
* Yumprint Recipe Card
|
69 |
* Tasty Recipes
|
|
|
70 |
* (More coming soon!)
|
71 |
|
72 |
This plugin is in active development. Feel free to contact us with any feature requests or ideas.
|
@@ -103,6 +104,16 @@ Yes! We pride ourselves on offering awesome support and almost always answer sup
|
|
103 |
|
104 |
== Changelog ==
|
105 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
= 1.24.0 =
|
107 |
* Improvement: Only show ratings given by an enabled feature
|
108 |
* Improvement: Import title in older versions of EasyRecipe recipes
|
@@ -356,6 +367,9 @@ Yes! We pride ourselves on offering awesome support and almost always answer sup
|
|
356 |
|
357 |
== Upgrade notice ==
|
358 |
|
|
|
|
|
|
|
359 |
= 1.24.0 =
|
360 |
Update to fix a few bugs
|
361 |
|
22 |
|
23 |
* **Easy workflow** to add recipes to any post or page
|
24 |
* Uses schema.org/Recipe JSON-LD metadata optimised for **Google Recipe search**
|
25 |
+
* Compatible with **Pinterest Rich Pins** and a setting to easily opt out
|
26 |
* **Recipe ratings** in the user comments
|
27 |
* Clean **print recipe** version for your visitors with optional credit to your website
|
28 |
* **Fallback recipe** shows up when the plugin is disabled
|
67 |
* Yummly
|
68 |
* Yumprint Recipe Card
|
69 |
* Tasty Recipes
|
70 |
+
* FoodiePress
|
71 |
* (More coming soon!)
|
72 |
|
73 |
This plugin is in active development. Feel free to contact us with any feature requests or ideas.
|
104 |
|
105 |
== Changelog ==
|
106 |
|
107 |
+
= 1.25.0 =
|
108 |
+
* Feature: Show recipe rating on manage page
|
109 |
+
* Feature: Remove inline metadata for recipes, using JSON-LD metadata only now
|
110 |
+
* Feature: Present multiple image sizes to Google in the metadata
|
111 |
+
* Feature: Setting to opt out of Pinterest Rich Pins
|
112 |
+
* Feature: Import from FoodiePress
|
113 |
+
* Improvement: Top margin for nutrition label inside recipe box
|
114 |
+
* Improvement: Don't fill in serving unit automatically when empty
|
115 |
+
* Fix: Correct font from settings applied to Tastefully Simple template
|
116 |
+
|
117 |
= 1.24.0 =
|
118 |
* Improvement: Only show ratings given by an enabled feature
|
119 |
* Improvement: Import title in older versions of EasyRecipe recipes
|
367 |
|
368 |
== Upgrade notice ==
|
369 |
|
370 |
+
= 1.25.0 =
|
371 |
+
Update to use the latest recipe metadata structure
|
372 |
+
|
373 |
= 1.24.0 =
|
374 |
Update to fix a few bugs
|
375 |
|
templates/admin/manage/recipes.php
CHANGED
@@ -40,6 +40,7 @@ foreach ( $taxonomies as $taxonomy => $labels ) {
|
|
40 |
<th>Date</th>
|
41 |
<th>Name</th>
|
42 |
<th data-sortable="false">Parent Post</th>
|
|
|
43 |
<th data-sortable="false" data-width="20px">SEO</th>
|
44 |
<th data-sortable="false" data-width="20px"> </th>
|
45 |
</tr>
|
40 |
<th>Date</th>
|
41 |
<th>Name</th>
|
42 |
<th data-sortable="false">Parent Post</th>
|
43 |
+
<th>Rating</th>
|
44 |
<th data-sortable="false" data-width="20px">SEO</th>
|
45 |
<th data-sortable="false" data-width="20px"> </th>
|
46 |
</tr>
|
templates/admin/menu/faq/whats_new.php
CHANGED
@@ -11,6 +11,25 @@
|
|
11 |
|
12 |
?>
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
<h3>2017-10-05 | WP Recipe Maker 1.24.0</h3>
|
15 |
<ul>
|
16 |
<li>Improvement: Only show ratings given by an enabled feature</li>
|
11 |
|
12 |
?>
|
13 |
|
14 |
+
<h3>2017-11-03 | WP Recipe Maker Premium 1.7.0</h3>
|
15 |
+
<ul>
|
16 |
+
<li>Feature: Show user and total ratings on the manage page</li>
|
17 |
+
<li>Feature: Reset user ratings on the manage page</li>
|
18 |
+
<li>Feature: Remove inline metadata from recipe templates</li>
|
19 |
+
</ul>
|
20 |
+
|
21 |
+
<h3>2017-11-03 | WP Recipe Maker 1.25.0</h3>
|
22 |
+
<ul>
|
23 |
+
<li>Feature: Show recipe rating on manage page</li>
|
24 |
+
<li>Feature: Remove inline metadata for recipes, using JSON-LD metadata only now</li>
|
25 |
+
<li>Feature: Present multiple image sizes to Google in the metadata</li>
|
26 |
+
<li>Feature: Setting to opt out of Pinterest Rich Pins</li>
|
27 |
+
<li>Feature: Import from FoodiePress</li>
|
28 |
+
<li>Improvement: Top margin for nutrition label inside recipe box</li>
|
29 |
+
<li>Improvement: Don't fill in serving unit automatically when empty</li>
|
30 |
+
<li>Fix: Correct font from settings applied to Tastefully Simple template</li>
|
31 |
+
</ul>
|
32 |
+
|
33 |
<h3>2017-10-05 | WP Recipe Maker 1.24.0</h3>
|
34 |
<ul>
|
35 |
<li>Improvement: Only show ratings given by an enabled feature</li>
|
templates/admin/settings/advanced.php
CHANGED
@@ -14,6 +14,23 @@
|
|
14 |
<form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>">
|
15 |
<input type="hidden" name="action" value="wprm_settings_advanced">
|
16 |
<?php wp_nonce_field( 'wprm_settings', 'wprm_settings', false ); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
<h2 class="title"><?php esc_html_e( 'Custom Styling', 'wp-recipe-maker' ); ?></h2>
|
18 |
<p>
|
19 |
<?php esc_html_e( 'Add your own CSS for styling the plugin.', 'wp-recipe-maker' ); ?>
|
14 |
<form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>">
|
15 |
<input type="hidden" name="action" value="wprm_settings_advanced">
|
16 |
<?php wp_nonce_field( 'wprm_settings', 'wprm_settings', false ); ?>
|
17 |
+
<h2 class="title"><?php esc_html_e( 'Metadata', 'wp-recipe-maker' ); ?></h2>
|
18 |
+
<table class="form-table">
|
19 |
+
<tbody>
|
20 |
+
<tr>
|
21 |
+
<th scope="row">
|
22 |
+
<?php esc_html_e( 'Opt out of Rich Pins', 'wp-recipe-maker' ); ?>
|
23 |
+
</th>
|
24 |
+
<td>
|
25 |
+
<label for="metadata_pinterest_optout">
|
26 |
+
<?php $checked = WPRM_Settings::get( 'metadata_pinterest_optout' ) ? ' checked="checked"' : ''; ?>
|
27 |
+
<input name="metadata_pinterest_optout" type="checkbox" id="metadata_pinterest_optout"<?php echo esc_html( $checked ); ?> />
|
28 |
+
<?php esc_html_e( 'Tell Pinterest NOT to display my pins as rich pins', 'wp-recipe-maker' ); ?>
|
29 |
+
</label>
|
30 |
+
</td>
|
31 |
+
</tr>
|
32 |
+
</tbody>
|
33 |
+
</table>
|
34 |
<h2 class="title"><?php esc_html_e( 'Custom Styling', 'wp-recipe-maker' ); ?></h2>
|
35 |
<p>
|
36 |
<?php esc_html_e( 'Add your own CSS for styling the plugin.', 'wp-recipe-maker' ); ?>
|
templates/recipe/simple/simple.php
CHANGED
@@ -11,10 +11,7 @@
|
|
11 |
|
12 |
// @codingStandardsIgnoreStart
|
13 |
?>
|
14 |
-
<div class="wprm-recipe wprm-recipe-simple"
|
15 |
-
<meta itemprop="author" content="<?php echo $recipe->author_meta(); ?>" />
|
16 |
-
<meta itemprop="datePublished" content="<?php echo $recipe->date(); ?>" />
|
17 |
-
<meta itemprop="image" content="<?php echo $recipe->image_url( 'full' ); ?>" />
|
18 |
<div class="wprm-recipe-image-container">
|
19 |
<div class="wprm-recipe-image"><?php echo WPRM_Template_Helper::recipe_image( $recipe, 'thumbnail' ); ?></div>
|
20 |
<div class="wprm-recipe-buttons">
|
@@ -22,8 +19,8 @@
|
|
22 |
<span class="wprm-recipe-print"><span class="wprm-recipe-details-icon"><?php include( WPRM_DIR . 'assets/icons/printer.svg' ); ?></span> <?php echo WPRM_Template_Helper::label( 'print_button' ); ?></span>
|
23 |
</div>
|
24 |
</div>
|
25 |
-
<h2 class="wprm-recipe-name"
|
26 |
-
<div class="wprm-recipe-summary"
|
27 |
<?php echo $recipe->summary(); ?>
|
28 |
</div>
|
29 |
<div class="wprm-recipe-details-container wprm-recipe-tags-container">
|
@@ -37,7 +34,7 @@
|
|
37 |
if ( count( $terms ) > 0 ) : ?>
|
38 |
<div class="wprm-recipe-<?php echo $key; ?>-container">
|
39 |
<span class="wprm-recipe-details-icon"><?php include( WPRM_DIR . 'assets/icons/tag.svg' ); ?></span> <span class="wprm-recipe-details-name wprm-recipe-<?php echo $key; ?>-name"><?php echo WPRM_Template_Helper::label( $key . '_tags', $options['singular_name'] ); ?></span>
|
40 |
-
<span class="wprm-recipe-<?php echo $key; ?>"
|
41 |
<?php foreach ( $terms as $index => $term ) {
|
42 |
if ( 0 !== $index ) {
|
43 |
echo ', ';
|
@@ -52,19 +49,16 @@
|
|
52 |
<div class="wprm-recipe-details-container wprm-recipe-times-container">
|
53 |
<?php if ( $recipe->prep_time() ) : ?>
|
54 |
<div class="wprm-recipe-prep-time-container">
|
55 |
-
<meta itemprop="prepTime" content="PT<?php echo $recipe->prep_time(); ?>M" />
|
56 |
<span class="wprm-recipe-details-icon"><?php include( WPRM_DIR . 'assets/icons/knife.svg' ); ?></span> <span class="wprm-recipe-details-name wprm-recipe-prep-time-name"><?php echo WPRM_Template_Helper::label( 'prep_time' ); ?></span> <?php echo $recipe->prep_time_formatted(); ?>
|
57 |
</div>
|
58 |
<?php endif; // Prep time. ?>
|
59 |
<?php if ( $recipe->cook_time() ) : ?>
|
60 |
<div class="wprm-recipe-cook-time-container">
|
61 |
-
<meta itemprop="cookTime" content="PT<?php echo $recipe->cook_time(); ?>M" />
|
62 |
<span class="wprm-recipe-details-icon"><?php include( WPRM_DIR . 'assets/icons/pan.svg' ); ?></span> <span class="wprm-recipe-details-name wprm-recipe-cook-time-name"><?php echo WPRM_Template_Helper::label( 'cook_time' ); ?></span> <?php echo $recipe->cook_time_formatted(); ?>
|
63 |
</div>
|
64 |
<?php endif; // Cook time. ?>
|
65 |
<?php if ( $recipe->total_time() ) : ?>
|
66 |
<div class="wprm-recipe-total-time-container">
|
67 |
-
<meta itemprop="totalTime" content="PT<?php echo $recipe->total_time(); ?>M" />
|
68 |
<span class="wprm-recipe-details-icon"><?php include( WPRM_DIR . 'assets/icons/clock.svg' ); ?></span> <span class="wprm-recipe-details-name wprm-recipe-total-time-name"><?php echo WPRM_Template_Helper::label( 'total_time' ); ?></span> <?php echo $recipe->total_time_formatted(); ?>
|
69 |
</div>
|
70 |
<?php endif; // Total time. ?>
|
@@ -72,12 +66,12 @@
|
|
72 |
<div class="wprm-recipe-details-container">
|
73 |
<?php if ( $recipe->servings() ) : ?>
|
74 |
<div class="wprm-recipe-servings-container">
|
75 |
-
<span class="wprm-recipe-details-icon"><?php include( WPRM_DIR . 'assets/icons/cutlery.svg' ); ?></span> <span class="wprm-recipe-details-name wprm-recipe-servings-name"><?php echo WPRM_Template_Helper::label( 'servings' ); ?></span> <span
|
76 |
</div>
|
77 |
<?php endif; // Servings. ?>
|
78 |
<?php if ( $recipe->calories() ) : ?>
|
79 |
-
<div class="wprm-recipe-calories-container"
|
80 |
-
<span class="wprm-recipe-details-icon"><?php include( WPRM_DIR . 'assets/icons/battery.svg' ); ?></span> <span class="wprm-recipe-details-name wprm-recipe-calories-name"><?php echo WPRM_Template_Helper::label( 'calories' ); ?></span> <span
|
81 |
</div>
|
82 |
<?php endif; // Calories. ?>
|
83 |
<?php if ( $recipe->author() ) : ?>
|
@@ -99,7 +93,7 @@
|
|
99 |
<?php endif; // Ingredient group name. ?>
|
100 |
<ul class="wprm-recipe-ingredients">
|
101 |
<?php foreach ( $ingredient_group['ingredients'] as $ingredient ) : ?>
|
102 |
-
<li class="wprm-recipe-ingredient"
|
103 |
<?php if ( $ingredient['amount'] ) : ?>
|
104 |
<span class="wprm-recipe-ingredient-amount"><?php echo $ingredient['amount']; ?></span>
|
105 |
<?php endif; // Ingredient amount. ?>
|
@@ -132,7 +126,7 @@
|
|
132 |
<?php foreach ( $instruction_group['instructions'] as $instruction ) : ?>
|
133 |
<li class="wprm-recipe-instruction">
|
134 |
<?php if ( $instruction['text'] ) : ?>
|
135 |
-
<div class="wprm-recipe-instruction-text"
|
136 |
<?php endif; // Instruction text. ?>
|
137 |
<?php if ( $instruction['image'] ) : ?>
|
138 |
<div class="wprm-recipe-instruction-image"><?php echo WPRM_Template_Helper::instruction_image( $instruction, 'thumbnail' ); ?></div>
|
11 |
|
12 |
// @codingStandardsIgnoreStart
|
13 |
?>
|
14 |
+
<div class="wprm-recipe wprm-recipe-simple">
|
|
|
|
|
|
|
15 |
<div class="wprm-recipe-image-container">
|
16 |
<div class="wprm-recipe-image"><?php echo WPRM_Template_Helper::recipe_image( $recipe, 'thumbnail' ); ?></div>
|
17 |
<div class="wprm-recipe-buttons">
|
19 |
<span class="wprm-recipe-print"><span class="wprm-recipe-details-icon"><?php include( WPRM_DIR . 'assets/icons/printer.svg' ); ?></span> <?php echo WPRM_Template_Helper::label( 'print_button' ); ?></span>
|
20 |
</div>
|
21 |
</div>
|
22 |
+
<h2 class="wprm-recipe-name"><?php echo $recipe->name(); ?></h2>
|
23 |
+
<div class="wprm-recipe-summary">
|
24 |
<?php echo $recipe->summary(); ?>
|
25 |
</div>
|
26 |
<div class="wprm-recipe-details-container wprm-recipe-tags-container">
|
34 |
if ( count( $terms ) > 0 ) : ?>
|
35 |
<div class="wprm-recipe-<?php echo $key; ?>-container">
|
36 |
<span class="wprm-recipe-details-icon"><?php include( WPRM_DIR . 'assets/icons/tag.svg' ); ?></span> <span class="wprm-recipe-details-name wprm-recipe-<?php echo $key; ?>-name"><?php echo WPRM_Template_Helper::label( $key . '_tags', $options['singular_name'] ); ?></span>
|
37 |
+
<span class="wprm-recipe-<?php echo $key; ?>">
|
38 |
<?php foreach ( $terms as $index => $term ) {
|
39 |
if ( 0 !== $index ) {
|
40 |
echo ', ';
|
49 |
<div class="wprm-recipe-details-container wprm-recipe-times-container">
|
50 |
<?php if ( $recipe->prep_time() ) : ?>
|
51 |
<div class="wprm-recipe-prep-time-container">
|
|
|
52 |
<span class="wprm-recipe-details-icon"><?php include( WPRM_DIR . 'assets/icons/knife.svg' ); ?></span> <span class="wprm-recipe-details-name wprm-recipe-prep-time-name"><?php echo WPRM_Template_Helper::label( 'prep_time' ); ?></span> <?php echo $recipe->prep_time_formatted(); ?>
|
53 |
</div>
|
54 |
<?php endif; // Prep time. ?>
|
55 |
<?php if ( $recipe->cook_time() ) : ?>
|
56 |
<div class="wprm-recipe-cook-time-container">
|
|
|
57 |
<span class="wprm-recipe-details-icon"><?php include( WPRM_DIR . 'assets/icons/pan.svg' ); ?></span> <span class="wprm-recipe-details-name wprm-recipe-cook-time-name"><?php echo WPRM_Template_Helper::label( 'cook_time' ); ?></span> <?php echo $recipe->cook_time_formatted(); ?>
|
58 |
</div>
|
59 |
<?php endif; // Cook time. ?>
|
60 |
<?php if ( $recipe->total_time() ) : ?>
|
61 |
<div class="wprm-recipe-total-time-container">
|
|
|
62 |
<span class="wprm-recipe-details-icon"><?php include( WPRM_DIR . 'assets/icons/clock.svg' ); ?></span> <span class="wprm-recipe-details-name wprm-recipe-total-time-name"><?php echo WPRM_Template_Helper::label( 'total_time' ); ?></span> <?php echo $recipe->total_time_formatted(); ?>
|
63 |
</div>
|
64 |
<?php endif; // Total time. ?>
|
66 |
<div class="wprm-recipe-details-container">
|
67 |
<?php if ( $recipe->servings() ) : ?>
|
68 |
<div class="wprm-recipe-servings-container">
|
69 |
+
<span class="wprm-recipe-details-icon"><?php include( WPRM_DIR . 'assets/icons/cutlery.svg' ); ?></span> <span class="wprm-recipe-details-name wprm-recipe-servings-name"><?php echo WPRM_Template_Helper::label( 'servings' ); ?></span> <span class="wprm-recipe-details wprm-recipe-servings"><?php echo $recipe->servings(); ?></span> <span class="wprm-recipe-details-unit wprm-recipe-servings-unit"><?php echo $recipe->servings_unit(); ?></span>
|
70 |
</div>
|
71 |
<?php endif; // Servings. ?>
|
72 |
<?php if ( $recipe->calories() ) : ?>
|
73 |
+
<div class="wprm-recipe-calories-container">
|
74 |
+
<span class="wprm-recipe-details-icon"><?php include( WPRM_DIR . 'assets/icons/battery.svg' ); ?></span> <span class="wprm-recipe-details-name wprm-recipe-calories-name"><?php echo WPRM_Template_Helper::label( 'calories' ); ?></span> <span class="wprm-recipe-details wprm-recipe-calories"><?php echo $recipe->calories(); ?></span> <span class="wprm-recipe-details-unit wprm-recipe-calories-unit"><?php _e( 'kcal', 'wp-recipe-maker' ); ?></span>
|
75 |
</div>
|
76 |
<?php endif; // Calories. ?>
|
77 |
<?php if ( $recipe->author() ) : ?>
|
93 |
<?php endif; // Ingredient group name. ?>
|
94 |
<ul class="wprm-recipe-ingredients">
|
95 |
<?php foreach ( $ingredient_group['ingredients'] as $ingredient ) : ?>
|
96 |
+
<li class="wprm-recipe-ingredient">
|
97 |
<?php if ( $ingredient['amount'] ) : ?>
|
98 |
<span class="wprm-recipe-ingredient-amount"><?php echo $ingredient['amount']; ?></span>
|
99 |
<?php endif; // Ingredient amount. ?>
|
126 |
<?php foreach ( $instruction_group['instructions'] as $instruction ) : ?>
|
127 |
<li class="wprm-recipe-instruction">
|
128 |
<?php if ( $instruction['text'] ) : ?>
|
129 |
+
<div class="wprm-recipe-instruction-text"><?php echo $instruction['text']; ?></div>
|
130 |
<?php endif; // Instruction text. ?>
|
131 |
<?php if ( $instruction['image'] ) : ?>
|
132 |
<div class="wprm-recipe-instruction-image"><?php echo WPRM_Template_Helper::instruction_image( $instruction, 'thumbnail' ); ?></div>
|
templates/recipe/tastefully-simple/tastefully-simple.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.rtl .wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-image-container .wprm-recipe-image,.rtl .wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-ingredients li,.rtl .wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-image-container .wprm-recipe-image,.rtl .wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-ingredients li{margin-right:10px;margin-left:0}.rtl .wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-image-container,.rtl .wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-image-container{float:left;text-align:left}.rtl .wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-time-container,.rtl .wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-time-container{float:right;border-left:none;border-right:1px solid #ccc}.rtl .wprm-print .wprm-recipe-tastefully-simple .wprm-clear-left,.rtl .wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-clear-left{clear:right}.rtl .wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-time-container:first-child,.rtl .wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-time-container:first-child{border-right:none}.rtl .wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-instructions li,.rtl .wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-instructions li{margin-left:0;margin-right:30px}.rtl .wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-notes-container ul li,.rtl .wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-notes-container ul li{margin-left:0;margin-right:10px}.rtl .wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-notes-container ol li,.rtl .wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-notes-container ol li{margin-left:0;margin-right:30px}.wprm-print .wprm-recipe-tastefully-simple,.wprm-recipe-container .wprm-recipe-tastefully-simple{font:12px Verdana,Arial,Geneva,sans-serif;border:1px dashed #666;padding:10px}.wprm-print .wprm-recipe-tastefully-simple li,.wprm-print .wprm-recipe-tastefully-simple p,.wprm-recipe-container .wprm-recipe-tastefully-simple li,.wprm-recipe-container .wprm-recipe-tastefully-simple p{font:1em Verdana,Arial,Geneva,sans-serif}.wprm-print .wprm-recipe-tastefully-simple div,.wprm-print .wprm-recipe-tastefully-simple li,.wprm-print .wprm-recipe-tastefully-simple ol,.wprm-print .wprm-recipe-tastefully-simple p,.wprm-print .wprm-recipe-tastefully-simple span,.wprm-print .wprm-recipe-tastefully-simple ul,.wprm-recipe-container .wprm-recipe-tastefully-simple div,.wprm-recipe-container .wprm-recipe-tastefully-simple li,.wprm-recipe-container .wprm-recipe-tastefully-simple ol,.wprm-recipe-container .wprm-recipe-tastefully-simple p,.wprm-recipe-container .wprm-recipe-tastefully-simple span,.wprm-recipe-container .wprm-recipe-tastefully-simple ul{margin:0;padding:0;line-height:inherit}.wprm-print .wprm-recipe-tastefully-simple :after,.wprm-print .wprm-recipe-tastefully-simple :before,.wprm-recipe-container .wprm-recipe-tastefully-simple :after,.wprm-recipe-container .wprm-recipe-tastefully-simple :before{display:none}.wprm-print .wprm-recipe-tastefully-simple svg,.wprm-recipe-container .wprm-recipe-tastefully-simple svg{vertical-align:middle;width:16px;height:16px;margin:0}.wprm-print .wprm-recipe-tastefully-simple .wprm-clear-left,.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-clear-left{clear:left;line-height:0;height:0}.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-image-container,.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-image-container{float:right;max-width:40%;text-align:right}.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-image-container .wprm-recipe-rating,.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-image-container .wprm-recipe-rating{margin-bottom:5px}.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-image-container .wprm-recipe-rating .wprm-recipe-rating-details,.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-image-container .wprm-recipe-rating .wprm-recipe-rating-details{font:.8em
|
1 |
+
.rtl .wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-image-container .wprm-recipe-image,.rtl .wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-ingredients li,.rtl .wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-image-container .wprm-recipe-image,.rtl .wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-ingredients li{margin-right:10px;margin-left:0}.rtl .wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-image-container,.rtl .wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-image-container{float:left;text-align:left}.rtl .wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-time-container,.rtl .wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-time-container{float:right;border-left:none;border-right:1px solid #ccc}.rtl .wprm-print .wprm-recipe-tastefully-simple .wprm-clear-left,.rtl .wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-clear-left{clear:right}.rtl .wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-time-container:first-child,.rtl .wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-time-container:first-child{border-right:none}.rtl .wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-instructions li,.rtl .wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-instructions li{margin-left:0;margin-right:30px}.rtl .wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-notes-container ul li,.rtl .wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-notes-container ul li{margin-left:0;margin-right:10px}.rtl .wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-notes-container ol li,.rtl .wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-notes-container ol li{margin-left:0;margin-right:30px}.wprm-print .wprm-recipe-tastefully-simple,.wprm-recipe-container .wprm-recipe-tastefully-simple{font:12px Verdana,Arial,Geneva,sans-serif;border:1px dashed #666;padding:10px}.wprm-print .wprm-recipe-tastefully-simple li,.wprm-print .wprm-recipe-tastefully-simple p,.wprm-recipe-container .wprm-recipe-tastefully-simple li,.wprm-recipe-container .wprm-recipe-tastefully-simple p{font:1em Verdana,Arial,Geneva,sans-serif}.wprm-print .wprm-recipe-tastefully-simple div,.wprm-print .wprm-recipe-tastefully-simple li,.wprm-print .wprm-recipe-tastefully-simple ol,.wprm-print .wprm-recipe-tastefully-simple p,.wprm-print .wprm-recipe-tastefully-simple span,.wprm-print .wprm-recipe-tastefully-simple ul,.wprm-recipe-container .wprm-recipe-tastefully-simple div,.wprm-recipe-container .wprm-recipe-tastefully-simple li,.wprm-recipe-container .wprm-recipe-tastefully-simple ol,.wprm-recipe-container .wprm-recipe-tastefully-simple p,.wprm-recipe-container .wprm-recipe-tastefully-simple span,.wprm-recipe-container .wprm-recipe-tastefully-simple ul{margin:0;padding:0;line-height:inherit}.wprm-print .wprm-recipe-tastefully-simple :after,.wprm-print .wprm-recipe-tastefully-simple :before,.wprm-recipe-container .wprm-recipe-tastefully-simple :after,.wprm-recipe-container .wprm-recipe-tastefully-simple :before{display:none}.wprm-print .wprm-recipe-tastefully-simple svg,.wprm-recipe-container .wprm-recipe-tastefully-simple svg{vertical-align:middle;width:16px;height:16px;margin:0}.wprm-print .wprm-recipe-tastefully-simple .wprm-clear-left,.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-clear-left{clear:left;line-height:0;height:0}.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-image-container,.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-image-container{float:right;max-width:40%;text-align:right}.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-image-container .wprm-recipe-rating,.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-image-container .wprm-recipe-rating{margin-bottom:5px}.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-image-container .wprm-recipe-rating .wprm-recipe-rating-details,.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-image-container .wprm-recipe-rating .wprm-recipe-rating-details{font-size:.8em}.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-image-container .wprm-recipe-image,.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-image-container .wprm-recipe-image{margin-left:10px}.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-image-container .wprm-recipe-buttons,.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-image-container .wprm-recipe-buttons{margin-top:10px;text-align:center}.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-image-container .wprm-recipe-buttons .wprm-recipe-print,.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-image-container .wprm-recipe-buttons .wprm-recipe-print{font-size:11px;cursor:pointer;-webkit-border-radius:5px 5px 5px 5px;-moz-border-radius:5px;border-radius:5px;padding:.4em 1em}.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-name,.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-name{font:1.5em Verdana,Geneva,sans-serif;margin-bottom:15px}.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-times-container,.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-times-container{border-top:1px dotted #666;border-bottom:1px dotted #666;width:60%;padding-top:5px;padding-bottom:5px;margin-bottom:10px}.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-time-container,.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-time-container{width:33%;text-align:center;float:left;font-weight:700;border-left:1px solid #ccc}.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-time-container:first-child,.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-time-container:first-child{border-left:none}.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-time-container .wprm-recipe-time-header,.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-time-container .wprm-recipe-time-header{margin-bottom:4px;word-break:break-all}.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-time-container .wprm-recipe-time,.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-time-container .wprm-recipe-time{font-size:.8em;font-weight:400}.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-details-container,.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-ingredients-container,.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-summary,.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-summary p,.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-details-container,.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-ingredients-container,.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-summary,.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-summary p{margin-bottom:10px}.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-header,.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-header{font-size:1.4em;font-weight:700;margin-top:1em;margin-bottom:1em}.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-group-name,.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-group-name{margin-top:3px;margin-bottom:3px;font-weight:700}.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-ingredients li,.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-ingredients li{list-style-position:inside;margin-left:10px;line-height:inherit;background:0 0}.wprm-print .wprm-recipe-tastefully-simple .wprm-unit-conversion-container,.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-unit-conversion-container{margin-top:10px}.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-instructions li,.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-instructions li{margin-left:30px;line-height:inherit;background:0 0}.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-notes-container ul li,.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-notes-container ul li{list-style:disc inside;margin-left:10px}.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-notes-container ol li,.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-notes-container ol li{list-style:decimal;margin-left:30px}.wprm-print .wprm-recipe-tastefully-simple .wprm-nutrition-label,.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-nutrition-label{margin-top:20px}@media only screen and (max-width:480px){.rtl .wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-image-container,.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-image-container{float:none;width:100%;max-width:none;text-align:center;margin-bottom:10px}.rtl .wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-image-container .wprm-recipe-image,.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-image-container .wprm-recipe-image{margin-left:0;margin-right:0}.rtl .wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-times-container,.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-times-container{width:100%}}
|
templates/recipe/tastefully-simple/tastefully-simple.php
CHANGED
@@ -11,10 +11,7 @@
|
|
11 |
|
12 |
// @codingStandardsIgnoreStart
|
13 |
?>
|
14 |
-
<div class="wprm-recipe wprm-recipe-tastefully-simple"
|
15 |
-
<meta itemprop="author" content="<?php echo $recipe->author_meta(); ?>" />
|
16 |
-
<meta itemprop="datePublished" content="<?php echo $recipe->date(); ?>" />
|
17 |
-
<meta itemprop="image" content="<?php echo $recipe->image_url( 'full' ); ?>" />
|
18 |
<div class="wprm-recipe-image-container">
|
19 |
<?php echo $recipe->rating_stars( true ); ?>
|
20 |
<div class="wprm-recipe-image"><?php echo WPRM_Template_Helper::recipe_image( $recipe, 'thumbnail' ); ?></div>
|
@@ -22,26 +19,23 @@
|
|
22 |
<span class="wprm-recipe-print wprm-color-accent"><?php echo WPRM_Template_Helper::label( 'print_button' ); ?></span>
|
23 |
</div>
|
24 |
</div>
|
25 |
-
<div class="wprm-recipe-name wprm-color-header"
|
26 |
<?php if ( $recipe->prep_time() || $recipe->prep_time() || $recipe->prep_time() ) : ?>
|
27 |
<div class="wprm-recipe-times-container wprm-color-border">
|
28 |
<?php if ( $recipe->prep_time() ) : ?>
|
29 |
<div class="wprm-recipe-time-container wprm-color-border">
|
30 |
-
<meta itemprop="prepTime" content="PT<?php echo $recipe->prep_time(); ?>M" />
|
31 |
<div class="wprm-recipe-time-header"><?php echo WPRM_Template_Helper::label( 'prep_time' ); ?></div>
|
32 |
<div class="wprm-recipe-time"><?php echo $recipe->prep_time_formatted( true ); ?></div>
|
33 |
</div>
|
34 |
<?php endif; // Prep time. ?>
|
35 |
<?php if ( $recipe->cook_time() ) : ?>
|
36 |
<div class="wprm-recipe-time-container wprm-color-border">
|
37 |
-
<meta itemprop="cookTime" content="PT<?php echo $recipe->cook_time(); ?>M" />
|
38 |
<div class="wprm-recipe-time-header"><?php echo WPRM_Template_Helper::label( 'cook_time' ); ?></div>
|
39 |
<div class="wprm-recipe-time"><?php echo $recipe->cook_time_formatted( true ); ?></div>
|
40 |
</div>
|
41 |
<?php endif; // Cook time. ?>
|
42 |
<?php if ( $recipe->total_time() ) : ?>
|
43 |
<div class="wprm-recipe-time-container wprm-color-border">
|
44 |
-
<meta itemprop="totalTime" content="PT<?php echo $recipe->total_time(); ?>M" />
|
45 |
<div class="wprm-recipe-time-header"><?php echo WPRM_Template_Helper::label( 'total_time' ); ?></div>
|
46 |
<div class="wprm-recipe-time"><?php echo $recipe->total_time_formatted( true ); ?></div>
|
47 |
</div>
|
@@ -49,7 +43,7 @@
|
|
49 |
<div class="wprm-clear-left"> </div>
|
50 |
</div>
|
51 |
<?php endif; // Recipe times. ?>
|
52 |
-
<div class="wprm-recipe-summary"
|
53 |
<?php echo $recipe->summary(); ?>
|
54 |
</div>
|
55 |
<div class="wprm-recipe-details-container">
|
@@ -63,7 +57,7 @@
|
|
63 |
if ( count( $terms ) > 0 ) : ?>
|
64 |
<div class="wprm-recipe-<?php echo $key; ?>-container">
|
65 |
<span class="wprm-recipe-details-name wprm-recipe-<?php echo $key; ?>-name"><?php echo WPRM_Template_Helper::label( $key . '_tags', $options['singular_name'] ); ?>:</span>
|
66 |
-
<span class="wprm-recipe-<?php echo $key; ?>"
|
67 |
<?php foreach ( $terms as $index => $term ) {
|
68 |
if ( 0 !== $index ) {
|
69 |
echo ', ';
|
@@ -76,12 +70,12 @@
|
|
76 |
endforeach; // Taxonomies. ?>
|
77 |
<?php if ( $recipe->servings() ) : ?>
|
78 |
<div class="wprm-recipe-servings-container">
|
79 |
-
<span class="wprm-recipe-details-name wprm-recipe-servings-name"><?php echo WPRM_Template_Helper::label( 'servings' ); ?></span>: <span
|
80 |
</div>
|
81 |
<?php endif; // Servings. ?>
|
82 |
<?php if ( $recipe->calories() ) : ?>
|
83 |
-
<div class="wprm-recipe-calories-container"
|
84 |
-
<span class="wprm-recipe-details-name wprm-recipe-calories-name"><?php echo WPRM_Template_Helper::label( 'calories' ); ?></span>: <span
|
85 |
</div>
|
86 |
<?php endif; // Calories. ?>
|
87 |
<?php if ( $recipe->author() ) : ?>
|
@@ -103,7 +97,7 @@
|
|
103 |
<?php endif; // Ingredient group name. ?>
|
104 |
<ul class="wprm-recipe-ingredients">
|
105 |
<?php foreach ( $ingredient_group['ingredients'] as $ingredient ) : ?>
|
106 |
-
<li class="wprm-recipe-ingredient"
|
107 |
<?php if ( $ingredient['amount'] ) : ?>
|
108 |
<span class="wprm-recipe-ingredient-amount"><?php echo $ingredient['amount']; ?></span>
|
109 |
<?php endif; // Ingredient amount. ?>
|
@@ -136,7 +130,7 @@
|
|
136 |
<?php foreach ( $instruction_group['instructions'] as $instruction ) : ?>
|
137 |
<li class="wprm-recipe-instruction">
|
138 |
<?php if ( $instruction['text'] ) : ?>
|
139 |
-
<div class="wprm-recipe-instruction-text"
|
140 |
<?php endif; // Instruction text. ?>
|
141 |
<?php if ( $instruction['image'] ) : ?>
|
142 |
<div class="wprm-recipe-instruction-image"><?php echo WPRM_Template_Helper::instruction_image( $instruction, 'thumbnail' ); ?></div>
|
11 |
|
12 |
// @codingStandardsIgnoreStart
|
13 |
?>
|
14 |
+
<div class="wprm-recipe wprm-recipe-tastefully-simple">
|
|
|
|
|
|
|
15 |
<div class="wprm-recipe-image-container">
|
16 |
<?php echo $recipe->rating_stars( true ); ?>
|
17 |
<div class="wprm-recipe-image"><?php echo WPRM_Template_Helper::recipe_image( $recipe, 'thumbnail' ); ?></div>
|
19 |
<span class="wprm-recipe-print wprm-color-accent"><?php echo WPRM_Template_Helper::label( 'print_button' ); ?></span>
|
20 |
</div>
|
21 |
</div>
|
22 |
+
<div class="wprm-recipe-name wprm-color-header"><?php echo $recipe->name(); ?></div>
|
23 |
<?php if ( $recipe->prep_time() || $recipe->prep_time() || $recipe->prep_time() ) : ?>
|
24 |
<div class="wprm-recipe-times-container wprm-color-border">
|
25 |
<?php if ( $recipe->prep_time() ) : ?>
|
26 |
<div class="wprm-recipe-time-container wprm-color-border">
|
|
|
27 |
<div class="wprm-recipe-time-header"><?php echo WPRM_Template_Helper::label( 'prep_time' ); ?></div>
|
28 |
<div class="wprm-recipe-time"><?php echo $recipe->prep_time_formatted( true ); ?></div>
|
29 |
</div>
|
30 |
<?php endif; // Prep time. ?>
|
31 |
<?php if ( $recipe->cook_time() ) : ?>
|
32 |
<div class="wprm-recipe-time-container wprm-color-border">
|
|
|
33 |
<div class="wprm-recipe-time-header"><?php echo WPRM_Template_Helper::label( 'cook_time' ); ?></div>
|
34 |
<div class="wprm-recipe-time"><?php echo $recipe->cook_time_formatted( true ); ?></div>
|
35 |
</div>
|
36 |
<?php endif; // Cook time. ?>
|
37 |
<?php if ( $recipe->total_time() ) : ?>
|
38 |
<div class="wprm-recipe-time-container wprm-color-border">
|
|
|
39 |
<div class="wprm-recipe-time-header"><?php echo WPRM_Template_Helper::label( 'total_time' ); ?></div>
|
40 |
<div class="wprm-recipe-time"><?php echo $recipe->total_time_formatted( true ); ?></div>
|
41 |
</div>
|
43 |
<div class="wprm-clear-left"> </div>
|
44 |
</div>
|
45 |
<?php endif; // Recipe times. ?>
|
46 |
+
<div class="wprm-recipe-summary">
|
47 |
<?php echo $recipe->summary(); ?>
|
48 |
</div>
|
49 |
<div class="wprm-recipe-details-container">
|
57 |
if ( count( $terms ) > 0 ) : ?>
|
58 |
<div class="wprm-recipe-<?php echo $key; ?>-container">
|
59 |
<span class="wprm-recipe-details-name wprm-recipe-<?php echo $key; ?>-name"><?php echo WPRM_Template_Helper::label( $key . '_tags', $options['singular_name'] ); ?>:</span>
|
60 |
+
<span class="wprm-recipe-<?php echo $key; ?>">
|
61 |
<?php foreach ( $terms as $index => $term ) {
|
62 |
if ( 0 !== $index ) {
|
63 |
echo ', ';
|
70 |
endforeach; // Taxonomies. ?>
|
71 |
<?php if ( $recipe->servings() ) : ?>
|
72 |
<div class="wprm-recipe-servings-container">
|
73 |
+
<span class="wprm-recipe-details-name wprm-recipe-servings-name"><?php echo WPRM_Template_Helper::label( 'servings' ); ?></span>: <span class="wprm-recipe-details wprm-recipe-servings"><?php echo $recipe->servings(); ?></span> <span class="wprm-recipe-details-unit wprm-recipe-servings-unit"><?php echo $recipe->servings_unit(); ?></span>
|
74 |
</div>
|
75 |
<?php endif; // Servings. ?>
|
76 |
<?php if ( $recipe->calories() ) : ?>
|
77 |
+
<div class="wprm-recipe-calories-container">
|
78 |
+
<span class="wprm-recipe-details-name wprm-recipe-calories-name"><?php echo WPRM_Template_Helper::label( 'calories' ); ?></span>: <span class="wprm-recipe-details wprm-recipe-calories"><?php echo $recipe->calories(); ?></span> <span class="wprm-recipe-details-unit wprm-recipe-calories-unit"><?php _e( 'kcal', 'wp-recipe-maker' ); ?></span>
|
79 |
</div>
|
80 |
<?php endif; // Calories. ?>
|
81 |
<?php if ( $recipe->author() ) : ?>
|
97 |
<?php endif; // Ingredient group name. ?>
|
98 |
<ul class="wprm-recipe-ingredients">
|
99 |
<?php foreach ( $ingredient_group['ingredients'] as $ingredient ) : ?>
|
100 |
+
<li class="wprm-recipe-ingredient">
|
101 |
<?php if ( $ingredient['amount'] ) : ?>
|
102 |
<span class="wprm-recipe-ingredient-amount"><?php echo $ingredient['amount']; ?></span>
|
103 |
<?php endif; // Ingredient amount. ?>
|
130 |
<?php foreach ( $instruction_group['instructions'] as $instruction ) : ?>
|
131 |
<li class="wprm-recipe-instruction">
|
132 |
<?php if ( $instruction['text'] ) : ?>
|
133 |
+
<div class="wprm-recipe-instruction-text"><?php echo $instruction['text']; ?></div>
|
134 |
<?php endif; // Instruction text. ?>
|
135 |
<?php if ( $instruction['image'] ) : ?>
|
136 |
<div class="wprm-recipe-instruction-image"><?php echo WPRM_Template_Helper::instruction_image( $instruction, 'thumbnail' ); ?></div>
|
templates/recipe/tastefully-simple/tastefully-simple.scss
CHANGED
@@ -100,7 +100,7 @@
|
|
100 |
margin-bottom: 5px;
|
101 |
|
102 |
.wprm-recipe-rating-details {
|
103 |
-
font: 0.8em
|
104 |
}
|
105 |
}
|
106 |
|
@@ -216,6 +216,10 @@
|
|
216 |
margin-left: 30px;
|
217 |
}
|
218 |
}
|
|
|
|
|
|
|
|
|
219 |
}
|
220 |
|
221 |
@media only screen and (max-width: 480px) {
|
100 |
margin-bottom: 5px;
|
101 |
|
102 |
.wprm-recipe-rating-details {
|
103 |
+
font-size: 0.8em;
|
104 |
}
|
105 |
}
|
106 |
|
216 |
margin-left: 30px;
|
217 |
}
|
218 |
}
|
219 |
+
|
220 |
+
.wprm-nutrition-label {
|
221 |
+
margin-top: 20px;
|
222 |
+
}
|
223 |
}
|
224 |
|
225 |
@media only screen and (max-width: 480px) {
|
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: 1.
|
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: 1.25.0
|
19 |
* Author: Bootstrapped Ventures
|
20 |
* Author URI: http://bootstrapped.ventures/
|
21 |
* License: GPL-2.0+
|