WP Recipe Maker - Version 1.20.0

Version Description

  • Feature: Intermediate save when creating or editing recipes
  • Feature: Settings to personalize the ingredient text import
  • Improvement: Abbreviations in ingredient text import
  • Improvement: Immediately update parent post when importing
  • Improvement: Try to fix serialize issues when getting ingredients or instructions
  • Improvement: Prevent styling differences in instructions
  • Fix: EasyRecipe recipes stuck in to import list
  • Fix: Remove leftover debug code
Download this release

Release Info

Developer BrechtVds
Plugin Icon 128x128 WP Recipe Maker
Version 1.20.0
Comparing to
See all releases

Code changes from version 1.19.0 to 1.20.0

Files changed (34) hide show
  1. assets/css/admin/modal.min.css +1 -1
  2. assets/css/admin/modal/_container.scss +4 -0
  3. assets/css/admin/modal/_recipe-details.scss +2 -1
  4. assets/js/admin/import.js +1 -1
  5. assets/js/admin/modal.js +14 -0
  6. assets/js/admin/recipe-form.js +119 -12
  7. assets/js/admin/rich-editor.js +0 -1
  8. assets/js/public/print.js +10 -3
  9. includes/admin/class-wprm-recipe-parser.php +49 -15
  10. includes/admin/class-wprm-recipe-sanitizer.php +13 -0
  11. includes/admin/class-wprm-recipe-saver.php +35 -17
  12. includes/admin/import/class-wprm-import-easyrecipe.php +1 -1
  13. includes/admin/import/class-wprm-import-example.php +270 -0
  14. includes/admin/modal/class-wprm-modal.php +4 -4
  15. includes/class-wp-recipe-maker.php +1 -1
  16. includes/public/class-wprm-print.php +17 -2
  17. includes/public/class-wprm-recipe.php +52 -4
  18. includes/public/class-wprm-settings.php +28 -0
  19. includes/public/class-wprm-template-helper.php +43 -0
  20. readme.txt +19 -0
  21. templates/admin/menu/faq/whats_new.php +12 -0
  22. templates/admin/menu/import/import-overview.php +1 -1
  23. templates/admin/modal/modal.php +3 -2
  24. templates/admin/modal/tabs/recipe-details.php +6 -0
  25. templates/admin/settings.php +1 -0
  26. templates/admin/settings/appearance.php +0 -1
  27. templates/admin/settings/import.php +87 -0
  28. templates/recipe/simple/simple.min.css +1 -1
  29. templates/recipe/simple/simple.php +1 -0
  30. templates/recipe/simple/simple.scss +2 -0
  31. templates/recipe/tastefully-simple/tastefully-simple.min.css +1 -1
  32. templates/recipe/tastefully-simple/tastefully-simple.php +1 -0
  33. templates/recipe/tastefully-simple/tastefully-simple.scss +8 -0
  34. wp-recipe-maker.php +1 -1
assets/css/admin/modal.min.css CHANGED
@@ -1 +1 @@
1
- .wprm-frame-title .dashicons,.wprm-frame.hide-router .wprm-frame-router,.wprm-modal-container{display:none}.wprm-giveaway-notice{border:1px solid #006400;background-color:rgba(0,255,0,.15);padding:10px;margin-bottom:10px}.wprm-easyrecipe-warning{display:none;border:1px solid #8b0000;background-color:rgba(255,0,0,.15);padding:10px 10px 0;margin-bottom:10px}.select2_wprm-container{z-index:100075}.select2_wprm-container.select2_wprm-container--focus .select2_wprm-selection{border-color:#5b9dd9}.select2_wprm-container li{margin:0}.select2_wprm-container .select2_wprm-selection{border-color:#ddd}.medium-editor-anchor-preview,.medium-editor-toolbar{z-index:100080}.medium-editor-anchor-preview{font-size:12px}.medium-editor-element{border:1px solid #ddd;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.07);box-shadow:inset 0 1px 2px rgba(0,0,0,.07);min-height:68px;padding:3px 5px}.medium-editor-element:focus{border-color:#5b9dd9;-webkit-box-shadow:0 0 2px rgba(30,140,190,.8);box-shadow:0 0 2px rgba(30,140,190,.8)}.medium-editor-element:after{font-style:normal;color:#999;opacity:.5;font-size:14px;line-height:28px}.medium-editor-element p:first-child{margin-top:0}.medium-editor-element p:last-child{margin-bottom:0}.wprm-modal-hint{max-width:400px;margin-bottom:20px}.wprm-modal-hint .wprm-modal-hint-header{font-weight:700;font-variant:small-caps}.wprm-modal-hint .wprm-modal-hint-text{font-style:italic}.wprm-modal-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;min-height:360px;background:#000;opacity:.7;z-index:100000}.wprm-modal{position:fixed;top:30px;left:30px;right:30px;bottom:30px;z-index:100050}.wprm-modal *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.wprm-modal-close{position:absolute;top:0;right:0;width:50px;height:50px;padding:0;z-index:1000;-webkit-transition:color .1s ease-in-out,background .1s ease-in-out;transition:color .1s ease-in-out,background .1s ease-in-out}.wprm-modal-close .wprm-modal-icon:before{content:"\f158";font:400 20px/1 dashicons;speak:none;vertical-align:middle;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:#666}.wprm-modal-content{position:absolute;top:0;left:0;right:0;bottom:0;overflow:auto;min-height:300px;-webkit-box-shadow:0 5px 15px rgba(0,0,0,.7);box-shadow:0 5px 15px rgba(0,0,0,.7);background:#fcfcfc;-webkit-font-smoothing:subpixel-antialiased}.wprm-modal-content ::-webkit-input-placeholder{color:#999;opacity:.5}.wprm-modal-content :-moz-placeholder{color:#999;opacity:.5}.wprm-modal-content ::-moz-placeholder{color:#999;opacity:.5}.wprm-modal-content :-ms-input-placeholder{color:#999;opacity:.5}.wprm-frame{overflow:hidden;right:0}.wprm-frame,.wprm-frame-menu{position:absolute;left:0;bottom:0;top:0}.wprm-frame-menu{width:200px;z-index:150}.wprm-frame-title{top:0;height:50px}.wprm-frame-router,.wprm-frame-title{z-index:200;left:200px;position:absolute;right:0}.wprm-menu-item{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.wprm-menu{position:absolute;left:0;margin:0;padding:10px 0;border-right-width:1px;border-right-style:solid;border-right-color:#ccc;user-select:none}.wprm-menu-hidden{padding:5px 5px 0 10px;font-style:italic}.wprm-menu,.wprm-sidebar{top:0;bottom:0;background:#f3f3f3;right:0}.wprm-menu .active,.wprm-menu .active:hover{color:#23282d;font-weight:700}.wprm-menu>a{display:block;position:relative;padding:8px 20px;margin:0;color:#0073aa}.wprm-frame .hidden,.wprm-frame-content-tab:not(.active),.wprm-router:not(.active){display:none}.wprm-menu>a,.wprm-router>a{line-height:18px;font-size:14px;text-decoration:none}.wprm-frame a{border-bottom:none;color:#0073aa}.wprm-menu .separator{height:0;margin:12px 20px;padding:0;border-top:1px solid #ddd}.wprm-frame-title h1{padding:0 16px;font-size:22px;line-height:50px;margin:0}.wprm-frame-router{top:50px;height:36px}.wprm-router{position:relative;padding:0 6px;margin:0;clear:both;user-select:none}.wprm-router>a{position:relative;float:left;padding:8px 10px 9px;margin:0;height:18px}.wprm-router a{-webkit-transition:none;transition:none}.wprm-router>a:last-child{border-right:0}.wprm-router .active,.wprm-router>a.active:last-child{margin:-1px -1px 0;background:#fff;border:1px solid #ddd;border-bottom:none}.wprm-router .active,.wprm-router .active:hover{color:#32373c}.wprm-frame-content{position:absolute;top:84px;left:200px;right:0;bottom:61px;height:auto;width:auto;margin:0;overflow:auto;background:#fff;border-top:1px solid #ddd;border-bottom:1px solid #ddd}.wprm-frame-toolbar,.wprm-toolbar{position:absolute;right:0;z-index:100;height:60px}.wprm-frame-content-tab{margin:20px}.wprm-frame-toolbar{left:200px;bottom:0}.wprm-toolbar{top:0;left:0;padding:0 16px;border:0 solid #ddd;overflow:hidden}.wprm-modal-content .wprm-toolbar-primary.search-form{width:33%}.wprm-toolbar-primary{float:right;height:100%}.wprm-modal-content .wprm-toolbar-primary .wprm-button{float:right}.wprm-toolbar-primary>.wprm-button,.wprm-toolbar-primary>.wprm-button-group{margin-left:10px;float:left;margin-top:15px}@media only screen and (max-width:900px){.wprm-frame:not(.hide-menu) .wprm-frame-title .dashicons{display:inline-block;line-height:50px}.wprm-frame:not(.hide-menu) .wprm-frame-menu{position:static;width:0}.wprm-frame:not(.hide-menu) .wprm-frame-content,.wprm-frame:not(.hide-menu) .wprm-frame-router,.wprm-frame:not(.hide-menu) .wprm-frame-title,.wprm-frame:not(.hide-menu) .wprm-frame-toolbar,.wprm-frame:not(.hide-menu) .wprm-menu.visible{left:0}.wprm-frame:not(.hide-menu) .wprm-menu{width:auto;max-width:80%;overflow:auto;z-index:2000;top:50px;left:-300px;right:auto;bottom:auto;padding:5px 0;border:1px solid #ccc}.wprm-frame:not(.hide-menu) .wprm-menu>a.active{display:none}.wprm-frame:not(.hide-menu) .wprm-menu>a{padding:12px 16px;font-size:16px}.wprm-frame:not(.hide-menu) .wprm-menu .separator{margin:5px 10px}.wprm-frame:not(.hide-menu) .wprm-frame-title h1{color:#0073aa;line-height:3;font-size:18px;float:left;cursor:pointer}}@media only screen and (max-width:640px),screen and (max-height:400px){.wprm-modal{position:fixed;top:0;left:0;right:0;bottom:0}.wprm-modal .wprm-frame-title{height:40px}}@media only screen and (max-width:480px){.wprm-frame:not(.hide-menu) .wprm-frame-title .dashicons{line-height:40px}.wprm-frame-router,.wprm-frame:not(.hide-menu) .wprm-menu{top:40px}.wprm-frame:not(.hide-menu) .wprm-frame-title h1,.wprm-modal .wprm-frame-title h1{font-size:18px;line-height:40px}.wprm-frame-content{top:74px}}.wprm-recipe-form{max-width:600px}.wprm-recipe-form .wprm-recipe-form-container{margin-bottom:15px;vertical-align:top}.wprm-recipe-form .wprm-recipe-form-container-halfs{display:inline-block;width:50%}.wprm-recipe-form .wprm-recipe-form-container-thirds{display:inline-block;width:33.3%}.wprm-recipe-form label{display:block;font-weight:700;margin-bottom:5px}.wprm-recipe-form input[type=text],.wprm-recipe-form input[type=number]{margin:0;width:100%;max-width:120px;height:34px;line-height:34px}.wprm-recipe-form input[type=text][type=number],.wprm-recipe-form input[type=number][type=number]{max-width:50px}.wprm-recipe-form input[type=text].select2_wprm-search__field,.wprm-recipe-form input[type=number].select2_wprm-search__field{height:18px;line-height:18px}.wprm-recipe-form select{width:100%}.wprm-recipe-form textarea{width:100%;resize:vertical}@media only screen and (max-width:480px){.wprm-recipe-form .wprm-recipe-form-container-halfs,.wprm-recipe-form .wprm-recipe-form-container-thirds{display:block;width:100%}}.wprm-recipe-import-text-form .import-text-buttons{margin-bottom:10px}.wprm-recipe-import-text-form .import-text-step{display:none}.wprm-recipe-import-text-form .import-text-step#import-text-step-input{display:block}.wprm-recipe-import-text-form #import-text-highlight-sandbox,.wprm-recipe-import-text-form .import-text-input{margin-top:10px}.wprm-recipe-import-text-form #import-text-ingredient-groups label,.wprm-recipe-import-text-form #import-text-instruction-groups label{display:inline;font-weight:400}.wprm-recipe-import-text-form .import-text-group-warning{margin-top:10px;display:none}.wprm-recipe-import-text-form #import-text-highlight-sandbox{display:none;max-height:400px;overflow:scroll;padding:10px;border:1px dashed #999}.wprm-loader,.wprm-loader:after,.wprm-loader:before{border-radius:50%;width:1.5em;height:1.5em;-webkit-animation:load7 1.8s infinite ease-in-out;animation:load7 1.8s infinite ease-in-out}.wprm-loader{display:none;color:#444;font-size:10px;margin:20px auto;position:relative;text-indent:-9999em;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0);-webkit-animation-delay:-.16s;animation-delay:-.16s}.wprm-loader:after,.wprm-loader:before{content:'';position:absolute;top:0}.wprm-loader:before{left:-2.5em;-webkit-animation-delay:-.32s;animation-delay:-.32s}.wprm-loader:after{left:2.5em}@-webkit-keyframes load7{0%,100%,80%{box-shadow:0 2.5em 0 -1.3em}40%{box-shadow:0 2.5em 0 0}}@keyframes load7{0%,100%,80%{box-shadow:0 2.5em 0 -1.3em}40%{box-shadow:0 2.5em 0 0}}.wprm-recipe-details-form input#wprm-recipe-name{max-width:450px}.wprm-recipe-details-form input#wprm-recipe-author-name{max-width:none}.wprm-recipe-details-form input#wprm-recipe-calories{max-width:70px}.wprm-recipe-details-form .wprm-recipe-image-preview{float:right;max-width:100px}.wprm-recipe-details-form .wprm-recipe-image-preview img{max-width:100%;height:auto}.wprm-recipe-details-form .wprm-recipe-summary-container{clear:both}@media only screen and (max-width:480px){.wprm-recipe-details-form .wprm-recipe-image-preview{float:none;margin:10px auto}}.wprm-recipe-ingredients-form,.wprm-recipe-instructions-form{max-width:750px;margin-bottom:15px}.wprm-recipe-ingredients-form input,.wprm-recipe-instructions-form input{margin:0;width:100%;height:34px;line-height:34px}.wprm-recipe-ingredients-form textarea,.wprm-recipe-instructions-form textarea{width:100%;resize:vertical}.wprm-recipe-ingredients-form ::-webkit-input-placeholder,.wprm-recipe-instructions-form ::-webkit-input-placeholder{color:#999;opacity:.5}.wprm-recipe-ingredients-form :-moz-placeholder,.wprm-recipe-instructions-form :-moz-placeholder{color:#999;opacity:.5}.wprm-recipe-ingredients-form ::-moz-placeholder,.wprm-recipe-instructions-form ::-moz-placeholder{color:#999;opacity:.5}.wprm-recipe-ingredients-form :-ms-input-placeholder,.wprm-recipe-instructions-form :-ms-input-placeholder{color:#999;opacity:.5}.wprm-recipe-ingredients-form table,.wprm-recipe-instructions-form table{width:100%}.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th,.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th{text-align:left}.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th:nth-child(1),.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th:nth-child(6),.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th:nth-child(1),.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th:nth-child(6){width:5%;text-align:center}.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th:nth-child(2),.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th:nth-child(2){width:10%}.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th:nth-child(3),.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th:nth-child(3){width:15%}.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th:nth-child(4),.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th:nth-child(4){width:40%}.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th:nth-child(5),.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th:nth-child(5){width:25%}.wprm-recipe-ingredients-form table.wprm-recipe-instructions-container th,.wprm-recipe-instructions-form table.wprm-recipe-instructions-container th{text-align:left}.wprm-recipe-ingredients-form table.wprm-recipe-instructions-container th:nth-child(1),.wprm-recipe-ingredients-form table.wprm-recipe-instructions-container th:nth-child(4),.wprm-recipe-instructions-form table.wprm-recipe-instructions-container th:nth-child(1),.wprm-recipe-instructions-form table.wprm-recipe-instructions-container th:nth-child(4){width:5%;text-align:center}.wprm-recipe-ingredients-form table.wprm-recipe-instructions-container th:nth-child(2),.wprm-recipe-instructions-form table.wprm-recipe-instructions-container th:nth-child(2){width:65%}.wprm-recipe-ingredients-form table.wprm-recipe-instructions-container th:nth-child(3),.wprm-recipe-instructions-form table.wprm-recipe-instructions-container th:nth-child(3){width:25%}.wprm-recipe-ingredients-form table .wprm-recipe-ingredients-placeholder,.wprm-recipe-ingredients-form table .wprm-recipe-instructions-placeholder,.wprm-recipe-instructions-form table .wprm-recipe-ingredients-placeholder,.wprm-recipe-instructions-form table .wprm-recipe-instructions-placeholder{display:none}.wprm-recipe-ingredients-form table td,.wprm-recipe-instructions-form table td{text-align:left;vertical-align:top}.wprm-recipe-ingredients-form table td:first-child,.wprm-recipe-ingredients-form table td:last-child,.wprm-recipe-instructions-form table td:first-child,.wprm-recipe-instructions-form table td:last-child{text-align:center;vertical-align:middle}.wprm-recipe-ingredients-form .ui-sortable-helper,.wprm-recipe-instructions-form .ui-sortable-helper{display:table}.wprm-recipe-ingredients-form .ui-sortable-helper .wprm-recipe-instruction-text,.wprm-recipe-instructions-form .ui-sortable-helper .wprm-recipe-instruction-text{min-width:200px}.wprm-recipe-ingredients-form .wprm-recipe-ingredients-instructions-sort,.wprm-recipe-instructions-form .wprm-recipe-ingredients-instructions-sort{cursor:move}.wprm-recipe-ingredients-form .wprm-recipe-ingredients-instructions-delete,.wprm-recipe-instructions-form .wprm-recipe-ingredients-instructions-delete{cursor:pointer}.wprm-recipe-ingredients-form .wprm-recipe-ingredients-instructions-delete,.wprm-recipe-ingredients-form .wprm-recipe-ingredients-instructions-sort,.wprm-recipe-instructions-form .wprm-recipe-ingredients-instructions-delete,.wprm-recipe-instructions-form .wprm-recipe-ingredients-instructions-sort{color:#999;opacity:.5}.wprm-recipe-ingredients-form .wprm-recipe-ingredients-instructions-delete:hover,.wprm-recipe-ingredients-form .wprm-recipe-ingredients-instructions-sort:hover,.wprm-recipe-instructions-form .wprm-recipe-ingredients-instructions-delete:hover,.wprm-recipe-instructions-form .wprm-recipe-ingredients-instructions-sort:hover{color:#444;opacity:1}.wprm-recipe-ingredients-form .wprm-recipe-ingredients-actions,.wprm-recipe-ingredients-form .wprm-recipe-instructions-actions,.wprm-recipe-instructions-form .wprm-recipe-ingredients-actions,.wprm-recipe-instructions-form .wprm-recipe-instructions-actions{margin:10px}.wprm-recipe-ingredients-form .wprm-recipe-image-preview,.wprm-recipe-instructions-form .wprm-recipe-image-preview{max-width:75px}.wprm-recipe-ingredients-form .wprm-recipe-image-preview img,.wprm-recipe-instructions-form .wprm-recipe-image-preview img{max-width:100%;height:auto}.wprm-shortcode-builder .wprm-shortcode-builder-container{margin-bottom:15px;vertical-align:top}.wprm-shortcode-builder .wprm-shortcode-builder-container-halfs{display:inline-block;width:50%}.wprm-shortcode-builder .wprm-shortcode-builder-container-thirds{display:inline-block;width:33.3%}.wprm-shortcode-builder label{display:block;font-weight:700;margin-bottom:5px}.wprm-shortcode-builder .wprm-shortcode-builder-helper{margin-left:5px;font-size:.8em;font-style:italic}.wprm-shortcode-builder input{margin:0;width:100%;max-width:250px;height:34px;line-height:34px}.wprm-shortcode-builder input.select2_wprm-search__field{height:18px;line-height:18px}.wprm-shortcode-builder select{width:250px}
1
+ .wprm-frame-title .dashicons,.wprm-frame.hide-router .wprm-frame-router,.wprm-modal-container{display:none}.wprm-giveaway-notice{border:1px solid #006400;background-color:rgba(0,255,0,.15);padding:10px;margin-bottom:10px}.wprm-easyrecipe-warning{display:none;border:1px solid #8b0000;background-color:rgba(255,0,0,.15);padding:10px 10px 0;margin-bottom:10px}.select2_wprm-container{z-index:100075}.select2_wprm-container.select2_wprm-container--focus .select2_wprm-selection{border-color:#5b9dd9}.select2_wprm-container li{margin:0}.select2_wprm-container .select2_wprm-selection{border-color:#ddd}.medium-editor-anchor-preview,.medium-editor-toolbar{z-index:100080}.medium-editor-anchor-preview{font-size:12px}.medium-editor-element{border:1px solid #ddd;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.07);box-shadow:inset 0 1px 2px rgba(0,0,0,.07);min-height:68px;padding:3px 5px}.medium-editor-element:focus{border-color:#5b9dd9;-webkit-box-shadow:0 0 2px rgba(30,140,190,.8);box-shadow:0 0 2px rgba(30,140,190,.8)}.medium-editor-element:after{font-style:normal;color:#999;opacity:.5;font-size:14px;line-height:28px}.medium-editor-element p:first-child{margin-top:0}.medium-editor-element p:last-child{margin-bottom:0}.wprm-modal-hint{max-width:400px;margin-bottom:20px}.wprm-modal-hint .wprm-modal-hint-header{font-weight:700;font-variant:small-caps}.wprm-modal-hint .wprm-modal-hint-text{font-style:italic}.wprm-modal-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;min-height:360px;background:#000;opacity:.7;z-index:100000}.wprm-modal{position:fixed;top:30px;left:30px;right:30px;bottom:30px;z-index:100050}.wprm-modal *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.wprm-modal-close{position:absolute;top:0;right:0;width:50px;height:50px;padding:0;z-index:1000;-webkit-transition:color .1s ease-in-out,background .1s ease-in-out;transition:color .1s ease-in-out,background .1s ease-in-out}.wprm-modal-close .wprm-modal-icon:before{content:"\f158";font:400 20px/1 dashicons;speak:none;vertical-align:middle;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:#666}.wprm-modal-content{position:absolute;top:0;left:0;right:0;bottom:0;overflow:auto;min-height:300px;-webkit-box-shadow:0 5px 15px rgba(0,0,0,.7);box-shadow:0 5px 15px rgba(0,0,0,.7);background:#fcfcfc;-webkit-font-smoothing:subpixel-antialiased}.wprm-modal-content ::-webkit-input-placeholder{color:#999;opacity:.5}.wprm-modal-content :-moz-placeholder{color:#999;opacity:.5}.wprm-modal-content ::-moz-placeholder{color:#999;opacity:.5}.wprm-modal-content :-ms-input-placeholder{color:#999;opacity:.5}.wprm-frame{overflow:hidden;right:0}.wprm-frame,.wprm-frame-menu{position:absolute;left:0;bottom:0;top:0}.wprm-frame-menu{width:200px;z-index:150}.wprm-frame-title{top:0;height:50px}.wprm-frame-router,.wprm-frame-title{z-index:200;left:200px;position:absolute;right:0}.wprm-menu-item{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.wprm-menu{position:absolute;left:0;margin:0;padding:10px 0;border-right-width:1px;border-right-style:solid;border-right-color:#ccc;user-select:none}.wprm-menu-hidden{padding:5px 5px 0 10px;font-style:italic}.wprm-menu,.wprm-sidebar{top:0;bottom:0;background:#f3f3f3;right:0}.wprm-menu .active,.wprm-menu .active:hover{color:#23282d;font-weight:700}.wprm-menu>a{display:block;position:relative;padding:8px 20px;margin:0;color:#0073aa}.wprm-button-action-save,.wprm-frame .hidden,.wprm-frame-content-tab:not(.active),.wprm-router:not(.active){display:none}.wprm-menu>a,.wprm-router>a{line-height:18px;font-size:14px;text-decoration:none}.wprm-frame a{border-bottom:none;color:#0073aa}.wprm-menu .separator{height:0;margin:12px 20px;padding:0;border-top:1px solid #ddd}.wprm-frame-title h1{padding:0 16px;font-size:22px;line-height:50px;margin:0}.wprm-frame-router{top:50px;height:36px}.wprm-router{position:relative;padding:0 6px;margin:0;clear:both;user-select:none}.wprm-router>a{position:relative;float:left;padding:8px 10px 9px;margin:0;height:18px}.wprm-router a{-webkit-transition:none;transition:none}.wprm-router>a:last-child{border-right:0}.wprm-router .active,.wprm-router>a.active:last-child{margin:-1px -1px 0;background:#fff;border:1px solid #ddd;border-bottom:none}.wprm-router .active,.wprm-router .active:hover{color:#32373c}.wprm-frame-content{position:absolute;top:84px;left:200px;right:0;bottom:61px;height:auto;width:auto;margin:0;overflow:auto;background:#fff;border-top:1px solid #ddd;border-bottom:1px solid #ddd}.wprm-frame-toolbar,.wprm-toolbar{position:absolute;right:0;z-index:100;height:60px}.wprm-frame-content-tab{margin:20px}.wprm-frame-toolbar{left:200px;bottom:0}.wprm-toolbar{top:0;left:0;padding:0 16px;border:0 solid #ddd;overflow:hidden}.wprm-modal-content .wprm-toolbar-primary.search-form{width:33%}.wprm-toolbar-primary{float:right;height:100%}.wprm-modal-content .wprm-toolbar-primary .wprm-button{float:right}.wprm-toolbar-primary>.wprm-button,.wprm-toolbar-primary>.wprm-button-group{margin-left:10px;float:left;margin-top:15px}@media only screen and (max-width:900px){.wprm-frame:not(.hide-menu) .wprm-frame-title .dashicons{display:inline-block;line-height:50px}.wprm-frame:not(.hide-menu) .wprm-frame-menu{position:static;width:0}.wprm-frame:not(.hide-menu) .wprm-frame-content,.wprm-frame:not(.hide-menu) .wprm-frame-router,.wprm-frame:not(.hide-menu) .wprm-frame-title,.wprm-frame:not(.hide-menu) .wprm-frame-toolbar,.wprm-frame:not(.hide-menu) .wprm-menu.visible{left:0}.wprm-frame:not(.hide-menu) .wprm-menu{width:auto;max-width:80%;overflow:auto;z-index:2000;top:50px;left:-300px;right:auto;bottom:auto;padding:5px 0;border:1px solid #ccc}.wprm-frame:not(.hide-menu) .wprm-menu>a.active{display:none}.wprm-frame:not(.hide-menu) .wprm-menu>a{padding:12px 16px;font-size:16px}.wprm-frame:not(.hide-menu) .wprm-menu .separator{margin:5px 10px}.wprm-frame:not(.hide-menu) .wprm-frame-title h1{color:#0073aa;line-height:3;font-size:18px;float:left;cursor:pointer}}@media only screen and (max-width:640px),screen and (max-height:400px){.wprm-modal{position:fixed;top:0;left:0;right:0;bottom:0}.wprm-modal .wprm-frame-title{height:40px}}@media only screen and (max-width:480px){.wprm-frame:not(.hide-menu) .wprm-frame-title .dashicons{line-height:40px}.wprm-frame-router,.wprm-frame:not(.hide-menu) .wprm-menu{top:40px}.wprm-frame:not(.hide-menu) .wprm-frame-title h1,.wprm-modal .wprm-frame-title h1{font-size:18px;line-height:40px}.wprm-frame-content{top:74px}}.wprm-recipe-form{max-width:600px}.wprm-recipe-form .wprm-recipe-form-container{margin-bottom:15px;vertical-align:top}.wprm-recipe-form .wprm-recipe-form-container-halfs{display:inline-block;width:50%}.wprm-recipe-form .wprm-recipe-form-container-thirds{display:inline-block;width:33.3%}.wprm-recipe-form label{display:block;font-weight:700;margin-bottom:5px}.wprm-recipe-form input[type=text],.wprm-recipe-form input[type=number]{margin:0;width:100%;max-width:120px;height:34px;line-height:34px}.wprm-recipe-form input[type=text][type=number],.wprm-recipe-form input[type=number][type=number]{max-width:50px}.wprm-recipe-form input[type=text].select2_wprm-search__field,.wprm-recipe-form input[type=number].select2_wprm-search__field{height:18px;line-height:18px}.wprm-recipe-form select{width:100%}.wprm-recipe-form textarea{width:100%;resize:vertical}@media only screen and (max-width:480px){.wprm-recipe-form .wprm-recipe-form-container-halfs,.wprm-recipe-form .wprm-recipe-form-container-thirds{display:block;width:100%}}.wprm-recipe-import-text-form .import-text-buttons{margin-bottom:10px}.wprm-recipe-import-text-form .import-text-step{display:none}.wprm-recipe-import-text-form .import-text-step#import-text-step-input{display:block}.wprm-recipe-import-text-form #import-text-highlight-sandbox,.wprm-recipe-import-text-form .import-text-input{margin-top:10px}.wprm-recipe-import-text-form #import-text-ingredient-groups label,.wprm-recipe-import-text-form #import-text-instruction-groups label{display:inline;font-weight:400}.wprm-recipe-import-text-form .import-text-group-warning{margin-top:10px;display:none}.wprm-recipe-import-text-form #import-text-highlight-sandbox{display:none;max-height:400px;overflow:scroll;padding:10px;border:1px dashed #999}.wprm-loader,.wprm-loader:after,.wprm-loader:before{border-radius:50%;width:1.5em;height:1.5em;-webkit-animation:load7 1.8s infinite ease-in-out;animation:load7 1.8s infinite ease-in-out}.wprm-loader{display:none;color:#444;font-size:10px;margin:20px auto;position:relative;text-indent:-9999em;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0);-webkit-animation-delay:-.16s;animation-delay:-.16s}.wprm-loader:after,.wprm-loader:before{content:'';position:absolute;top:0}.wprm-loader:before{left:-2.5em;-webkit-animation-delay:-.32s;animation-delay:-.32s}.wprm-loader:after{left:2.5em}@-webkit-keyframes load7{0%,100%,80%{box-shadow:0 2.5em 0 -1.3em}40%{box-shadow:0 2.5em 0 0}}@keyframes load7{0%,100%,80%{box-shadow:0 2.5em 0 -1.3em}40%{box-shadow:0 2.5em 0 0}}.wprm-recipe-details-form input#wprm-recipe-name{max-width:450px}.wprm-recipe-details-form input#wprm-recipe-author-link,.wprm-recipe-details-form input#wprm-recipe-author-name{max-width:none}.wprm-recipe-details-form input#wprm-recipe-calories{max-width:70px}.wprm-recipe-details-form .wprm-recipe-image-preview{float:right;max-width:100px}.wprm-recipe-details-form .wprm-recipe-image-preview img{max-width:100%;height:auto}.wprm-recipe-details-form .wprm-recipe-summary-container{clear:both}@media only screen and (max-width:480px){.wprm-recipe-details-form .wprm-recipe-image-preview{float:none;margin:10px auto}}.wprm-recipe-ingredients-form,.wprm-recipe-instructions-form{max-width:750px;margin-bottom:15px}.wprm-recipe-ingredients-form input,.wprm-recipe-instructions-form input{margin:0;width:100%;height:34px;line-height:34px}.wprm-recipe-ingredients-form textarea,.wprm-recipe-instructions-form textarea{width:100%;resize:vertical}.wprm-recipe-ingredients-form ::-webkit-input-placeholder,.wprm-recipe-instructions-form ::-webkit-input-placeholder{color:#999;opacity:.5}.wprm-recipe-ingredients-form :-moz-placeholder,.wprm-recipe-instructions-form :-moz-placeholder{color:#999;opacity:.5}.wprm-recipe-ingredients-form ::-moz-placeholder,.wprm-recipe-instructions-form ::-moz-placeholder{color:#999;opacity:.5}.wprm-recipe-ingredients-form :-ms-input-placeholder,.wprm-recipe-instructions-form :-ms-input-placeholder{color:#999;opacity:.5}.wprm-recipe-ingredients-form table,.wprm-recipe-instructions-form table{width:100%}.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th,.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th{text-align:left}.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th:nth-child(1),.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th:nth-child(6),.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th:nth-child(1),.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th:nth-child(6){width:5%;text-align:center}.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th:nth-child(2),.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th:nth-child(2){width:10%}.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th:nth-child(3),.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th:nth-child(3){width:15%}.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th:nth-child(4),.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th:nth-child(4){width:40%}.wprm-recipe-ingredients-form table.wprm-recipe-ingredients-container th:nth-child(5),.wprm-recipe-instructions-form table.wprm-recipe-ingredients-container th:nth-child(5){width:25%}.wprm-recipe-ingredients-form table.wprm-recipe-instructions-container th,.wprm-recipe-instructions-form table.wprm-recipe-instructions-container th{text-align:left}.wprm-recipe-ingredients-form table.wprm-recipe-instructions-container th:nth-child(1),.wprm-recipe-ingredients-form table.wprm-recipe-instructions-container th:nth-child(4),.wprm-recipe-instructions-form table.wprm-recipe-instructions-container th:nth-child(1),.wprm-recipe-instructions-form table.wprm-recipe-instructions-container th:nth-child(4){width:5%;text-align:center}.wprm-recipe-ingredients-form table.wprm-recipe-instructions-container th:nth-child(2),.wprm-recipe-instructions-form table.wprm-recipe-instructions-container th:nth-child(2){width:65%}.wprm-recipe-ingredients-form table.wprm-recipe-instructions-container th:nth-child(3),.wprm-recipe-instructions-form table.wprm-recipe-instructions-container th:nth-child(3){width:25%}.wprm-recipe-ingredients-form table .wprm-recipe-ingredients-placeholder,.wprm-recipe-ingredients-form table .wprm-recipe-instructions-placeholder,.wprm-recipe-instructions-form table .wprm-recipe-ingredients-placeholder,.wprm-recipe-instructions-form table .wprm-recipe-instructions-placeholder{display:none}.wprm-recipe-ingredients-form table td,.wprm-recipe-instructions-form table td{text-align:left;vertical-align:top}.wprm-recipe-ingredients-form table td:first-child,.wprm-recipe-ingredients-form table td:last-child,.wprm-recipe-instructions-form table td:first-child,.wprm-recipe-instructions-form table td:last-child{text-align:center;vertical-align:middle}.wprm-recipe-ingredients-form .ui-sortable-helper,.wprm-recipe-instructions-form .ui-sortable-helper{display:table}.wprm-recipe-ingredients-form .ui-sortable-helper .wprm-recipe-instruction-text,.wprm-recipe-instructions-form .ui-sortable-helper .wprm-recipe-instruction-text{min-width:200px}.wprm-recipe-ingredients-form .wprm-recipe-ingredients-instructions-sort,.wprm-recipe-instructions-form .wprm-recipe-ingredients-instructions-sort{cursor:move}.wprm-recipe-ingredients-form .wprm-recipe-ingredients-instructions-delete,.wprm-recipe-instructions-form .wprm-recipe-ingredients-instructions-delete{cursor:pointer}.wprm-recipe-ingredients-form .wprm-recipe-ingredients-instructions-delete,.wprm-recipe-ingredients-form .wprm-recipe-ingredients-instructions-sort,.wprm-recipe-instructions-form .wprm-recipe-ingredients-instructions-delete,.wprm-recipe-instructions-form .wprm-recipe-ingredients-instructions-sort{color:#999;opacity:.5}.wprm-recipe-ingredients-form .wprm-recipe-ingredients-instructions-delete:hover,.wprm-recipe-ingredients-form .wprm-recipe-ingredients-instructions-sort:hover,.wprm-recipe-instructions-form .wprm-recipe-ingredients-instructions-delete:hover,.wprm-recipe-instructions-form .wprm-recipe-ingredients-instructions-sort:hover{color:#444;opacity:1}.wprm-recipe-ingredients-form .wprm-recipe-ingredients-actions,.wprm-recipe-ingredients-form .wprm-recipe-instructions-actions,.wprm-recipe-instructions-form .wprm-recipe-ingredients-actions,.wprm-recipe-instructions-form .wprm-recipe-instructions-actions{margin:10px}.wprm-recipe-ingredients-form .wprm-recipe-image-preview,.wprm-recipe-instructions-form .wprm-recipe-image-preview{max-width:75px}.wprm-recipe-ingredients-form .wprm-recipe-image-preview img,.wprm-recipe-instructions-form .wprm-recipe-image-preview img{max-width:100%;height:auto}.wprm-shortcode-builder .wprm-shortcode-builder-container{margin-bottom:15px;vertical-align:top}.wprm-shortcode-builder .wprm-shortcode-builder-container-halfs{display:inline-block;width:50%}.wprm-shortcode-builder .wprm-shortcode-builder-container-thirds{display:inline-block;width:33.3%}.wprm-shortcode-builder label{display:block;font-weight:700;margin-bottom:5px}.wprm-shortcode-builder .wprm-shortcode-builder-helper{margin-left:5px;font-size:.8em;font-style:italic}.wprm-shortcode-builder input{margin:0;width:100%;max-width:250px;height:34px;line-height:34px}.wprm-shortcode-builder input.select2_wprm-search__field{height:18px;line-height:18px}.wprm-shortcode-builder select{width:250px}
assets/css/admin/modal/_container.scss CHANGED
@@ -387,6 +387,10 @@
387
  float: right;
388
  }
389
 
 
 
 
 
390
  .wprm-toolbar-primary > .wprm-button,
391
  .wprm-toolbar-primary > .wprm-button-group {
392
  margin-left: 10px;
387
  float: right;
388
  }
389
 
390
+ .wprm-button-action-save {
391
+ display: none;
392
+ }
393
+
394
  .wprm-toolbar-primary > .wprm-button,
395
  .wprm-toolbar-primary > .wprm-button-group {
396
  margin-left: 10px;
assets/css/admin/modal/_recipe-details.scss CHANGED
@@ -5,7 +5,8 @@
5
  max-width: 450px;
6
  }
7
 
8
- &#wprm-recipe-author-name {
 
9
  max-width: none;
10
  }
11
 
5
  max-width: 450px;
6
  }
7
 
8
+ &#wprm-recipe-author-name,
9
+ &#wprm-recipe-author-link {
10
  max-width: none;
11
  }
12
 
assets/js/admin/import.js CHANGED
@@ -99,7 +99,7 @@ jQuery(document).ready(function($) {
99
  });
100
 
101
  // Edit imported recipe
102
- jQuery(document).on('click', '.wprm-manage-recipes-actions-edit', function(e) {
103
  e.preventDefault();
104
 
105
  var id = jQuery(this).data('id');
99
  });
100
 
101
  // Edit imported recipe
102
+ jQuery(document).on('click', '.wprm-import-recipes-actions-edit', function(e) {
103
  e.preventDefault();
104
 
105
  var id = jQuery(this).data('id');
assets/js/admin/modal.js CHANGED
@@ -120,6 +120,13 @@ jQuery(document).ready(function($) {
120
 
121
  // Change main title
122
  jQuery('.wprm-frame-title').find('h1').text(menu_item.text());
 
 
 
 
 
 
 
123
  });
124
 
125
  // Modal Menu on Mobile
@@ -140,8 +147,15 @@ jQuery(document).ready(function($) {
140
  // Hide action button if no callback is set
141
  if (menu_item.data('callback')) {
142
  jQuery('.wprm-button-action').text(tab_button).show();
 
 
 
 
 
 
143
  } else {
144
  jQuery('.wprm-button-action').hide();
 
145
  }
146
 
147
  // Show correct tab
120
 
121
  // Change main title
122
  jQuery('.wprm-frame-title').find('h1').text(menu_item.text());
123
+
124
+ // // Show save button for recipes
125
+ // if ('recipe' == menu_target) {
126
+ // jQuery('.wprm-button-action-save').show();
127
+ // } else {
128
+ // jQuery('.wprm-button-action-save').hide();
129
+ // }
130
  });
131
 
132
  // Modal Menu on Mobile
147
  // Hide action button if no callback is set
148
  if (menu_item.data('callback')) {
149
  jQuery('.wprm-button-action').text(tab_button).show();
150
+
151
+ if('wprm-menu-recipe' == menu_item.parents('.wprm-router').attr('id')) {
152
+ jQuery('.wprm-button-action-save').show();
153
+ } else {
154
+ jQuery('.wprm-button-action-save').hide();
155
+ }
156
  } else {
157
  jQuery('.wprm-button-action').hide();
158
+ jQuery('.wprm-button-action-save').hide();
159
  }
160
 
161
  // Show correct tab
assets/js/admin/recipe-form.js CHANGED
@@ -4,29 +4,69 @@ wprm_admin.cook_time_set = false;
4
  wprm_admin.total_time_set = false;
5
 
6
  wprm_admin.editing_recipe = 0;
 
 
 
 
 
7
  wprm_admin.set_recipe = function(args) {
8
  var recipe_id = args.recipe_id ? args.recipe_id : 0;
 
9
 
10
  wprm_admin.editing_recipe = recipe_id;
 
 
 
 
 
11
  wprm_admin.clear_recipe_fields();
12
  if(typeof wprmp_admin !== 'undefined') {
13
  wprmp_admin.clear_recipe_fields();
14
  }
15
 
16
- if (recipe_id == 0) {
17
- var button = jQuery('.wprm-button-action');
 
18
 
19
  jQuery('.wprm-router.active').find('.wprm-menu-item').each(function() {
20
  jQuery(this).data('button', wprm_modal.text.action_button_insert);
21
  });
22
  button.text(wprm_modal.text.action_button_insert);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  } else {
24
- var button = jQuery('.wprm-button-action');
 
25
 
26
  jQuery('.wprm-router.active').find('.wprm-menu-item').each(function() {
27
  jQuery(this).data('button', wprm_modal.text.action_button_update);
28
  });
29
  button.text(wprm_modal.text.action_button_update);
 
30
 
31
  wprm_admin.disable_menu();
32
 
@@ -37,11 +77,15 @@ wprm_admin.set_recipe = function(args) {
37
  };
38
 
39
  wprm_admin.start_loader(button);
 
40
 
41
  jQuery.post(wprm_modal.ajax_url, data, function(out) {
42
  wprm_admin.stop_loader(button);
 
43
 
44
  if (out.success) {
 
 
45
  wprm_admin.set_recipe_fields(out.data.recipe);
46
  if(typeof wprmp_admin !== 'undefined') {
47
  wprmp_admin.set_recipe_fields(out.data.recipe);
@@ -80,6 +124,7 @@ wprm_admin.clear_recipe_fields = function() {
80
  wprm_admin.rich_editor.resetContent(''); // Recipe summary
81
  jQuery('#wprm-recipe-author-display').val('disabled').change();
82
  jQuery('#wprm-recipe-author-name').val('');
 
83
  jQuery('#wprm-recipe-servings').val('');
84
  jQuery('#wprm-recipe-servings-unit').val('');
85
  jQuery('#wprm-recipe-calories').val('');
@@ -128,6 +173,7 @@ wprm_admin.set_recipe_fields = function(recipe) {
128
 
129
  jQuery('#wprm-recipe-author-display').val(recipe.author_display).change();
130
  jQuery('#wprm-recipe-author-name').val(recipe.author_name);
 
131
 
132
  var servings = parseInt(recipe.servings) > 0 ? parseInt(recipe.servings) : '',
133
  calories = recipe.nutrition.calories ? parseFloat(recipe.nutrition.calories) : '',
@@ -180,7 +226,8 @@ wprm_admin.set_recipe_ingredient_fields = function(ingredients) {
180
 
181
  for (j = 0, m = group.ingredients.length; j < m; j++) {
182
  var ingredient = group.ingredients[j];
183
- wprm_admin.add_ingredient(ingredient.amount, ingredient.unit, ingredient.name, ingredient.notes);
 
184
  }
185
  }
186
  };
@@ -201,7 +248,8 @@ wprm_admin.set_recipe_instruction_fields = function(instructions) {
201
 
202
  for (j = 0, m = group.instructions.length; j < m; j++) {
203
  var instruction = group.instructions[j];
204
- wprm_admin.add_instruction(instruction.text, instruction.image);
 
205
  }
206
  }
207
  };
@@ -286,6 +334,15 @@ wprm_admin.add_ingredient = function(amount, unit, name, notes) {
286
  clone.find('.wprm-recipe-ingredient-unit').val(unit);
287
  clone.find('.wprm-recipe-ingredient-name').val(name);
288
  clone.find('.wprm-recipe-ingredient-notes').val(notes);
 
 
 
 
 
 
 
 
 
289
  };
290
 
291
  wprm_admin.add_ingredient_group = function(name) {
@@ -328,6 +385,15 @@ wprm_admin.add_instruction = function(text, image_id) {
328
  }
329
  }, 'json');
330
  }
 
 
 
 
 
 
 
 
 
331
  };
332
 
333
  wprm_admin.add_instruction_group = function(name) {
@@ -346,6 +412,7 @@ wprm_admin.insert_update_recipe = function(button) {
346
  summary: jQuery('#wprm-recipe-summary').val(),
347
  author_display: jQuery('#wprm-recipe-author-display').val(),
348
  author_name: jQuery('#wprm-recipe-author-name').val(),
 
349
  servings: jQuery('#wprm-recipe-servings').val(),
350
  servings_unit: jQuery('#wprm-recipe-servings-unit').val(),
351
  prep_time: jQuery('#wprm-recipe-prep-time').val(),
@@ -417,13 +484,20 @@ wprm_admin.insert_update_recipe = function(button) {
417
  recipe: recipe
418
  };
419
 
 
420
  wprm_admin.start_loader(button);
421
 
422
  jQuery.post(wprm_modal.ajax_url, data, function(out) {
423
  wprm_admin.stop_loader(button);
 
424
 
425
  if (out.success) {
426
- if (wprm_admin.editing_recipe === 0) {
 
 
 
 
 
427
  wprm_admin.add_text_to_editor('[wprm-recipe id="' + out.data.id + '"]');
428
  } else if(wprm_admin.active_editor_id) {
429
  // Refresh content in editor to reload recipe preview
@@ -438,6 +512,7 @@ wprm_admin.insert_update_recipe = function(button) {
438
  }
439
 
440
  wprm_admin.close_modal();
 
441
  }
442
  }, 'json');
443
  };
@@ -459,12 +534,37 @@ wprm_admin.get_ingredients = function() {
459
  ingredients: []
460
  };
461
  } else {
462
- ingredient_group.ingredients.push({
463
- amount: row.find('.wprm-recipe-ingredient-amount').val(),
464
- unit: row.find('.wprm-recipe-ingredient-unit').val(),
465
- name: row.find('.wprm-recipe-ingredient-name').val(),
466
- notes: row.find('.wprm-recipe-ingredient-notes').val()
467
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
468
  }
469
  });
470
 
@@ -497,8 +597,10 @@ jQuery(document).ready(function($) {
497
 
498
  if(author_display == 'custom' || (author_display == 'default' && default_display == 'custom')) {
499
  jQuery('#wprm-recipe-author-name-container').show();
 
500
  } else {
501
  jQuery('#wprm-recipe-author-name-container').hide();
 
502
  }
503
  });
504
  jQuery('#wprm-recipe-author-display').change();
@@ -574,4 +676,9 @@ jQuery(document).ready(function($) {
574
  cursor: 'move',
575
  handle: '.wprm-recipe-ingredients-instructions-sort',
576
  });
 
 
 
 
 
577
  });
4
  wprm_admin.total_time_set = false;
5
 
6
  wprm_admin.editing_recipe = 0;
7
+ wprm_admin.editing_recipe_type = 'insert';
8
+ wprm_admin.editing_recipe_fields = false;
9
+ wprm_admin.editing_recipe_ingredients = {};
10
+ wprm_admin.editing_recipe_instructions = {};
11
+
12
  wprm_admin.set_recipe = function(args) {
13
  var recipe_id = args.recipe_id ? args.recipe_id : 0;
14
+ var clone_recipe_id = args.clone_recipe_id ? args.clone_recipe_id : 0;
15
 
16
  wprm_admin.editing_recipe = recipe_id;
17
+ wprm_admin.editing_recipe_type = 0 === recipe_id ? 'insert' : 'update';
18
+ wprm_admin.editing_recipe_fields = false;
19
+ wprm_admin.editing_recipe_ingredients = {};
20
+ wprm_admin.editing_recipe_instructions = {};
21
+
22
  wprm_admin.clear_recipe_fields();
23
  if(typeof wprmp_admin !== 'undefined') {
24
  wprmp_admin.clear_recipe_fields();
25
  }
26
 
27
+ if ('insert' === wprm_admin.editing_recipe_type) {
28
+ var button = jQuery('.wprm-button-action'),
29
+ button_save = jQuery('.wprm-button-action-save');
30
 
31
  jQuery('.wprm-router.active').find('.wprm-menu-item').each(function() {
32
  jQuery(this).data('button', wprm_modal.text.action_button_insert);
33
  });
34
  button.text(wprm_modal.text.action_button_insert);
35
+ button_save.show();
36
+
37
+ if(clone_recipe_id) {
38
+ var data = {
39
+ action: 'wprm_get_recipe',
40
+ security: wprm_modal.nonce,
41
+ recipe_id: clone_recipe_id
42
+ };
43
+
44
+ wprm_admin.start_loader(button);
45
+ wprm_admin.start_loader(button_save);
46
+
47
+ jQuery.post(wprm_modal.ajax_url, data, function(out) {
48
+ wprm_admin.stop_loader(button);
49
+ wprm_admin.stop_loader(button_save);
50
+
51
+ if (out.success) {
52
+ wprm_admin.editing_recipe_fields = out.data.recipe;
53
+
54
+ wprm_admin.set_recipe_fields(out.data.recipe);
55
+ if(typeof wprmp_admin !== 'undefined') {
56
+ wprmp_admin.set_recipe_fields(out.data.recipe);
57
+ }
58
+ }
59
+ }, 'json');
60
+ }
61
  } else {
62
+ var button = jQuery('.wprm-button-action'),
63
+ button_save = jQuery('.wprm-button-action-save');
64
 
65
  jQuery('.wprm-router.active').find('.wprm-menu-item').each(function() {
66
  jQuery(this).data('button', wprm_modal.text.action_button_update);
67
  });
68
  button.text(wprm_modal.text.action_button_update);
69
+ button_save.show();
70
 
71
  wprm_admin.disable_menu();
72
 
77
  };
78
 
79
  wprm_admin.start_loader(button);
80
+ wprm_admin.start_loader(button_save);
81
 
82
  jQuery.post(wprm_modal.ajax_url, data, function(out) {
83
  wprm_admin.stop_loader(button);
84
+ wprm_admin.stop_loader(button_save);
85
 
86
  if (out.success) {
87
+ wprm_admin.editing_recipe_fields = out.data.recipe;
88
+
89
  wprm_admin.set_recipe_fields(out.data.recipe);
90
  if(typeof wprmp_admin !== 'undefined') {
91
  wprmp_admin.set_recipe_fields(out.data.recipe);
124
  wprm_admin.rich_editor.resetContent(''); // Recipe summary
125
  jQuery('#wprm-recipe-author-display').val('disabled').change();
126
  jQuery('#wprm-recipe-author-name').val('');
127
+ jQuery('#wprm-recipe-author-link').val('');
128
  jQuery('#wprm-recipe-servings').val('');
129
  jQuery('#wprm-recipe-servings-unit').val('');
130
  jQuery('#wprm-recipe-calories').val('');
173
 
174
  jQuery('#wprm-recipe-author-display').val(recipe.author_display).change();
175
  jQuery('#wprm-recipe-author-name').val(recipe.author_name);
176
+ jQuery('#wprm-recipe-author-link').val(recipe.author_link);
177
 
178
  var servings = parseInt(recipe.servings) > 0 ? parseInt(recipe.servings) : '',
179
  calories = recipe.nutrition.calories ? parseFloat(recipe.nutrition.calories) : '',
226
 
227
  for (j = 0, m = group.ingredients.length; j < m; j++) {
228
  var ingredient = group.ingredients[j];
229
+ var uid = wprm_admin.add_ingredient(ingredient.amount, ingredient.unit, ingredient.name, ingredient.notes);
230
+ wprm_admin.editing_recipe_ingredients[uid] = ingredient;
231
  }
232
  }
233
  };
248
 
249
  for (j = 0, m = group.instructions.length; j < m; j++) {
250
  var instruction = group.instructions[j];
251
+ var uid = wprm_admin.add_instruction(instruction.text, instruction.image);
252
+ wprm_admin.editing_recipe_instructions[uid] = instruction;
253
  }
254
  }
255
  };
334
  clone.find('.wprm-recipe-ingredient-unit').val(unit);
335
  clone.find('.wprm-recipe-ingredient-name').val(name);
336
  clone.find('.wprm-recipe-ingredient-notes').val(notes);
337
+
338
+ while(true) {
339
+ var uid = Math.floor(Math.random() * 99999);
340
+ if(!wprm_admin.editing_recipe_ingredients.hasOwnProperty(uid)) {
341
+ clone.data('uid', uid);
342
+ wprm_admin.editing_recipe_ingredients[uid] = {};
343
+ return uid;
344
+ }
345
+ }
346
  };
347
 
348
  wprm_admin.add_ingredient_group = function(name) {
385
  }
386
  }, 'json');
387
  }
388
+
389
+ while(true) {
390
+ var uid = Math.floor(Math.random() * 99999);
391
+ if(!wprm_admin.editing_recipe_instructions.hasOwnProperty(uid)) {
392
+ clone.data('uid', uid);
393
+ wprm_admin.editing_recipe_instructions[uid] = {};
394
+ return uid;
395
+ }
396
+ }
397
  };
398
 
399
  wprm_admin.add_instruction_group = function(name) {
412
  summary: jQuery('#wprm-recipe-summary').val(),
413
  author_display: jQuery('#wprm-recipe-author-display').val(),
414
  author_name: jQuery('#wprm-recipe-author-name').val(),
415
+ author_link: jQuery('#wprm-recipe-author-link').val(),
416
  servings: jQuery('#wprm-recipe-servings').val(),
417
  servings_unit: jQuery('#wprm-recipe-servings-unit').val(),
418
  prep_time: jQuery('#wprm-recipe-prep-time').val(),
484
  recipe: recipe
485
  };
486
 
487
+ jQuery('.wprm-button-action-save').prop('disabled', true);
488
  wprm_admin.start_loader(button);
489
 
490
  jQuery.post(wprm_modal.ajax_url, data, function(out) {
491
  wprm_admin.stop_loader(button);
492
+ jQuery('.wprm-button-action-save').prop('disabled', false);
493
 
494
  if (out.success) {
495
+ if (wprm_admin.editing_recipe === 0) {
496
+ wprm_admin.editing_recipe = out.data.id;
497
+ }
498
+
499
+ if(!button.hasClass('wprm-button-action-save')) {
500
+ if ('insert' === wprm_admin.editing_recipe_type) {
501
  wprm_admin.add_text_to_editor('[wprm-recipe id="' + out.data.id + '"]');
502
  } else if(wprm_admin.active_editor_id) {
503
  // Refresh content in editor to reload recipe preview
512
  }
513
 
514
  wprm_admin.close_modal();
515
+ }
516
  }
517
  }, 'json');
518
  };
534
  ingredients: []
535
  };
536
  } else {
537
+ var uid = row.data('uid'),
538
+ ingredient = {};
539
+
540
+ // Get original values.
541
+ if(wprm_admin.editing_recipe_ingredients.hasOwnProperty(uid)) {
542
+ ingredient = wprm_admin.editing_recipe_ingredients[uid];
543
+ }
544
+
545
+ // Update ingredients.
546
+ ingredient['amount'] = row.find('.wprm-recipe-ingredient-amount').val();
547
+ ingredient['unit'] = row.find('.wprm-recipe-ingredient-unit').val();
548
+ ingredient['name'] = row.find('.wprm-recipe-ingredient-name').val();
549
+ ingredient['notes'] = row.find('.wprm-recipe-ingredient-notes').val();
550
+
551
+ // Unit Conversion.
552
+ var converted = jQuery('#wprm-ingredient-conversion-' + uid);
553
+
554
+ if (converted.length > 0) {
555
+ var amount = converted.find('.wprmuc-system-2-amount').val(),
556
+ unit = converted.find('.wprmuc-system-2-unit').val();
557
+
558
+ ingredient['converted'] = {
559
+ 2: {
560
+ amount: amount,
561
+ unit: unit,
562
+ }
563
+ };
564
+ }
565
+
566
+ // Add ingredient to group.
567
+ ingredient_group.ingredients.push(ingredient);
568
  }
569
  });
570
 
597
 
598
  if(author_display == 'custom' || (author_display == 'default' && default_display == 'custom')) {
599
  jQuery('#wprm-recipe-author-name-container').show();
600
+ jQuery('#wprm-recipe-author-link-container').show();
601
  } else {
602
  jQuery('#wprm-recipe-author-name-container').hide();
603
+ jQuery('#wprm-recipe-author-link-container').hide();
604
  }
605
  });
606
  jQuery('#wprm-recipe-author-display').change();
676
  cursor: 'move',
677
  handle: '.wprm-recipe-ingredients-instructions-sort',
678
  });
679
+
680
+ // Save recipe button.
681
+ jQuery('.wprm-button-action-save').on('click', function() {
682
+ wprm_admin.insert_update_recipe(jQuery(this));
683
+ });
684
  });
assets/js/admin/rich-editor.js CHANGED
@@ -102,7 +102,6 @@ wprm_admin.rich_editor_timer = MediumEditor.Extension.extend({
102
 
103
  // Source: medium-editor.js
104
  MediumEditor.prototype.createLink = function (opts) {
105
- console.log(opts);
106
  var currentEditor = MediumEditor.selection.getSelectionElement(this.options.contentWindow),
107
  customEvent = {},
108
  targetUrl;
102
 
103
  // Source: medium-editor.js
104
  MediumEditor.prototype.createLink = function (opts) {
 
105
  var currentEditor = MediumEditor.selection.getSelectionElement(this.options.contentWindow),
106
  customEvent = {},
107
  targetUrl;
assets/js/public/print.js CHANGED
@@ -1,11 +1,12 @@
1
  var wprm = wprm || {};
2
 
3
- wprm.print_recipe = function(recipe_id, servings) {
4
  var print_window = window.open(wprm_public.home_url + 'wprm_print/' + recipe_id, '_blank');
5
  print_window.onload = function() {
6
  print_window.focus();
7
  print_window.document.title = document.title;
8
  print_window.history.pushState('', 'Print Recipe', location.href.replace(location.hash,""));
 
9
  print_window.wprm.set_print_servings(servings);
10
  print_window.print();
11
  };
@@ -17,13 +18,19 @@ jQuery(document).ready(function($) {
17
 
18
  var recipe = jQuery(this).parents('.wprm-recipe-container'),
19
  servings = parseInt(recipe.find('.wprm-recipe-servings').data('servings')),
 
20
  recipe_id = recipe.data('recipe-id');
21
- wprm.print_recipe(recipe_id, servings);
 
 
 
 
 
22
  });
23
  jQuery('.wprm-print-recipe-shortcode').on('click', function(e) {
24
  e.preventDefault();
25
 
26
  var recipe_id = jQuery(this).data('recipe-id');
27
- wprm.print_recipe(recipe_id, false);
28
  });
29
  });
1
  var wprm = wprm || {};
2
 
3
+ wprm.print_recipe = function(recipe_id, servings, system) {
4
  var print_window = window.open(wprm_public.home_url + 'wprm_print/' + recipe_id, '_blank');
5
  print_window.onload = function() {
6
  print_window.focus();
7
  print_window.document.title = document.title;
8
  print_window.history.pushState('', 'Print Recipe', location.href.replace(location.hash,""));
9
+ print_window.wprm.set_print_system(system);
10
  print_window.wprm.set_print_servings(servings);
11
  print_window.print();
12
  };
18
 
19
  var recipe = jQuery(this).parents('.wprm-recipe-container'),
20
  servings = parseInt(recipe.find('.wprm-recipe-servings').data('servings')),
21
+ system = 1,
22
  recipe_id = recipe.data('recipe-id');
23
+
24
+ if('undefined' !== typeof wprmpuc) {
25
+ system = wprmpuc.get_active_system(recipe);
26
+ }
27
+
28
+ wprm.print_recipe(recipe_id, servings, system);
29
  });
30
  jQuery('.wprm-print-recipe-shortcode').on('click', function(e) {
31
  e.preventDefault();
32
 
33
  var recipe_id = jQuery(this).data('recipe-id');
34
+ wprm.print_recipe(recipe_id, false, 1);
35
  });
36
  });
includes/admin/class-wprm-recipe-parser.php CHANGED
@@ -25,6 +25,8 @@ class WPRM_Recipe_Parser {
25
  * @since 1.7.0
26
  */
27
  public static function init() {
 
 
28
  add_action( 'wp_ajax_wprm_parse_ingredients', array( __CLASS__, 'ajax_parse_ingredients' ) );
29
  }
30
 
@@ -91,28 +93,31 @@ class WPRM_Recipe_Parser {
91
  foreach ( $unicode_map as $unicode => $normal ) {
92
  $unicode_regex .= '\x{' . $unicode . '}';
93
  }
94
- $amount_regex = '/^\s*([\d' . $unicode_regex . '][\s\/\-\d.,' . $unicode_regex . ']*)(.*)/u';
 
 
95
 
96
  preg_match( $amount_regex, $raw, $match );
97
  if ( isset( $match[0] ) ) {
98
  $amount = trim( $match[1] );
99
- $raw = trim( $match[2] );
100
  }
101
 
102
  // Units.
103
  $unit = '';
104
 
105
- $possible_units = self::parse_ingredient_units();
106
 
107
  // Can't use array_map because of parameter.
108
  foreach ( $possible_units as $index => $value ) {
109
  $possible_units[ $index ] = preg_quote( $value, '/' );
 
110
  }
111
 
112
- $pattern = '/^(\b' . implode( '\b|\b', $possible_units ) . '\b)/ui';
113
  preg_match( $pattern, $raw, $match );
114
  if ( isset( $match[0] ) ) {
115
- $unit = $match[0];
116
  $raw = trim( preg_replace( $pattern, '', $raw, 1 ) );
117
  }
118
 
@@ -120,14 +125,18 @@ class WPRM_Recipe_Parser {
120
  $notes_start = array();
121
 
122
  // Check for comma.
123
- if ( strpos( $raw, ',' ) ) {
124
- $notes_start[] = strpos( $raw, ',' );
 
 
125
  }
126
 
127
  // Check for ().
128
- preg_match( '/\((.*?)\)/i', $raw, $match );
129
- if ( ! empty( $match ) ) {
130
- $notes_start[] = strpos( $raw, '(' );
 
 
131
  }
132
 
133
  // Take out notes.
@@ -137,6 +146,15 @@ class WPRM_Recipe_Parser {
137
  $notes = trim( substr( $raw, $start ) );
138
  $raw = trim( substr( $raw, 0, $start ) );
139
 
 
 
 
 
 
 
 
 
 
140
  // Make sure the name is not empty.
141
  if ( ! $raw ) {
142
  $raw = $notes;
@@ -156,13 +174,29 @@ class WPRM_Recipe_Parser {
156
  }
157
 
158
  return array(
159
- 'amount' => $amount,
160
- 'unit' => $unit,
161
- 'name' => $name,
162
- 'notes' => $notes,
163
  );
164
  }
165
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
166
  /**
167
  * Get an array of possible ingredient units.
168
  *
@@ -262,7 +296,7 @@ class WPRM_Recipe_Parser {
262
  __( 'pieces', 'wp-recipe-maker' ),
263
  __( 'piece', 'wp-recipe-maker' ),
264
  __( 'pinches', 'wp-recipe-maker' ),
265
- __( 'pinche', 'wp-recipe-maker' ),
266
  );
267
 
268
  $units = apply_filters( 'wprm_parse_ingredient_units', $units );
25
  * @since 1.7.0
26
  */
27
  public static function init() {
28
+ add_filter( 'wprm_settings_defaults', array( __CLASS__, 'import_settings_defaults' ) );
29
+
30
  add_action( 'wp_ajax_wprm_parse_ingredients', array( __CLASS__, 'ajax_parse_ingredients' ) );
31
  }
32
 
93
  foreach ( $unicode_map as $unicode => $normal ) {
94
  $unicode_regex .= '\x{' . $unicode . '}';
95
  }
96
+
97
+ $range_keyword = WPRM_Settings::get( 'import_range_keyword' );
98
+ $amount_regex = '/^\s*([\d' . $unicode_regex . ']([\s\/\-\d.,' . $unicode_regex . ']|' . $range_keyword . ')*)(.*)/u';
99
 
100
  preg_match( $amount_regex, $raw, $match );
101
  if ( isset( $match[0] ) ) {
102
  $amount = trim( $match[1] );
103
+ $raw = trim( $match[3] );
104
  }
105
 
106
  // Units.
107
  $unit = '';
108
 
109
+ $possible_units = WPRM_Settings::get( 'import_units' );
110
 
111
  // Can't use array_map because of parameter.
112
  foreach ( $possible_units as $index => $value ) {
113
  $possible_units[ $index ] = preg_quote( $value, '/' );
114
+ $possible_units[ $index ] .= '\.?'; // With or without dot to cover abbreviations.
115
  }
116
 
117
+ $pattern = '/^(\b' . implode( '\s|\b', $possible_units ) . '\s)/ui';
118
  preg_match( $pattern, $raw, $match );
119
  if ( isset( $match[0] ) ) {
120
+ $unit = trim( $match[0] );
121
  $raw = trim( preg_replace( $pattern, '', $raw, 1 ) );
122
  }
123
 
125
  $notes_start = array();
126
 
127
  // Check for comma.
128
+ if ( in_array( WPRM_Settings::get( 'import_notes_identifier' ), array( 'comma', 'both' ), true ) ) {
129
+ if ( strpos( $raw, ',' ) ) {
130
+ $notes_start[] = strpos( $raw, ',' );
131
+ }
132
  }
133
 
134
  // Check for ().
135
+ if ( in_array( WPRM_Settings::get( 'import_notes_identifier' ), array( 'parentheses', 'both' ), true ) ) {
136
+ preg_match( '/\((.*?)\)/i', $raw, $match );
137
+ if ( ! empty( $match ) ) {
138
+ $notes_start[] = strpos( $raw, '(' );
139
+ }
140
  }
141
 
142
  // Take out notes.
146
  $notes = trim( substr( $raw, $start ) );
147
  $raw = trim( substr( $raw, 0, $start ) );
148
 
149
+ if ( WPRM_Settings::get( 'import_notes_remove_identifier' ) ) {
150
+ $type = substr( $notes, 0, 1 );
151
+ $notes = substr( $notes, 1 );
152
+
153
+ if ( '(' === $type ) {
154
+ $notes = preg_replace( '/\)/', '', $notes, 1);
155
+ }
156
+ }
157
+
158
  // Make sure the name is not empty.
159
  if ( ! $raw ) {
160
  $raw = $notes;
174
  }
175
 
176
  return array(
177
+ 'amount' => trim( $amount ),
178
+ 'unit' => trim( $unit ),
179
+ 'name' => trim( $name ),
180
+ 'notes' => trim( $notes ),
181
  );
182
  }
183
 
184
+ /**
185
+ * Add import settings defaults.
186
+ *
187
+ * @since 1.20.0
188
+ * @param array $defaults Settings defaults.
189
+ */
190
+ public static function import_settings_defaults( $defaults ) {
191
+ $defaults = array_merge( $defaults, array(
192
+ 'import_range_keyword' => __( 'to', 'wp-recipe-maker' ),
193
+ 'import_units' => self::parse_ingredient_units(),
194
+ 'import_notes_identifier' => 'both',
195
+ 'import_notes_remove_identifier' => true,
196
+ ) );
197
+ return $defaults;
198
+ }
199
+
200
  /**
201
  * Get an array of possible ingredient units.
202
  *
296
  __( 'pieces', 'wp-recipe-maker' ),
297
  __( 'piece', 'wp-recipe-maker' ),
298
  __( 'pinches', 'wp-recipe-maker' ),
299
+ __( 'pinch', 'wp-recipe-maker' ),
300
  );
301
 
302
  $units = apply_filters( 'wprm_parse_ingredient_units', $units );
includes/admin/class-wprm-recipe-sanitizer.php CHANGED
@@ -32,6 +32,7 @@ class WPRM_Recipe_Sanitizer {
32
  $sanitized_recipe['name'] = isset( $recipe['name'] ) ? sanitize_text_field( $recipe['name'] ) : '';
33
  $sanitized_recipe['summary'] = isset( $recipe['summary'] ) ? wp_kses_post( $recipe['summary'] ) : '';
34
  $sanitized_recipe['author_name'] = isset( $recipe['author_name'] ) ? sanitize_text_field( $recipe['author_name'] ) : '';
 
35
  $sanitized_recipe['servings_unit'] = isset( $recipe['servings_unit'] ) ? sanitize_text_field( $recipe['servings_unit'] ) : '';
36
  $sanitized_recipe['notes'] = isset( $recipe['notes'] ) ? wp_kses_post( $recipe['notes'] ) : '';
37
 
@@ -88,6 +89,18 @@ class WPRM_Recipe_Sanitizer {
88
  );
89
  }
90
 
 
 
 
 
 
 
 
 
 
 
 
 
91
  // Get ingredient ID from name.
92
  if ( $sanitized_ingredient['name'] ) {
93
  $term = term_exists( $sanitized_ingredient['name'], 'wprm_ingredient' ); // @codingStandardsIgnoreLine
32
  $sanitized_recipe['name'] = isset( $recipe['name'] ) ? sanitize_text_field( $recipe['name'] ) : '';
33
  $sanitized_recipe['summary'] = isset( $recipe['summary'] ) ? wp_kses_post( $recipe['summary'] ) : '';
34
  $sanitized_recipe['author_name'] = isset( $recipe['author_name'] ) ? sanitize_text_field( $recipe['author_name'] ) : '';
35
+ $sanitized_recipe['author_link'] = isset( $recipe['author_link'] ) ? sanitize_text_field( $recipe['author_link'] ) : '';
36
  $sanitized_recipe['servings_unit'] = isset( $recipe['servings_unit'] ) ? sanitize_text_field( $recipe['servings_unit'] ) : '';
37
  $sanitized_recipe['notes'] = isset( $recipe['notes'] ) ? wp_kses_post( $recipe['notes'] ) : '';
38
 
89
  );
90
  }
91
 
92
+ // Unit Conversion.
93
+ if ( isset( $ingredient['converted'] ) ) {
94
+ $sanitized_ingredient['converted'] = array();
95
+
96
+ foreach ( $ingredient['converted'] as $system => $conversion ) {
97
+ $sanitized_ingredient['converted'][ $system ] = array(
98
+ 'amount' => wp_kses_post( $conversion['amount'] ),
99
+ 'unit' => wp_kses_post( $conversion['unit'] ),
100
+ );
101
+ }
102
+ }
103
+
104
  // Get ingredient ID from name.
105
  if ( $sanitized_ingredient['name'] ) {
106
  $term = term_exists( $sanitized_ingredient['name'], 'wprm_ingredient' ); // @codingStandardsIgnoreLine
includes/admin/class-wprm-recipe-saver.php CHANGED
@@ -123,6 +123,7 @@ class WPRM_Recipe_Saver {
123
  // Meta Fields.
124
  update_post_meta( $id, 'wprm_author_display', $recipe['author_display'] );
125
  update_post_meta( $id, 'wprm_author_name', $recipe['author_name'] );
 
126
  update_post_meta( $id, 'wprm_servings', $recipe['servings'] );
127
  update_post_meta( $id, 'wprm_servings_unit', $recipe['servings_unit'] );
128
  update_post_meta( $id, 'wprm_prep_time', $recipe['prep_time'] );
@@ -161,11 +162,15 @@ class WPRM_Recipe_Saver {
161
 
162
  $recipe_ids = WPRM_Recipe_Manager::get_recipe_ids_from_content( $post->post_content );
163
 
164
- // Prevent issue with automatically created redirections.
165
  if ( count( $recipe_ids ) > 0 ) {
166
- $post_recipes_to_update = get_option( 'wprm_post_recipes_to_update', array() );
167
- $post_recipes_to_update[ $post->ID ] = $recipe_ids;
168
- update_option( 'wprm_post_recipes_to_update', $post_recipes_to_update );
 
 
 
 
 
169
  }
170
  }
171
 
@@ -183,19 +188,7 @@ class WPRM_Recipe_Saver {
183
  $recipe_ids = reset( $post_recipes_to_update );
184
  $post_id = key( $post_recipes_to_update );
185
 
186
- // Update recipes.
187
- foreach ( $recipe_ids as $recipe_id ) {
188
- $recipe = array(
189
- 'ID' => $recipe_id,
190
- 'post_status' => $post->post_status,
191
- 'post_author' => $post->post_author,
192
- 'post_date' => $post->post_date,
193
- 'post_modified' => $post->post_modified,
194
- );
195
- wp_update_post( $recipe );
196
-
197
- update_post_meta( $recipe_id, 'wprm_parent_post_id', $post_id );
198
- }
199
 
200
  // Update remaing post/recipes to update.
201
  unset( $post_recipes_to_update[ $post_id ] );
@@ -204,6 +197,31 @@ class WPRM_Recipe_Saver {
204
  }
205
  }
206
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
207
  /**
208
  * Prevent post type switcher bug from changing our recipe's post type.
209
  *
123
  // Meta Fields.
124
  update_post_meta( $id, 'wprm_author_display', $recipe['author_display'] );
125
  update_post_meta( $id, 'wprm_author_name', $recipe['author_name'] );
126
+ update_post_meta( $id, 'wprm_author_link', $recipe['author_link'] );
127
  update_post_meta( $id, 'wprm_servings', $recipe['servings'] );
128
  update_post_meta( $id, 'wprm_servings_unit', $recipe['servings_unit'] );
129
  update_post_meta( $id, 'wprm_prep_time', $recipe['prep_time'] );
162
 
163
  $recipe_ids = WPRM_Recipe_Manager::get_recipe_ids_from_content( $post->post_content );
164
 
 
165
  if ( count( $recipe_ids ) > 0 ) {
166
+ // Immediately update when importing, otherwise do on next load to prevent issues with other plugins.
167
+ if ( isset( $_POST['importer_uid'] ) ) { // Input var okay.
168
+ self::update_recipes_in_post( $post->ID, $recipe_ids );
169
+ } else {
170
+ $post_recipes_to_update = get_option( 'wprm_post_recipes_to_update', array() );
171
+ $post_recipes_to_update[ $post->ID ] = $recipe_ids;
172
+ update_option( 'wprm_post_recipes_to_update', $post_recipes_to_update );
173
+ }
174
  }
175
  }
176
 
188
  $recipe_ids = reset( $post_recipes_to_update );
189
  $post_id = key( $post_recipes_to_update );
190
 
191
+ self::update_recipes_in_post( $post_id, $recipe_ids );
 
 
 
 
 
 
 
 
 
 
 
 
192
 
193
  // Update remaing post/recipes to update.
194
  unset( $post_recipes_to_update[ $post_id ] );
197
  }
198
  }
199
 
200
+ /**
201
+ * Update recipes with post data.
202
+ *
203
+ * @since 1.20.0
204
+ * @param mixed $post_id Post to use the data from.
205
+ * @param array $recipe_ids Recipes to update.
206
+ */
207
+ public static function update_recipes_in_post( $post_id, $recipe_ids ) {
208
+ $post = get_post( $post_id );
209
+
210
+ // Update recipes.
211
+ foreach ( $recipe_ids as $recipe_id ) {
212
+ $recipe = array(
213
+ 'ID' => $recipe_id,
214
+ 'post_status' => $post->post_status,
215
+ 'post_author' => $post->post_author,
216
+ 'post_date' => $post->post_date,
217
+ 'post_modified' => $post->post_modified,
218
+ );
219
+ wp_update_post( $recipe );
220
+
221
+ update_post_meta( $recipe_id, 'wprm_parent_post_id', $post_id );
222
+ }
223
+ }
224
+
225
  /**
226
  * Prevent post type switcher bug from changing our recipe's post type.
227
  *
includes/admin/import/class-wprm-import-easyrecipe.php CHANGED
@@ -116,7 +116,7 @@ class WPRM_Import_Easyrecipe extends WPRM_Import {
116
  $finished = true;
117
  }
118
 
119
- $found_recipes = get_option( 'wprm_import_easyrecipe_recipes', array() );
120
  $found_recipes = array_merge( $found_recipes, $recipes );
121
 
122
  update_option( 'wprm_import_easyrecipe_recipes', $found_recipes, false );
116
  $finished = true;
117
  }
118
 
119
+ $found_recipes = 0 === $page ? array() : get_option( 'wprm_import_easyrecipe_recipes', array() );
120
  $found_recipes = array_merge( $found_recipes, $recipes );
121
 
122
  update_option( 'wprm_import_easyrecipe_recipes', $found_recipes, false );
includes/admin/import/class-wprm-import-example.php ADDED
@@ -0,0 +1,270 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Example importer.
4
+ * The importer will automatically be loaded when placed in the /wp-recipe-maker/includes/admin/import/ folder.
5
+ *
6
+ * @link http://bootstrapped.ventures
7
+ * @since 1.20.0
8
+ *
9
+ * @package WP_Recipe_Maker
10
+ * @subpackage WP_Recipe_Maker/includes/admin/import
11
+ */
12
+
13
+ /**
14
+ * Example importer.
15
+ * The importer will automatically be loaded when placed in the /wp-recipe-maker/includes/admin/import/ folder.
16
+ *
17
+ * @since 1.20.0
18
+ * @package WP_Recipe_Maker
19
+ * @subpackage WP_Recipe_Maker/includes/admin/import
20
+ * @author Brecht Vandersmissen <brecht@bootstrapped.ventures>
21
+ */
22
+
23
+ // Make sure the class name matches the file name.
24
+ class WPRM_Import_Example extends WPRM_Import {
25
+ /**
26
+ * Get the UID of this import source.
27
+ *
28
+ * @since 1.20.0
29
+ */
30
+ public function get_uid() {
31
+ // This should return a uid (no spaces) representing the import source.
32
+ // For example "wp-ultimate-recipe", "easyrecipe", ...
33
+
34
+ return 'example';
35
+ }
36
+
37
+ /**
38
+ * Wether or not this importer requires a manual search for recipes.
39
+ *
40
+ * @since 1.20.0
41
+ */
42
+ public function requires_search() {
43
+ // Set to true when you need to search through the post content (or somewhere else) to actually find recipes.
44
+ // When set to true the "search_recipes" function is required.
45
+ // Usually false is fine as you can find recipes as a custom post type or in a custom table.
46
+
47
+ return false;
48
+ }
49
+
50
+ /**
51
+ * Get the name of this import source.
52
+ *
53
+ * @since 1.20.0
54
+ */
55
+ public function get_name() {
56
+ // Display name for this importer.
57
+
58
+ return 'Example Recipe Plugin';
59
+ }
60
+
61
+ /**
62
+ * Get HTML for the import settings.
63
+ *
64
+ * @since 1.20.0
65
+ */
66
+ public function get_settings_html() {
67
+ // Any HTML can be added here if input is required for doing the import.
68
+ // Take a look at the WP Ultimate Recipe importer for an example.
69
+ // Most importers will just need ''.
70
+
71
+ return '';
72
+ }
73
+
74
+ /**
75
+ * Get the total number of recipes to import.
76
+ *
77
+ * @since 1.20.0
78
+ */
79
+ public function get_recipe_count() {
80
+ // Return a count for the number of recipes left to import.
81
+ // Don't include recipes that have already been imported.
82
+
83
+ return 0;
84
+ }
85
+
86
+ /**
87
+ * Search for recipes to import.
88
+ *
89
+ * @since 1.20.0
90
+ * @param int $page Page of recipes to import.
91
+ */
92
+ public function search_recipes( $page = 0 ) {
93
+ // Only needed if "search_required" returns true.
94
+ // Function will be called with increased $page number until finished is set to true.
95
+ // Will need a custom way of storing the recipes.
96
+ // Take a look at the Easy Recipe importer for an example.
97
+
98
+ return array(
99
+ 'finished' => true,
100
+ 'recipes' => 0,
101
+ );
102
+ }
103
+
104
+ /**
105
+ * Get a list of recipes that are available to import.
106
+ *
107
+ * @since 1.20.0
108
+ * @param int $page Page of recipes to get.
109
+ */
110
+ public function get_recipes( $page = 0 ) {
111
+ // Return an array of recipes to be imported with name and edit URL.
112
+ // If not the same number of recipes as in "get_recipe_count" are returned pagination will be used.
113
+
114
+ $recipes = array();
115
+
116
+ // $recipes[ $post_id ] = array(
117
+ // 'name' => $post_title,
118
+ // 'url' => get_edit_post_link( $post_id ),
119
+ // );
120
+ // }
121
+
122
+ return $recipes;
123
+ }
124
+
125
+ /**
126
+ * Get recipe with the specified ID in the import format.
127
+ *
128
+ * @since 1.20.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
+ // Get the recipe data in WPRM format for a specific ID, corresponding to the ID in the "get_recipes" array.
134
+ // $post_data will contain any input fields set in the "get_settings_html" function.
135
+ // Include any fields to backup in "import_backup".
136
+ $recipe = array(
137
+ 'import_id' => 0, // Important! If set to 0 will create the WPRM recipe as a new post. If set to an ID it will update to post with that ID to become a WPRM post type.
138
+ 'import_backup' => array(
139
+ 'example_recipe_id' => $id,
140
+ ),
141
+ );
142
+
143
+ // Get and set all the WPRM recipe fields.
144
+ $recipe['name'] = '';
145
+ $recipe['summary'] = '';
146
+ $recipe['author_name'] = '';
147
+ $recipe['servings_unit'] = '';
148
+ $recipe['notes'] = '';
149
+
150
+ $recipe['image_id'] = 0;
151
+ $recipe['servings'] = 0;
152
+ $recipe['prep_time'] = 0;
153
+ $recipe['cook_time'] = 0;
154
+ $recipe['total_time'] = 0;
155
+
156
+ // Set recipe options.
157
+ $recipe['author_display'] = 'default'; // default, disabled, post_author, custom.
158
+ $recipe['ingredient_links_type'] = 'global'; // global, custom.
159
+
160
+ // Optionally update the GLOBAL ingredient links (Premium only).
161
+ // Warning, this changes the link for ALL recipes using that ingredient.
162
+ $recipe['global_ingredient_links'] = array(
163
+ 1 => array( // Term ID or name of the ingredient to update.
164
+ 'url' => '',
165
+ 'nofollow' => 'default', // default, follow, nofollow.
166
+ ),
167
+ );
168
+
169
+ // Set any recipe tags (custom ones need to be created on the WP Recipe Maker > Manage page first).
170
+ $recipe['tags'] = array(
171
+ 'course' => array( 1, 2 ), // Use ID of existing terms
172
+ 'cuisine' => array( 'Italian' ), // ...or name of new terms.
173
+ );
174
+
175
+ // Ingredients have to follow this array structure consisting of groups first.
176
+ $recipe['ingredients'] = array(
177
+ array(
178
+ 'name' => '', // Group names can be empty.
179
+ 'ingredients' => array(
180
+ array(
181
+ 'amount' => '1-2',
182
+ 'unit' => '',
183
+ 'name' => 'apples', // The name field is required.
184
+ 'notes' => '',
185
+ ),
186
+ array(
187
+ 'raw' => '1 cl olive oil (extra virgin)', // Alternatively pass all ingredient data as raw to have it parsed automatically.
188
+ ),
189
+ ),
190
+ ),
191
+ array(
192
+ 'name' => 'Another ingredient group',
193
+ 'ingredients' => array(
194
+ array(
195
+ 'amount' => '',
196
+ 'unit' => '',
197
+ 'name' => 'sage',
198
+ 'notes' => '',
199
+ 'link' => array( // Possible to set a custom ingredient link to be used in this recipe only.
200
+ 'url' => '',
201
+ 'nofollow' => 'default',
202
+ ),
203
+ ),
204
+ ),
205
+ ),
206
+ );
207
+
208
+ // Instructions have to follow this array structure consisting of groups first.
209
+ $recipe['instructions'] = array(
210
+ array(
211
+ 'name' => '', // Group names can be empty.
212
+ 'instructions' => array(
213
+ array(
214
+ 'text' => 'My first instruction',
215
+ ),
216
+ array(
217
+ 'text' => '',
218
+ 'image' => 1, // Use the attachment ID of an image.
219
+ ),
220
+ ),
221
+ ),
222
+ array(
223
+ 'name' => 'Another instruction group',
224
+ 'instructions' => array(
225
+ array(
226
+ 'text' => 'Another instruction',
227
+ ),
228
+ ),
229
+ ),
230
+ );
231
+
232
+ // Nutrition Facts.
233
+ $recipe['nutrition'] = array(
234
+ 'serving_size' => '',
235
+ 'calories' => '',
236
+ 'carbohydrates' => '',
237
+ 'protein' => '',
238
+ 'fat' => '',
239
+ 'saturated_fat' => '',
240
+ 'polyunsaturated_fat' => '',
241
+ 'monounsaturated_fat' => '',
242
+ 'trans_fat' => '',
243
+ 'cholesterol' => '',
244
+ 'sodium' => '',
245
+ 'potassium' => '',
246
+ 'fiber' => '',
247
+ 'sugar' => '',
248
+ 'vitamin_a' => '',
249
+ 'vitamin_c' => '',
250
+ 'calcium' => '',
251
+ 'iron' => '',
252
+ );
253
+
254
+ return $recipe;
255
+ }
256
+
257
+ /**
258
+ * Replace the original recipe with the newly imported WPRM one.
259
+ *
260
+ * @since 1.20.0
261
+ * @param mixed $id ID of the recipe we want replace.
262
+ * @param mixed $wprm_id ID of the WPRM recipe to replace with.
263
+ * @param array $post_data POST data passed along when submitting the form.
264
+ */
265
+ public function replace_recipe( $id, $wprm_id, $post_data ) {
266
+ // The recipe with ID $id has been imported and we now have a WPRM recipe with ID $wprm_id (can be the same ID).
267
+ // $post_data will contain any input fields set in the "get_settings_html" function.
268
+ // Use this function to do anything after the import, like replacing shortcodes.
269
+ }
270
+ }
includes/admin/modal/class-wprm-modal.php CHANGED
@@ -58,8 +58,8 @@ class WPRM_Modal {
58
  'nonce' => wp_create_nonce( 'wprm' ),
59
  'text' => array(
60
  'modal_close_confirm' => __( 'Are you sure? You will lose any unsaved changes.', 'wp-recipe-maker' ),
61
- 'action_button_insert' => __( 'Insert', 'wp-recipe-maker' ),
62
- 'action_button_update' => __( 'Update', 'wp-recipe-maker' ),
63
  'media_title' => __( 'Select or Upload Image', 'wp-recipe-maker' ),
64
  'media_button' => __( 'Use Image', 'wp-recipe-maker' ),
65
  'shortcode_remove' => __( 'Are you sure you want to remove this recipe?', 'wp-recipe-maker' ),
@@ -157,7 +157,7 @@ class WPRM_Modal {
157
  'label' => __( 'Edit Recipe', 'wp-recipe-maker' ),
158
  'template' => WPRM_DIR . 'templates/admin/modal/tabs/edit-recipe.php',
159
  'callback' => 'edit_recipe',
160
- 'button' => __( 'Edit', 'wp-recipe-maker' ),
161
  ),
162
  ),
163
  'default_tab' => 'edit-recipe-select',
@@ -171,7 +171,7 @@ class WPRM_Modal {
171
  'label' => __( 'Insert Recipe', 'wp-recipe-maker' ),
172
  'template' => WPRM_DIR . 'templates/admin/modal/tabs/insert-recipe.php',
173
  'callback' => 'insert_recipe',
174
- 'button' => __( 'Insert', 'wp-recipe-maker' ),
175
  ),
176
  ),
177
  'default_tab' => 'insert-recipe-select',
58
  'nonce' => wp_create_nonce( 'wprm' ),
59
  'text' => array(
60
  'modal_close_confirm' => __( 'Are you sure? You will lose any unsaved changes.', 'wp-recipe-maker' ),
61
+ 'action_button_insert' => __( 'Insert & Close', 'wp-recipe-maker' ),
62
+ 'action_button_update' => __( 'Update & Close', 'wp-recipe-maker' ),
63
  'media_title' => __( 'Select or Upload Image', 'wp-recipe-maker' ),
64
  'media_button' => __( 'Use Image', 'wp-recipe-maker' ),
65
  'shortcode_remove' => __( 'Are you sure you want to remove this recipe?', 'wp-recipe-maker' ),
157
  'label' => __( 'Edit Recipe', 'wp-recipe-maker' ),
158
  'template' => WPRM_DIR . 'templates/admin/modal/tabs/edit-recipe.php',
159
  'callback' => 'edit_recipe',
160
+ 'button' => __( 'Edit Recipe', 'wp-recipe-maker' ),
161
  ),
162
  ),
163
  'default_tab' => 'edit-recipe-select',
171
  'label' => __( 'Insert Recipe', 'wp-recipe-maker' ),
172
  'template' => WPRM_DIR . 'templates/admin/modal/tabs/insert-recipe.php',
173
  'callback' => 'insert_recipe',
174
+ 'button' => __( 'Insert Recipe & Close', 'wp-recipe-maker' ),
175
  ),
176
  ),
177
  'default_tab' => 'insert-recipe-select',
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.19.0' );
35
  define( 'WPRM_PREMIUM_VERSION_REQUIRED', '1.3.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.20.0' );
35
  define( 'WPRM_PREMIUM_VERSION_REQUIRED', '1.3.0' );
36
  define( 'WPRM_POST_TYPE', 'wprm_recipe' );
37
  define( 'WPRM_DIR', plugin_dir_path( dirname( __FILE__ ) ) );
includes/public/class-wprm-print.php CHANGED
@@ -75,15 +75,30 @@ class WPRM_Print {
75
  if ( WPRM_Addons::is_active( 'premium' ) ) {
76
  $scripts .= '<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>';
77
  $scripts .= '<script src="' . WPRMP_URL . 'assets/js/public/servings-changer.js"></script>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  } else {
79
- $scripts .= '<script>wprm = {}; wprm.set_print_servings = function(servings) {};</script>';
80
  }
81
 
82
  // Fix for IE.
83
  header( 'HTTP/1.1 200 OK' );
84
 
85
  $charset = get_bloginfo( 'charset' );
86
- $print_html = '<html><head><meta http-equiv="Content-Type" content="text/html; charset=' . $charset . '" /><meta name="robots" content="noindex">' . $styles . $scripts . '</head><body class="wprm-print">';
87
  $print_html .= WPRM_Template_Manager::get_template( $recipe, 'print' );
88
  $print_html .= '</body></html>';
89
  echo $print_html;
75
  if ( WPRM_Addons::is_active( 'premium' ) ) {
76
  $scripts .= '<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>';
77
  $scripts .= '<script src="' . WPRMP_URL . 'assets/js/public/servings-changer.js"></script>';
78
+
79
+ if ( WPRM_Addons::is_active( 'unit-conversion' ) ) {
80
+ $scripts .= '<script src="' . WPRMPUC_URL . 'assets/js/public/unit-conversion.js"></script>';
81
+
82
+ // Localize ingredients.
83
+ $ingredients = $recipe->ingredients_without_groups();
84
+
85
+ foreach ( (array) $ingredients as $key => $value ) {
86
+ if ( ! is_scalar( $value ) ) continue;
87
+ $ingredients[$key] = html_entity_decode( (string) $value, ENT_QUOTES, 'UTF-8');
88
+ }
89
+ $scripts .= '<script>var wprmpuc_ingredients = ' . wp_json_encode( $ingredients ) . ';</script>';
90
+ } else {
91
+ $scripts .= '<script>wprm.set_print_system = function(system) {};</script>';
92
+ }
93
  } else {
94
+ $scripts .= '<script>wprm = {}; wprm.set_print_servings = function(servings) {}; wprm.set_print_system = function(system) {};</script>';
95
  }
96
 
97
  // Fix for IE.
98
  header( 'HTTP/1.1 200 OK' );
99
 
100
  $charset = get_bloginfo( 'charset' );
101
+ $print_html = '<html><head><meta http-equiv="Content-Type" content="text/html; charset=' . $charset . '" /><meta name="robots" content="noindex">' . $styles . $scripts . '</head><body class="wprm-print" data-recipe="' . esc_attr( $recipe_id ) . '">';
102
  $print_html .= WPRM_Template_Manager::get_template( $recipe, 'print' );
103
  $print_html .= '</body></html>';
104
  echo $print_html;
includes/public/class-wprm-recipe.php CHANGED
@@ -66,6 +66,7 @@ class WPRM_Recipe {
66
 
67
  $recipe['author_display'] = $this->author_display( true );
68
  $recipe['author_name'] = $this->custom_author_name();
 
69
  $recipe['servings'] = $this->servings();
70
  $recipe['servings_unit'] = $this->servings_unit();
71
  $recipe['prep_time'] = $this->prep_time();
@@ -114,6 +115,16 @@ class WPRM_Recipe {
114
  return $default;
115
  }
116
 
 
 
 
 
 
 
 
 
 
 
117
  /**
118
  * Get the recipe author.
119
  *
@@ -124,7 +135,14 @@ class WPRM_Recipe {
124
  case 'post_author':
125
  return $this->post_author_name();
126
  case 'custom':
127
- return $this->custom_author_name();
 
 
 
 
 
 
 
128
  default:
129
  return '';
130
  }
@@ -169,6 +187,15 @@ class WPRM_Recipe {
169
  return $this->meta( 'wprm_author_name', '' );
170
  }
171
 
 
 
 
 
 
 
 
 
 
172
  /**
173
  * Get the recipe post author name.
174
  *
@@ -282,7 +309,14 @@ class WPRM_Recipe {
282
  * @since 1.0.0
283
  */
284
  public function nutrition() {
285
- return maybe_unserialize( $this->meta( 'wprm_nutrition', array() ) );
 
 
 
 
 
 
 
286
  }
287
 
288
  /**
@@ -448,7 +482,14 @@ class WPRM_Recipe {
448
  * @since 1.0.0
449
  */
450
  public function ingredients() {
451
- return maybe_unserialize( $this->meta( 'wprm_ingredients', array() ) );
 
 
 
 
 
 
 
452
  }
453
 
454
  /**
@@ -482,7 +523,14 @@ class WPRM_Recipe {
482
  * @since 1.0.0
483
  */
484
  public function instructions() {
485
- return maybe_unserialize( $this->meta( 'wprm_instructions', array() ) );
 
 
 
 
 
 
 
486
  }
487
 
488
  /**
66
 
67
  $recipe['author_display'] = $this->author_display( true );
68
  $recipe['author_name'] = $this->custom_author_name();
69
+ $recipe['author_link'] = $this->custom_author_link();
70
  $recipe['servings'] = $this->servings();
71
  $recipe['servings_unit'] = $this->servings_unit();
72
  $recipe['prep_time'] = $this->prep_time();
115
  return $default;
116
  }
117
 
118
+ /**
119
+ * Callback for regex to fix serialize issues.
120
+ *
121
+ * @since 1.20.0
122
+ * @param mixed $match Regex match.
123
+ */
124
+ public function regex_replace_serialize( $match ) {
125
+ return ( $match[1] == strlen( $match[2] ) ) ? $match[0] : 's:' . strlen( $match[2] ) . ':"' . $match[2] . '";';
126
+ }
127
+
128
  /**
129
  * Get the recipe author.
130
  *
135
  case 'post_author':
136
  return $this->post_author_name();
137
  case 'custom':
138
+ $link = $this->custom_author_link();
139
+ $name = $this->custom_author_name();
140
+
141
+ if ( $link && $name && WPRM_Addons::is_active( 'premium' ) ) {
142
+ return '<a href="' . esc_attr( $link ) . '" target="_blank">' . $name . '</a>';
143
+ } else {
144
+ return $name;
145
+ }
146
  default:
147
  return '';
148
  }
187
  return $this->meta( 'wprm_author_name', '' );
188
  }
189
 
190
+ /**
191
+ * Get the recipe custom author link.
192
+ *
193
+ * @since 1.20.0
194
+ */
195
+ public function custom_author_link() {
196
+ return $this->meta( 'wprm_author_link', '' );
197
+ }
198
+
199
  /**
200
  * Get the recipe post author name.
201
  *
309
  * @since 1.0.0
310
  */
311
  public function nutrition() {
312
+ $serialized = $this->meta( 'wprm_nutrition', array() );
313
+ $nutrition = @maybe_unserialize( $serialized );
314
+
315
+ if ( false === $nutrition ) {
316
+ $nutrition = unserialize( preg_replace_callback( '!s:(\d+):"(.*?)";!', array( $this, 'regex_replace_serialize' ), $serialized ) );
317
+ }
318
+
319
+ return $nutrition;
320
  }
321
 
322
  /**
482
  * @since 1.0.0
483
  */
484
  public function ingredients() {
485
+ $serialized = $this->meta( 'wprm_ingredients', array() );
486
+ $ingredients = @maybe_unserialize( $serialized );
487
+
488
+ if ( false === $ingredients ) {
489
+ $ingredients = unserialize( preg_replace_callback( '!s:(\d+):"(.*?)";!', array( $this, 'regex_replace_serialize' ), $serialized ) );
490
+ }
491
+
492
+ return $ingredients;
493
  }
494
 
495
  /**
523
  * @since 1.0.0
524
  */
525
  public function instructions() {
526
+ $serialized = $this->meta( 'wprm_instructions', array() );
527
+ $instructions = @maybe_unserialize( $serialized );
528
+
529
+ if ( false === $instructions ) {
530
+ $instructions = unserialize( preg_replace_callback( '!s:(\d+):"(.*?)";!', array( $this, 'regex_replace_serialize' ), $serialized ) );
531
+ }
532
+
533
+ return $instructions;
534
  }
535
 
536
  /**
includes/public/class-wprm-settings.php CHANGED
@@ -82,6 +82,7 @@ class WPRM_Settings {
82
  add_action( 'admin_post_wprm_settings_appearance', array( __CLASS__, 'form_save_settings_appearance' ) );
83
  add_action( 'admin_post_wprm_settings_labels', array( __CLASS__, 'form_save_settings_labels' ) );
84
  add_action( 'admin_post_wprm_settings_features', array( __CLASS__, 'form_save_settings_features' ) );
 
85
  add_action( 'admin_post_wprm_settings_advanced', array( __CLASS__, 'form_save_settings_advanced' ) );
86
 
87
  add_action( 'wprm_settings_page', array( __CLASS__, 'settings_page' ) );
@@ -121,6 +122,8 @@ class WPRM_Settings {
121
  require_once( WPRM_DIR . 'templates/admin/settings/labels.php' );
122
  } elseif ( 'features' === $sub ) {
123
  require_once( WPRM_DIR . 'templates/admin/settings/features.php' );
 
 
124
  } elseif ( 'advanced' === $sub ) {
125
  require_once( WPRM_DIR . 'templates/admin/settings/advanced.php' );
126
  }
@@ -340,6 +343,31 @@ class WPRM_Settings {
340
  exit();
341
  }
342
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
343
  /**
344
  * Save the advanced settings.
345
  *
82
  add_action( 'admin_post_wprm_settings_appearance', array( __CLASS__, 'form_save_settings_appearance' ) );
83
  add_action( 'admin_post_wprm_settings_labels', array( __CLASS__, 'form_save_settings_labels' ) );
84
  add_action( 'admin_post_wprm_settings_features', array( __CLASS__, 'form_save_settings_features' ) );
85
+ add_action( 'admin_post_wprm_settings_import', array( __CLASS__, 'form_save_settings_import' ) );
86
  add_action( 'admin_post_wprm_settings_advanced', array( __CLASS__, 'form_save_settings_advanced' ) );
87
 
88
  add_action( 'wprm_settings_page', array( __CLASS__, 'settings_page' ) );
122
  require_once( WPRM_DIR . 'templates/admin/settings/labels.php' );
123
  } elseif ( 'features' === $sub ) {
124
  require_once( WPRM_DIR . 'templates/admin/settings/features.php' );
125
+ } elseif ( 'import' === $sub ) {
126
+ require_once( WPRM_DIR . 'templates/admin/settings/import.php' );
127
  } elseif ( 'advanced' === $sub ) {
128
  require_once( WPRM_DIR . 'templates/admin/settings/advanced.php' );
129
  }
343
  exit();
344
  }
345
 
346
+ /**
347
+ * Save the import settings.
348
+ *
349
+ * @since 1.20.0
350
+ */
351
+ public static function form_save_settings_import() {
352
+ if ( isset( $_POST['wprm_settings'] ) && wp_verify_nonce( sanitize_key( $_POST['wprm_settings'] ), 'wprm_settings' ) ) { // Input var okay.
353
+ $import_range_keyword = isset( $_POST['import_range_keyword'] ) ? sanitize_text_field( wp_unslash( $_POST['import_range_keyword'] ) ) : ''; // Input var okay.
354
+ $import_units = isset( $_POST['import_units'] ) ? wp_kses_post( wp_unslash( $_POST['import_units'] ) ) : ''; // Input var okay.
355
+ $import_notes_identifier = isset( $_POST['import_notes_identifier'] ) ? sanitize_key( wp_unslash( $_POST['import_notes_identifier'] ) ) : ''; // Input var okay.
356
+ $import_notes_remove_identifier = isset( $_POST['import_notes_remove_identifier'] ) && sanitize_key( $_POST['import_notes_remove_identifier'] ) ? true : false; // Input var okay.
357
+
358
+ $settings = array();
359
+
360
+ $settings['import_range_keyword'] = $import_range_keyword;
361
+ $settings['import_units'] = preg_split( '/[\r\n]+/', $import_units );
362
+ $settings['import_notes_identifier'] = $import_notes_identifier;
363
+ $settings['import_notes_remove_identifier'] = $import_notes_remove_identifier;
364
+
365
+ self::update_settings( $settings );
366
+ }
367
+ wp_safe_redirect( admin_url( 'admin.php?page=wprm_settings&sub=import' ) );
368
+ exit();
369
+ }
370
+
371
  /**
372
  * Save the advanced settings.
373
  *
includes/public/class-wprm-template-helper.php CHANGED
@@ -338,4 +338,47 @@ class WPRM_Template_Helper {
338
 
339
  return wp_get_attachment_image( $instruction['image'], $size );
340
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
341
  }
338
 
339
  return wp_get_attachment_image( $instruction['image'], $size );
340
  }
341
+
342
+ /**
343
+ * Output the Unit Conversion switcher.
344
+ *
345
+ * @param mixed $recipe Recipe to output the unit conversion switch for.
346
+ * @since 1.20.0
347
+ */
348
+ public static function unit_conversion( $recipe ) {
349
+ $output = '';
350
+
351
+ if ( WPRM_Addons::is_active( 'unit-conversion' ) && WPRM_Settings::get( 'unit_conversion_enabled' ) ) {
352
+ $ingredients = $recipe->ingredients_without_groups();
353
+ $unit_systems = array(
354
+ 1 => true, // Default unit system.
355
+ );
356
+
357
+ // Check if there are values for any other unit system.
358
+ foreach ( $ingredients as $ingredient ) {
359
+ if ( isset( $ingredient['converted'] ) ) {
360
+ foreach ( $ingredient['converted'] as $system => $values ) {
361
+ if ( $values['amount'] || $values['unit'] ) {
362
+ $unit_systems[ $system ] = true;
363
+ }
364
+ }
365
+ }
366
+ }
367
+
368
+ if ( count( $unit_systems ) > 1 ) {
369
+ $unit_systems_output = array();
370
+ foreach ( $unit_systems as $unit_system => $value ) {
371
+ $active = 1 === $unit_system ? ' wprmpuc-active' : '';
372
+ $unit_systems_output[] = '<a href="#" class="wprm-unit-conversion' . esc_attr( $active ) . '" data-system="' . esc_attr( $unit_system ) . '" data-recipe="' . esc_attr( $recipe->id() ) . '">' . WPRM_Settings::get( 'unit_conversion_system_' . $unit_system ) . '</a>';
373
+ }
374
+
375
+ $output = '<div class="wprm-unit-conversion-container">' . implode( ' - ', $unit_systems_output ) . '</div>';
376
+
377
+ wp_localize_script( 'wprmpuc-unit-conversion', 'wprmpuc_recipe_' . $recipe->id(), array(
378
+ 'ingredients' => $ingredients,
379
+ ));
380
+ }
381
+ }
382
+ return $output;
383
+ }
384
  }
readme.txt CHANGED
@@ -97,6 +97,19 @@ Yes! We pride ourselves on offering awesome support and almost always answer sup
97
 
98
  == Changelog ==
99
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  = 1.19.0 =
101
  * Feature: Sub- and superscript in summary and instructions
102
  * Feature: Allow for basic HTML in ingredients
@@ -301,6 +314,12 @@ Yes! We pride ourselves on offering awesome support and almost always answer sup
301
 
302
  == Upgrade notice ==
303
 
 
 
 
 
 
 
304
  = 1.19.0 =
305
  Update to ensure WordPress 4.8 compatibility
306
 
97
 
98
  == Changelog ==
99
 
100
+ = 1.20.0 =
101
+ * Feature: Intermediate save when creating or editing recipes
102
+ * Feature: Settings to personalize the ingredient text import
103
+ * Improvement: Abbreviations in ingredient text import
104
+ * Improvement: Immediately update parent post when importing
105
+ * Improvement: Try to fix serialize issues when getting ingredients or instructions
106
+ * Improvement: Prevent styling differences in instructions
107
+ * Fix: EasyRecipe recipes stuck in to import list
108
+ * Fix: Remove leftover debug code
109
+
110
+ = 1.19.1 =
111
+ * Fix: PHP Notice when saving recipes
112
+
113
  = 1.19.0 =
114
  * Feature: Sub- and superscript in summary and instructions
115
  * Feature: Allow for basic HTML in ingredients
314
 
315
  == Upgrade notice ==
316
 
317
+ = 1.20.0 =
318
+ Update for a few great tweaks
319
+
320
+ = 1.19.1 =
321
+ Update to get rid of a PHP notice
322
+
323
  = 1.19.0 =
324
  Update to ensure WordPress 4.8 compatibility
325
 
templates/admin/menu/faq/whats_new.php CHANGED
@@ -11,6 +11,18 @@
11
 
12
  ?>
13
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  <h3>2017-06-07 | WP Recipe Maker 1.19.0</h3>
15
  <ul>
16
  <li>Feature: Sub- and superscript in summary and instructions</li>
11
 
12
  ?>
13
 
14
+ <h3>2017-07-02 | WP Recipe Maker 1.20.0</h3>
15
+ <ul>
16
+ <li>Feature: Intermediate save when creating or editing recipes</li>
17
+ <li>Feature: Settings to personalize the ingredient text import</li>
18
+ <li>Improvement: Abbreviations in ingredient text import</li>
19
+ <li>Improvement: Immediately update parent post when importing</li>
20
+ <li>Improvement: Try to fix serialize issues when getting ingredients or instructions</li>
21
+ <li>Improvement: Prevent styling differences in instructions</li>
22
+ <li>Fix: EasyRecipe recipes stuck in to import list</li>
23
+ <li>Fix: Remove leftover debug code</li>
24
+ </ul>
25
+
26
  <h3>2017-06-07 | WP Recipe Maker 1.19.0</h3>
27
  <ul>
28
  <li>Feature: Sub- and superscript in summary and instructions</li>
templates/admin/menu/import/import-overview.php CHANGED
@@ -100,7 +100,7 @@
100
  <input type="checkbox" name="recipes[]" value="<?php echo esc_attr( $recipe->id() ); ?>" />
101
  </td>
102
  <td>
103
- <a href="#" class="wprm-manage-recipes-actions-edit" data-id="<?php echo esc_attr( $recipe->id() ); ?>"><span class="dashicons dashicons-edit"></span></a> <?php echo esc_html( $recipe->name() ); ?>
104
  </td>
105
  <td>
106
  <?php if ( $recipe->parent_post_id() > 0 ) : ?>
100
  <input type="checkbox" name="recipes[]" value="<?php echo esc_attr( $recipe->id() ); ?>" />
101
  </td>
102
  <td>
103
+ <a href="#" class="wprm-import-recipes-actions-edit" data-id="<?php echo esc_attr( $recipe->id() ); ?>"><span class="dashicons dashicons-edit"></span></a> <?php echo esc_html( $recipe->name() ); ?>
104
  </td>
105
  <td>
106
  <?php if ( $recipe->parent_post_id() > 0 ) : ?>
templates/admin/modal/modal.php CHANGED
@@ -58,7 +58,7 @@
58
  $label = isset( $tab_options['label'] ) ? $tab_options['label'] : '';
59
  $callback = isset( $tab_options['callback'] ) ? $tab_options['callback'] : '';
60
  $init = isset( $tab_options['init'] ) ? $tab_options['init'] : '';
61
- $button = isset( $tab_options['button'] ) ? $tab_options['button'] : __( 'Insert', 'wp-recipe-maker' );
62
 
63
  echo '<a href="#" class="wprm-menu-item' . esc_attr( $tab_class ) . '" data-tab="' . esc_attr( $tab_uid ) . '" data-callback="' . esc_attr( $callback ) . '" data-init="' . esc_attr( $init ) . '" data-button="' . esc_attr( $button ) . '">' . esc_html( $label ) . '</a>';
64
  }
@@ -94,7 +94,8 @@
94
  <div class="wprm-frame-toolbar">
95
  <div class="wprm-toolbar">
96
  <div class="wprm-toolbar-primary search-form">
97
- <button type="button" class="button wprm-button button-primary button-large wprm-button-action"><?php esc_html_e( 'Insert', 'wp-recipe-maker' ); ?></button>
 
98
  </div>
99
  </div>
100
  </div>
58
  $label = isset( $tab_options['label'] ) ? $tab_options['label'] : '';
59
  $callback = isset( $tab_options['callback'] ) ? $tab_options['callback'] : '';
60
  $init = isset( $tab_options['init'] ) ? $tab_options['init'] : '';
61
+ $button = isset( $tab_options['button'] ) ? $tab_options['button'] : __( 'Insert & Close', 'wp-recipe-maker' );
62
 
63
  echo '<a href="#" class="wprm-menu-item' . esc_attr( $tab_class ) . '" data-tab="' . esc_attr( $tab_uid ) . '" data-callback="' . esc_attr( $callback ) . '" data-init="' . esc_attr( $init ) . '" data-button="' . esc_attr( $button ) . '">' . esc_html( $label ) . '</a>';
64
  }
94
  <div class="wprm-frame-toolbar">
95
  <div class="wprm-toolbar">
96
  <div class="wprm-toolbar-primary search-form">
97
+ <button type="button" class="button wprm-button button-primary button-large wprm-button-action"><?php esc_html_e( 'Insert & Close', 'wp-recipe-maker' ); ?></button>
98
+ <button type="button" class="button wprm-button button-primary button-large wprm-button-action-save"><?php esc_html_e( 'Save', 'wp-recipe-maker' ); ?></button>
99
  </div>
100
  </div>
101
  </div>
templates/admin/modal/tabs/recipe-details.php CHANGED
@@ -61,6 +61,12 @@
61
  <label for="wprm-recipe-author-name"><?php esc_html_e( 'Custom Author Name', 'wp-recipe-maker' ); ?></label>
62
  <input type="text" id="wprm-recipe-author-name" placeholder="<?php esc_attr_e( 'Author Name', 'wp-recipe-maker' ); ?>" />
63
  </div>
 
 
 
 
 
 
64
  <div class="wprm-recipe-form-container">
65
  <label for="wprm-recipe-servings"><?php esc_html_e( 'Servings', 'wp-recipe-maker' ); ?></label>
66
  <input type="number" min="0" id="wprm-recipe-servings" placeholder="4" /> <input type="text" id="wprm-recipe-servings-unit" placeholder="<?php esc_attr_e( 'people', 'wp-recipe-maker' ); ?>" />
61
  <label for="wprm-recipe-author-name"><?php esc_html_e( 'Custom Author Name', 'wp-recipe-maker' ); ?></label>
62
  <input type="text" id="wprm-recipe-author-name" placeholder="<?php esc_attr_e( 'Author Name', 'wp-recipe-maker' ); ?>" />
63
  </div>
64
+ <?php if ( WPRM_Addons::is_active( 'premium' ) ) : ?>
65
+ <div class="wprm-recipe-form-container" id="wprm-recipe-author-link-container">
66
+ <label for="wprm-recipe-author-link"><?php esc_html_e( 'Custom Author Link', 'wp-recipe-maker' ); ?></label>
67
+ <input type="text" id="wprm-recipe-author-link" placeholder="https://bootstrapped.ventures" />
68
+ </div>
69
+ <?php endif; // Author Link. ?>
70
  <div class="wprm-recipe-form-container">
71
  <label for="wprm-recipe-servings"><?php esc_html_e( 'Servings', 'wp-recipe-maker' ); ?></label>
72
  <input type="number" min="0" id="wprm-recipe-servings" placeholder="4" /> <input type="text" id="wprm-recipe-servings-unit" placeholder="<?php esc_attr_e( 'people', 'wp-recipe-maker' ); ?>" />
templates/admin/settings.php CHANGED
@@ -16,6 +16,7 @@ $tabs = apply_filters( 'wprm_settings_tabs', array(
16
  'appearance' => __( 'Appearance', 'wp-recipe-maker' ),
17
  'labels' => __( 'Labels', 'wp-recipe-maker' ),
18
  'features' => __( 'Features', 'wp-recipe-maker' ),
 
19
  'advanced' => __( 'Advanced', 'wp-recipe-maker' ),
20
  ) );
21
 
16
  'appearance' => __( 'Appearance', 'wp-recipe-maker' ),
17
  'labels' => __( 'Labels', 'wp-recipe-maker' ),
18
  'features' => __( 'Features', 'wp-recipe-maker' ),
19
+ 'import' => __( 'Import', 'wp-recipe-maker' ),
20
  'advanced' => __( 'Advanced', 'wp-recipe-maker' ),
21
  ) );
22
 
templates/admin/settings/appearance.php CHANGED
@@ -56,7 +56,6 @@
56
  <label for="show_nutrition_label"><?php esc_html_e( 'Nutrition Label', 'wp-recipe-maker' ); ?></label>
57
  </th>
58
  <td>
59
- <?php var_dump( WPRM_Settings::get( 'show_nutrition_label' ) ); ?>
60
  <select id="show_nutrition_label" name="show_nutrition_label">
61
  <?php
62
  $options = array(
56
  <label for="show_nutrition_label"><?php esc_html_e( 'Nutrition Label', 'wp-recipe-maker' ); ?></label>
57
  </th>
58
  <td>
 
59
  <select id="show_nutrition_label" name="show_nutrition_label">
60
  <?php
61
  $options = array(
templates/admin/settings/import.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template for the import settings sub page.
4
+ *
5
+ * @link http://bootstrapped.ventures
6
+ * @since 1.20.0
7
+ *
8
+ * @package WP_Recipe_Maker
9
+ * @subpackage WP_Recipe_Maker/templates/admin/settings
10
+ */
11
+
12
+ ?>
13
+
14
+ <form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>">
15
+ <input type="hidden" name="action" value="wprm_settings_import">
16
+ <?php wp_nonce_field( 'wprm_settings', 'wprm_settings', false ); ?>
17
+ <h2 class="title"><?php esc_html_e( 'Ingredient Import', 'wp-recipe-maker' ); ?></h2>
18
+ <p>
19
+ <?php esc_html_e( 'Settings for the ingredient parser when importing.', 'wp-recipe-maker' ); ?>
20
+ </p>
21
+ <table class="form-table">
22
+ <tbody>
23
+ <tr>
24
+ <th scope="row">
25
+ <label for="import_range_keyword"><?php esc_html_e( 'Range Keyword', 'wp-recipe-maker' ); ?></label>
26
+ </th>
27
+ <td>
28
+ <input name="import_range_keyword" type="text" id="import_range_keyword" value="<?php echo esc_attr( WPRM_Settings::get( 'import_range_keyword' ) ); ?>" class="regular-text">
29
+ <p class="description">
30
+ <?php esc_html_e( 'Keyword used when defining quantity ranges. For example: to when using 1 to 2.', 'wp-recipe-maker-premium' ); ?>
31
+ </p>
32
+ </td>
33
+ </tr>
34
+ <tr>
35
+ <th scope="row">
36
+ <label for="import_units"><?php esc_html_e( 'Import Units', 'wp-recipe-maker' ); ?></label>
37
+ </th>
38
+ <td>
39
+ <?php $import_units = implode( PHP_EOL, WPRM_Settings::get( 'import_units' ) ); ?>
40
+ <textarea name="import_units" rows="12" cols="50" id="import_units" class="large-text code"><?php echo esc_html( $import_units ); ?></textarea>
41
+ <p class="description">
42
+ <?php esc_html_e( 'Units that will be recognized. One per line.', 'wp-recipe-maker' ); ?>
43
+ </p>
44
+ </td>
45
+ </tr>
46
+ <tr>
47
+ <th scope="row">
48
+ <label for="import_notes_identifier"><?php esc_html_e( 'Ingredient Notes Identifier', 'wp-recipe-maker' ); ?></label>
49
+ </th>
50
+ <td>
51
+ <select id="import_notes_identifier" name="import_notes_identifier">
52
+ <?php
53
+ $options = array(
54
+ 'comma' => __( 'Everything after the first comma', 'wp-recipe-maker' ),
55
+ 'parentheses' => __( 'Everything inside parentheses', 'wp-recipe-maker' ),
56
+ 'both' => __( 'Comma or parentheses, whichover comes first', 'wp-recipe-maker' ),
57
+ 'none' => __( 'Do not import to ingredient notes', 'wp-recipe-maker' ),
58
+ );
59
+
60
+ $setting = WPRM_Settings::get( 'import_notes_identifier' );
61
+ foreach ( $options as $option => $label ) {
62
+ $selected = $setting === $option ? ' selected="selected"' : '';
63
+ echo '<option value="' . esc_attr( $option ) . '"' . esc_attr( $selected ) . '>' . esc_html( $label ) . '</option>';
64
+ }
65
+ ?>
66
+ </select>
67
+ <p class="description">
68
+ <?php esc_html_e( 'How to recognize if it should be part of the ingredient notes.', 'wp-recipe-maker' ); ?>
69
+ </p>
70
+ </td>
71
+ </tr>
72
+ <tr>
73
+ <th scope="row">
74
+ <?php esc_html_e( 'Remove Identifier', 'wp-recipe-maker' ); ?>
75
+ </th>
76
+ <td>
77
+ <label for="import_notes_remove_identifier">
78
+ <?php $checked = WPRM_Settings::get( 'import_notes_remove_identifier' ) ? ' checked="checked"' : ''; ?>
79
+ <input name="import_notes_remove_identifier" type="checkbox" id="import_notes_remove_identifier"<?php echo esc_html( $checked ); ?> />
80
+ <?php esc_html_e( 'Remove the ingredient notes identifier from the notes', 'wp-recipe-maker' ); ?>
81
+ </label>
82
+ </td>
83
+ </tr>
84
+ </tbody>
85
+ </table>
86
+ <?php submit_button( __( 'Save Changes', 'wp-recipe-maker' ) ); ?>
87
+ </form>
templates/recipe/simple/simple.min.css CHANGED
@@ -1 +1 @@
1
- .wprm-recipe-simple{border-top:1px solid #aaa;background-color:#fafafa;padding:10px;margin:20px 0;font-size:.9em}.wprm-recipe-simple li,.wprm-recipe-simple p{font-size:1em}.wprm-recipe-simple :after,.wprm-recipe-simple :before{display:none}.wprm-recipe-simple h2.wprm-recipe-name,.wprm-recipe-simple h3.wprm-recipe-header,.wprm-recipe-simple h4.wprm-recipe-group-name{font-variant:normal;text-transform:none;letter-spacing:normal;margin:0;padding:0}.wprm-recipe-simple .wprm-recipe-image-container{float:right;text-align:center;margin:0 0 10px 10px}.wprm-recipe-simple .wprm-recipe-image-container .wprm-recipe-image{margin:0}.wprm-recipe-simple .wprm-recipe-image-container .wprm-recipe-rating{margin-bottom:5px}.wprm-recipe-simple .wprm-recipe-image-container .wprm-recipe-rating svg{vertical-align:middle;width:16px;height:16px;margin:0}.wprm-recipe-simple .wprm-recipe-image-container .wprm-recipe-rating .wprm-recipe-rating-details{font-size:.8em}.wprm-recipe-simple .wprm-recipe-image-container .wprm-recipe-print{font-size:.9em;cursor:pointer}.wprm-recipe-simple h2.wprm-recipe-name{clear:none;font-size:1.8em}.wprm-recipe-simple .wprm-recipe-details-container,.wprm-recipe-simple .wprm-recipe-summary{margin-bottom:15px}.wprm-recipe-simple .wprm-recipe-details-icon svg{vertical-align:middle;width:16px;height:16px}.wprm-recipe-simple .wprm-recipe-details-name{display:inline-block;font-weight:700;min-width:130px}.wprm-recipe-simple .wprm-recipe-details-unit{font-size:.8em}.wprm-recipe-simple h3.wprm-recipe-header{margin-top:10px;font-size:1.2em}.wprm-recipe-simple ol,.wprm-recipe-simple ul{margin:0 0 8px}.wprm-recipe-simple ol li,.wprm-recipe-simple ul li{margin:0 0 0 32px}.wprm-recipe-simple h4.wprm-recipe-group-name{margin-top:5px!important;font-weight:300;font-size:1em}.wprm-recipe-simple .wprm-recipe-ingredient-notes{opacity:.7}.wprm-recipe-simple .wprm-recipe-instructions .wprm-recipe-instruction{margin-bottom:5px}.wprm-recipe-simple .wprm-recipe-instruction-text p{margin:0 0 5px}.wprm-recipe-simple .wprm-recipe-instruction-text p:last-of-type{margin-bottom:0}.wprm-recipe-simple .wprm-recipe-instruction-image{margin:5px 0 15px}.wprm-print .wprm-recipe-simple{max-width:750px;margin:0 auto}.wprm-print .wprm-recipe-print{display:none}@media only screen and (max-width:640px){.wprm-recipe-simple .wprm-recipe-image-container{float:none}.wprm-recipe-simple .wprm-recipe-details-name{min-width:0}}
1
+ .wprm-recipe-simple{border-top:1px solid #aaa;background-color:#fafafa;padding:10px;margin:20px 0;font-size:.9em}.wprm-recipe-simple li,.wprm-recipe-simple p{font-size:1em}.wprm-recipe-simple :after,.wprm-recipe-simple :before{display:none}.wprm-recipe-simple h2.wprm-recipe-name,.wprm-recipe-simple h3.wprm-recipe-header,.wprm-recipe-simple h4.wprm-recipe-group-name{font-variant:normal;text-transform:none;letter-spacing:normal;margin:0;padding:0}.wprm-recipe-simple .wprm-recipe-image-container{float:right;text-align:center;margin:0 0 10px 10px}.wprm-recipe-simple .wprm-recipe-image-container .wprm-recipe-image{margin:0}.wprm-recipe-simple .wprm-recipe-image-container .wprm-recipe-rating{margin-bottom:5px}.wprm-recipe-simple .wprm-recipe-image-container .wprm-recipe-rating svg{vertical-align:middle;width:16px;height:16px;margin:0}.wprm-recipe-simple .wprm-recipe-image-container .wprm-recipe-rating .wprm-recipe-rating-details{font-size:.8em}.wprm-recipe-simple .wprm-recipe-image-container .wprm-recipe-print{font-size:.9em;cursor:pointer}.wprm-recipe-simple h2.wprm-recipe-name{clear:none;font-size:1.8em}.wprm-recipe-simple .wprm-recipe-details-container,.wprm-recipe-simple .wprm-recipe-summary{margin-bottom:15px}.wprm-recipe-simple .wprm-recipe-details-icon svg{vertical-align:middle;width:16px;height:16px}.wprm-recipe-simple .wprm-recipe-details-name{display:inline-block;font-weight:700;min-width:130px}.wprm-recipe-simple .wprm-recipe-details-unit{font-size:.8em}.wprm-recipe-simple h3.wprm-recipe-header{margin-top:10px;font-size:1.2em}.wprm-recipe-simple ol,.wprm-recipe-simple ul{margin:0 0 8px}.wprm-recipe-simple ol li,.wprm-recipe-simple ul li{margin:0 0 0 32px}.wprm-recipe-simple h4.wprm-recipe-group-name{margin-top:5px!important;font-weight:300;font-size:1em}.wprm-recipe-simple .wprm-recipe-ingredient-notes{opacity:.7}.wprm-recipe-simple .wprm-recipe-instructions .wprm-recipe-instruction{margin-bottom:5px}.wprm-recipe-simple .wprm-recipe-instruction-text{font-size:1em}.wprm-recipe-simple .wprm-recipe-instruction-text p{margin:0 0 5px}.wprm-recipe-simple .wprm-recipe-instruction-text p:last-of-type{margin-bottom:0}.wprm-recipe-simple .wprm-recipe-instruction-image{margin:5px 0 15px}.wprm-print .wprm-recipe-simple{max-width:750px;margin:0 auto}.wprm-print .wprm-recipe-print{display:none}@media only screen and (max-width:640px){.wprm-recipe-simple .wprm-recipe-image-container{float:none}.wprm-recipe-simple .wprm-recipe-details-name{min-width:0}}
templates/recipe/simple/simple.php CHANGED
@@ -119,6 +119,7 @@
119
  </ul>
120
  </div>
121
  <?php endforeach; // Ingredient groups. ?>
 
122
  </div>
123
  <?php endif; // Ingredients. ?>
124
  <?php
119
  </ul>
120
  </div>
121
  <?php endforeach; // Ingredient groups. ?>
122
+ <?php echo WPRM_Template_Helper::unit_conversion( $recipe ); ?>
123
  </div>
124
  <?php endif; // Ingredients. ?>
125
  <?php
templates/recipe/simple/simple.scss CHANGED
@@ -112,6 +112,8 @@
112
  }
113
 
114
  .wprm-recipe-instruction-text {
 
 
115
  p {
116
  margin: 0 0 5px;
117
  }
112
  }
113
 
114
  .wprm-recipe-instruction-text {
115
+ font-size: 1em;
116
+
117
  p {
118
  margin: 0 0 5px;
119
  }
templates/recipe/tastefully-simple/tastefully-simple.min.css CHANGED
@@ -1 +1 @@
1
- .wprm-print .wprm-recipe-print,.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,.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 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 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:10px "Trebuchet MS",Arial,Helvetica,sans-serif}.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;-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:150% 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:10px;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:disc inside;margin-left:10px;line-height:inherit;background:0 0}.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-instructions li,.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-instructions li{list-style:decimal;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{max-width:750px;margin:0 auto}@media only screen and (max-width:480px){.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-image-container{float:none;width:100%;max-width:none;text-align:center;margin-bottom:10px}.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-image-container .wprm-recipe-image{margin-left:0}.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-times-container{width:100%}}
1
+ .wprm-print .wprm-recipe-print,.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,.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:12px 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 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:10px "Trebuchet MS",Arial,Helvetica,sans-serif}.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;-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:150% 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:10px;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:disc 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{list-style:decimal;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{max-width:750px;margin:0 auto}@media only screen and (max-width:480px){.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-image-container{float:none;width:100%;max-width:none;text-align:center;margin-bottom:10px}.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-image-container .wprm-recipe-image{margin-left:0}.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-times-container{width:100%}}
templates/recipe/tastefully-simple/tastefully-simple.php CHANGED
@@ -123,6 +123,7 @@
123
  </ul>
124
  </div>
125
  <?php endforeach; // Ingredient groups. ?>
 
126
  </div>
127
  <?php endif; // Ingredients. ?>
128
  <?php
123
  </ul>
124
  </div>
125
  <?php endforeach; // Ingredient groups. ?>
126
+ <?php echo WPRM_Template_Helper::unit_conversion( $recipe ); ?>
127
  </div>
128
  <?php endif; // Ingredients. ?>
129
  <?php
templates/recipe/tastefully-simple/tastefully-simple.scss CHANGED
@@ -4,6 +4,10 @@
4
  border: 1px dashed #666;
5
  padding: 10px;
6
 
 
 
 
 
7
  div,
8
  li,
9
  ol,
@@ -135,6 +139,10 @@
135
  }
136
  }
137
 
 
 
 
 
138
  .wprm-recipe-instructions {
139
  li {
140
  list-style: decimal;
4
  border: 1px dashed #666;
5
  padding: 10px;
6
 
7
+ p, li {
8
+ font: 12px Verdana, Arial, Geneva, sans-serif;
9
+ }
10
+
11
  div,
12
  li,
13
  ol,
139
  }
140
  }
141
 
142
+ .wprm-unit-conversion-container {
143
+ margin-top: 10px;
144
+ }
145
+
146
  .wprm-recipe-instructions {
147
  li {
148
  list-style: decimal;
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.0
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.20.0
19
  * Author: Bootstrapped Ventures
20
  * Author URI: http://bootstrapped.ventures/
21
  * License: GPL-2.0+