Version Description
- Feature: New "Tastefully Simple" template, similar to EasyRecipe
- Feature: New "Clean Print with Image" recipe template
- Feature: Print recipe shortcode
- Feature: Jump to recipe shortcode
- Improvement: Shortcode preview includes image and summary
- Fix: use ratingCount instead of reviewCount for JSON-LD metadata
- Fix: Trailing slash issue in asset URLs
Download this release
Release Info
Developer | BrechtVds |
Plugin | WP Recipe Maker |
Version | 1.2.0 |
Comparing to | |
See all releases |
Code changes from version 1.1.0 to 1.2.0
- assets/css/admin/modal.min.css +1 -1
- assets/css/admin/modal.scss +1 -0
- assets/css/admin/modal/_container.scss +290 -270
- assets/css/admin/modal/_recipe-details.scss +0 -20
- assets/css/admin/modal/_shortcode-builder.scss +45 -0
- assets/css/admin/settings.min.css +1 -0
- assets/css/admin/settings.scss +37 -0
- assets/js/admin/modal.js +68 -7
- assets/js/admin/recipe-form.js +137 -135
- assets/js/admin/recipe-snippets.js +55 -0
- assets/js/admin/settings.js +5 -0
- assets/js/admin/shortcode-tinymce.js +10 -7
- assets/js/admin/shortcode.js +0 -15
- assets/js/public/print.js +20 -11
- includes/admin/class-wprm-import-manager.php +4 -4
- includes/admin/import/class-wprm-import-easyrecipe.php +3 -3
- includes/admin/menu/class-wprm-admin-menu-faq.php +20 -1
- includes/admin/menu/class-wprm-admin-menu.php +1 -1
- includes/admin/modal/class-wprm-modal.php +35 -9
- includes/admin/modal/class-wprm-shortcode-preview.php +6 -4
- includes/class-wp-recipe-maker.php +2 -1
- includes/class-wprm-activator.php +2 -0
- includes/public/class-wprm-comment-rating.php +3 -3
- includes/public/class-wprm-fallback-recipe.php +1 -1
- includes/public/class-wprm-metadata.php +1 -1
- includes/public/class-wprm-print.php +2 -2
- includes/public/class-wprm-recipe-manager.php +46 -0
- includes/public/class-wprm-recipe.php +10 -0
- includes/public/class-wprm-settings.php +154 -0
- includes/public/class-wprm-shortcode.php +67 -1
- includes/public/class-wprm-template-manager.php +115 -5
- readme.txt +19 -0
- templates/admin/menu/faq.php +2 -2
- templates/admin/menu/faq/getting_started.php +1 -1
- templates/admin/menu/faq/support.php +1 -1
- templates/admin/menu/faq/welcome.php +1 -1
- templates/admin/menu/faq/whats_new.php +11 -0
- templates/admin/modal/modal.php +4 -3
- templates/admin/modal/shortcode-preview.php +21 -0
- templates/admin/modal/tabs/recipe-snippets-jump.php +48 -0
- templates/admin/modal/tabs/recipe-snippets-print.php +48 -0
- templates/admin/settings/settings.php +87 -0
- templates/recipe/clean-print-with-image/clean-print-with-image.jpg +0 -0
- templates/recipe/clean-print-with-image/clean-print-with-image.min.css +1 -0
- templates/recipe/clean-print-with-image/clean-print-with-image.php +143 -0
- templates/recipe/clean-print-with-image/clean-print-with-image.scss +77 -0
- templates/recipe/clean-print/clean-print.jpg +0 -0
- templates/recipe/simple/simple.jpg +0 -0
- templates/recipe/simple/simple.min.css +1 -1
- templates/recipe/simple/simple.scss +5 -0
- templates/recipe/tastefully-simple/tastefully-simple.jpg +0 -0
- templates/recipe/tastefully-simple/tastefully-simple.min.css +1 -0
- templates/recipe/tastefully-simple/tastefully-simple.php +181 -0
- templates/recipe/tastefully-simple/tastefully-simple.scss +174 -0
- wp-recipe-maker.php +1 -1
assets/css/admin/modal.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.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-toolbar{z-index:100080}.medium-editor-element{border:1px solid #ddd;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.07);box-shadow:inset 0 1px 2px rgba(0,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,0.8);box-shadow:0 0 2px rgba(30,140,190,0.8)}.medium-editor-element:after{font-style:normal;color:#999;opacity:0.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-container{display:none}.wprm-modal-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;min-height:360px;background:#000;opacity:0.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 0.1s ease-in-out,background 0.1s ease-in-out;transition:color 0.1s ease-in-out,background 0.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,0.7);box-shadow:0 5px 15px rgba(0,0,0,0.7);background:#fcfcfc;-webkit-font-smoothing:subpixel-antialiased}.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 .dashicons,.wprm-frame.hide-router .wprm-frame-router{display:none}.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,.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-menu>a,.wprm-router>a{line-height:18px;font-size:14px;text-decoration:none}.wprm-frame a{border-bottom:none;color:#0073aa}.wprm-frame .hidden{display:none}.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:not(.active){display: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-content-tab{margin:20px}.wprm-frame-content-tab:not(.active){display:none}.wprm-frame-toolbar{position:absolute;left:200px;right:0;bottom:0;height:60px;z-index:100}.wprm-toolbar{position:absolute;top:0;left:0;right:0;z-index:100;height:60px;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-title{left: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{left:0}.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-details-form,.wprm-recipe-notes-form{max-width:600px}.wprm-recipe-details-form .wprm-recipe-details-form-container,.wprm-recipe-details-form .wprm-recipe-notes-form-container,.wprm-recipe-notes-form .wprm-recipe-details-form-container,.wprm-recipe-notes-form .wprm-recipe-notes-form-container{margin-bottom:15px;vertical-align:top}.wprm-recipe-details-form .wprm-recipe-details-form-container-halfs,.wprm-recipe-notes-form .wprm-recipe-details-form-container-halfs{display:inline-block;width:50%}.wprm-recipe-details-form .wprm-recipe-details-form-container-thirds,.wprm-recipe-notes-form .wprm-recipe-details-form-container-thirds{display:inline-block;width:33.3%}.wprm-recipe-details-form label,.wprm-recipe-notes-form label{display:block;font-weight:bold;margin-bottom:5px}.wprm-recipe-details-form input,.wprm-recipe-notes-form input{margin:0;width:100%;max-width:120px;height:34px;line-height:34px}.wprm-recipe-details-form input#wprm-recipe-name,.wprm-recipe-notes-form input#wprm-recipe-name{max-width:450px}.wprm-recipe-details-form input[type="number"],.wprm-recipe-notes-form input[type="number"]{max-width:50px}.wprm-recipe-details-form input#wprm-recipe-calories,.wprm-recipe-notes-form input#wprm-recipe-calories{max-width:70px}.wprm-recipe-details-form input.select2_wprm-search__field,.wprm-recipe-notes-form input.select2_wprm-search__field{height:18px;line-height:18px}.wprm-recipe-details-form select,.wprm-recipe-notes-form select{width:100%}.wprm-recipe-details-form textarea,.wprm-recipe-notes-form textarea{width:100%;resize:vertical}.wprm-recipe-details-form ::-webkit-input-placeholder,.wprm-recipe-notes-form ::-webkit-input-placeholder{color:#999;opacity:0.5}.wprm-recipe-details-form :-moz-placeholder,.wprm-recipe-notes-form :-moz-placeholder{color:#999;opacity:0.5}.wprm-recipe-details-form ::-moz-placeholder,.wprm-recipe-notes-form ::-moz-placeholder{color:#999;opacity:0.5}.wprm-recipe-details-form :-ms-input-placeholder,.wprm-recipe-notes-form :-ms-input-placeholder{color:#999;opacity:0.5}.wprm-recipe-details-form .wprm-recipe-image-preview,.wprm-recipe-notes-form .wprm-recipe-image-preview{float:right;max-width:100px}.wprm-recipe-details-form .wprm-recipe-image-preview img,.wprm-recipe-notes-form .wprm-recipe-image-preview img{max-width:100%;height:auto}.wprm-recipe-details-form .wprm-recipe-summary-container,.wprm-recipe-notes-form .wprm-recipe-summary-container{clear:both}@media only screen and (max-width: 480px){.wprm-recipe-details-form .wprm-recipe-details-form-container-halfs,.wprm-recipe-details-form .wprm-recipe-details-form-container-thirds{display:block;width:100%}.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:0.5}.wprm-recipe-ingredients-form :-moz-placeholder,.wprm-recipe-instructions-form :-moz-placeholder{color:#999;opacity:0.5}.wprm-recipe-ingredients-form ::-moz-placeholder,.wprm-recipe-instructions-form ::-moz-placeholder{color:#999;opacity:0.5}.wprm-recipe-ingredients-form :-ms-input-placeholder,.wprm-recipe-instructions-form :-ms-input-placeholder{color:#999;opacity:0.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:0.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}
|
1 |
+
.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-toolbar{z-index:100080}.medium-editor-element{border:1px solid #ddd;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.07);box-shadow:inset 0 1px 2px rgba(0,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,0.8);box-shadow:0 0 2px rgba(30,140,190,0.8)}.medium-editor-element:after{font-style:normal;color:#999;opacity:0.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-container{display:none}.wprm-modal-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;min-height:360px;background:#000;opacity:0.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 0.1s ease-in-out,background 0.1s ease-in-out;transition:color 0.1s ease-in-out,background 0.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,0.7);box-shadow:0 5px 15px rgba(0,0,0,0.7);background:#fcfcfc;-webkit-font-smoothing:subpixel-antialiased}.wprm-modal-content ::-webkit-input-placeholder{color:#999;opacity:0.5}.wprm-modal-content :-moz-placeholder{color:#999;opacity:0.5}.wprm-modal-content ::-moz-placeholder{color:#999;opacity:0.5}.wprm-modal-content :-ms-input-placeholder{color:#999;opacity:0.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 .dashicons,.wprm-frame.hide-router .wprm-frame-router{display:none}.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,.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-menu>a,.wprm-router>a{line-height:18px;font-size:14px;text-decoration:none}.wprm-frame a{border-bottom:none;color:#0073aa}.wprm-frame .hidden{display:none}.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:not(.active){display: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-content-tab{margin:20px}.wprm-frame-content-tab:not(.active){display:none}.wprm-frame-toolbar{position:absolute;left:200px;right:0;bottom:0;height:60px;z-index:100}.wprm-toolbar{position:absolute;top:0;left:0;right:0;z-index:100;height:60px;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-title{left: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{left:0}.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-details-form,.wprm-recipe-notes-form{max-width:600px}.wprm-recipe-details-form .wprm-recipe-details-form-container,.wprm-recipe-details-form .wprm-recipe-notes-form-container,.wprm-recipe-notes-form .wprm-recipe-details-form-container,.wprm-recipe-notes-form .wprm-recipe-notes-form-container{margin-bottom:15px;vertical-align:top}.wprm-recipe-details-form .wprm-recipe-details-form-container-halfs,.wprm-recipe-notes-form .wprm-recipe-details-form-container-halfs{display:inline-block;width:50%}.wprm-recipe-details-form .wprm-recipe-details-form-container-thirds,.wprm-recipe-notes-form .wprm-recipe-details-form-container-thirds{display:inline-block;width:33.3%}.wprm-recipe-details-form label,.wprm-recipe-notes-form label{display:block;font-weight:bold;margin-bottom:5px}.wprm-recipe-details-form input,.wprm-recipe-notes-form input{margin:0;width:100%;max-width:120px;height:34px;line-height:34px}.wprm-recipe-details-form input#wprm-recipe-name,.wprm-recipe-notes-form input#wprm-recipe-name{max-width:450px}.wprm-recipe-details-form input[type="number"],.wprm-recipe-notes-form input[type="number"]{max-width:50px}.wprm-recipe-details-form input#wprm-recipe-calories,.wprm-recipe-notes-form input#wprm-recipe-calories{max-width:70px}.wprm-recipe-details-form input.select2_wprm-search__field,.wprm-recipe-notes-form input.select2_wprm-search__field{height:18px;line-height:18px}.wprm-recipe-details-form select,.wprm-recipe-notes-form select{width:100%}.wprm-recipe-details-form textarea,.wprm-recipe-notes-form textarea{width:100%;resize:vertical}.wprm-recipe-details-form .wprm-recipe-image-preview,.wprm-recipe-notes-form .wprm-recipe-image-preview{float:right;max-width:100px}.wprm-recipe-details-form .wprm-recipe-image-preview img,.wprm-recipe-notes-form .wprm-recipe-image-preview img{max-width:100%;height:auto}.wprm-recipe-details-form .wprm-recipe-summary-container,.wprm-recipe-notes-form .wprm-recipe-summary-container{clear:both}@media only screen and (max-width: 480px){.wprm-recipe-details-form .wprm-recipe-details-form-container-halfs,.wprm-recipe-details-form .wprm-recipe-details-form-container-thirds{display:block;width:100%}.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:0.5}.wprm-recipe-ingredients-form :-moz-placeholder,.wprm-recipe-instructions-form :-moz-placeholder{color:#999;opacity:0.5}.wprm-recipe-ingredients-form ::-moz-placeholder,.wprm-recipe-instructions-form ::-moz-placeholder{color:#999;opacity:0.5}.wprm-recipe-ingredients-form :-ms-input-placeholder,.wprm-recipe-instructions-form :-ms-input-placeholder{color:#999;opacity:0.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:0.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:bold;margin-bottom:5px}.wprm-shortcode-builder .wprm-shortcode-builder-helper{margin-left:5px;font-size:0.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.scss
CHANGED
@@ -1,3 +1,4 @@
|
|
1 |
@import "modal/container";
|
2 |
@import "modal/recipe-details";
|
3 |
@import "modal/recipe-ingredients";
|
|
1 |
@import "modal/container";
|
2 |
@import "modal/recipe-details";
|
3 |
@import "modal/recipe-ingredients";
|
4 |
+
@import "modal/shortcode-builder";
|
assets/css/admin/modal/_container.scss
CHANGED
@@ -1,363 +1,383 @@
|
|
1 |
.select2_wprm-container {
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
}
|
13 |
.medium-editor-toolbar {
|
14 |
-
|
15 |
}
|
16 |
.medium-editor-element {
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
}
|
41 |
.wprm-modal-container {
|
42 |
-
|
43 |
}
|
44 |
.wprm-modal-backdrop {
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
}
|
55 |
.wprm-modal {
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
}
|
68 |
.wprm-modal-close {
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
}
|
88 |
.wprm-modal-content {
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
}
|
101 |
.wprm-frame {
|
102 |
-
|
103 |
-
|
104 |
}
|
105 |
.wprm-frame,
|
106 |
.wprm-frame-menu {
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
}
|
112 |
.wprm-frame-menu {
|
113 |
-
|
114 |
-
|
115 |
}
|
116 |
.wprm-frame-title .dashicons,
|
117 |
.wprm-frame.hide-router .wprm-frame-router {
|
118 |
-
|
119 |
}
|
120 |
.wprm-frame-title {
|
121 |
-
|
122 |
-
|
123 |
}
|
124 |
.wprm-frame-router,
|
125 |
.wprm-frame-title {
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
}
|
131 |
.wprm-menu-item {
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
}
|
136 |
.wprm-menu {
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
}
|
146 |
.wprm-menu,
|
147 |
.wprm-sidebar {
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
}
|
153 |
.wprm-menu .active,
|
154 |
.wprm-menu .active:hover {
|
155 |
-
|
156 |
-
|
157 |
}
|
158 |
.wprm-menu > a {
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
}
|
165 |
.wprm-menu > a,
|
166 |
.wprm-router > a {
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
}
|
171 |
.wprm-frame a {
|
172 |
-
|
173 |
-
|
174 |
}
|
175 |
.wprm-frame .hidden {
|
176 |
-
|
177 |
}
|
178 |
.wprm-menu .separator {
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
}
|
184 |
.wprm-frame-title h1 {
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
}
|
190 |
.wprm-frame-router {
|
191 |
-
|
192 |
-
|
193 |
}
|
194 |
.wprm-router {
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
}
|
204 |
.wprm-router > a {
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
}
|
211 |
.wprm-router a {
|
212 |
-
|
213 |
-
|
214 |
}
|
215 |
.wprm-router > a:last-child {
|
216 |
-
|
217 |
}
|
218 |
.wprm-router .active,
|
219 |
.wprm-router > a.active:last-child {
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
}
|
225 |
.wprm-router .active,
|
226 |
.wprm-router .active:hover {
|
227 |
-
|
228 |
}
|
229 |
.wprm-frame-content {
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
}
|
243 |
.wprm-frame-content-tab {
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
}
|
249 |
.wprm-frame-toolbar {
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
}
|
257 |
.wprm-toolbar {
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
}
|
268 |
.wprm-modal-content .wprm-toolbar-primary.search-form {
|
269 |
-
|
270 |
}
|
271 |
.wprm-toolbar-primary {
|
272 |
-
|
273 |
-
|
274 |
}
|
275 |
.wprm-modal-content .wprm-toolbar-primary .wprm-button {
|
276 |
-
|
277 |
}
|
278 |
.wprm-toolbar-primary > .wprm-button,
|
279 |
.wprm-toolbar-primary > .wprm-button-group {
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
}
|
284 |
@media only screen and (max-width: 900px) {
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
}
|
335 |
@media only screen and (max-width: 640px), screen and (max-height: 400px) {
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
}
|
347 |
@media only screen and (max-width: 480px) {
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
}
|
1 |
.select2_wprm-container {
|
2 |
+
z-index: 100075;
|
3 |
+
&.select2_wprm-container--focus .select2_wprm-selection {
|
4 |
+
border-color: #5b9dd9;
|
5 |
+
}
|
6 |
+
li {
|
7 |
+
margin: 0;
|
8 |
+
}
|
9 |
+
.select2_wprm-selection {
|
10 |
+
border-color: #ddd;
|
11 |
+
}
|
12 |
}
|
13 |
.medium-editor-toolbar {
|
14 |
+
z-index: 100080;
|
15 |
}
|
16 |
.medium-editor-element {
|
17 |
+
border: 1px solid #ddd;
|
18 |
+
-webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,.07);
|
19 |
+
box-shadow: inset 0 1px 2px rgba(0,0,0,.07);
|
20 |
+
min-height: 68px;
|
21 |
+
padding: 3px 5px;
|
22 |
+
&:focus {
|
23 |
+
border-color: #5b9dd9;
|
24 |
+
-webkit-box-shadow: 0 0 2px rgba(30,140,190,.8);
|
25 |
+
box-shadow: 0 0 2px rgba(30,140,190,.8);
|
26 |
+
}
|
27 |
+
&:after {
|
28 |
+
font-style: normal;
|
29 |
+
color: #999;
|
30 |
+
opacity: 0.5;
|
31 |
+
font-size: 14px;
|
32 |
+
line-height: 28px;
|
33 |
+
}
|
34 |
+
p:first-child {
|
35 |
+
margin-top: 0;
|
36 |
+
}
|
37 |
+
p:last-child {
|
38 |
+
margin-bottom: 0;
|
39 |
+
}
|
40 |
}
|
41 |
.wprm-modal-container {
|
42 |
+
display: none;
|
43 |
}
|
44 |
.wprm-modal-backdrop {
|
45 |
+
position: fixed;
|
46 |
+
top: 0;
|
47 |
+
left: 0;
|
48 |
+
right: 0;
|
49 |
+
bottom: 0;
|
50 |
+
min-height: 360px;
|
51 |
+
background: #000;
|
52 |
+
opacity: 0.7;
|
53 |
+
z-index: 100000;
|
54 |
}
|
55 |
.wprm-modal {
|
56 |
+
position: fixed;
|
57 |
+
top: 30px;
|
58 |
+
left: 30px;
|
59 |
+
right: 30px;
|
60 |
+
bottom: 30px;
|
61 |
+
z-index: 100050;
|
62 |
+
* {
|
63 |
+
-webkit-box-sizing: border-box;
|
64 |
+
-moz-box-sizing: border-box;
|
65 |
+
box-sizing: border-box;
|
66 |
+
}
|
67 |
}
|
68 |
.wprm-modal-close {
|
69 |
+
position: absolute;
|
70 |
+
top: 0;
|
71 |
+
right: 0;
|
72 |
+
width: 50px;
|
73 |
+
height: 50px;
|
74 |
+
padding: 0;
|
75 |
+
z-index: 1000;
|
76 |
+
-webkit-transition: color 0.1s ease-in-out,background 0.1s ease-in-out;
|
77 |
+
transition: color 0.1s ease-in-out,background 0.1s ease-in-out;
|
78 |
+
.wprm-modal-icon:before {
|
79 |
+
content: "\f158";
|
80 |
+
font: 400 20px/1 dashicons;
|
81 |
+
speak: none;
|
82 |
+
vertical-align: middle;
|
83 |
+
-webkit-font-smoothing: antialiased;
|
84 |
+
-moz-osx-font-smoothing: grayscale;
|
85 |
+
color: #666;
|
86 |
+
}
|
87 |
}
|
88 |
.wprm-modal-content {
|
89 |
+
position: absolute;
|
90 |
+
top: 0;
|
91 |
+
left: 0;
|
92 |
+
right: 0;
|
93 |
+
bottom: 0;
|
94 |
+
overflow: auto;
|
95 |
+
min-height: 300px;
|
96 |
+
-webkit-box-shadow: 0 5px 15px rgba(0,0,0,.7);
|
97 |
+
box-shadow: 0 5px 15px rgba(0,0,0,.7);
|
98 |
+
background: #fcfcfc;
|
99 |
+
-webkit-font-smoothing: subpixel-antialiased;
|
100 |
+
|
101 |
+
::-webkit-input-placeholder {
|
102 |
+
color: #999;
|
103 |
+
opacity: 0.5;
|
104 |
+
}
|
105 |
+
|
106 |
+
:-moz-placeholder {
|
107 |
+
color: #999;
|
108 |
+
opacity: 0.5;
|
109 |
+
}
|
110 |
+
|
111 |
+
::-moz-placeholder {
|
112 |
+
color: #999;
|
113 |
+
opacity: 0.5;
|
114 |
+
}
|
115 |
+
|
116 |
+
:-ms-input-placeholder {
|
117 |
+
color: #999;
|
118 |
+
opacity: 0.5;
|
119 |
+
}
|
120 |
}
|
121 |
.wprm-frame {
|
122 |
+
overflow: hidden;
|
123 |
+
right: 0;
|
124 |
}
|
125 |
.wprm-frame,
|
126 |
.wprm-frame-menu {
|
127 |
+
position: absolute;
|
128 |
+
left: 0;
|
129 |
+
bottom: 0;
|
130 |
+
top: 0;
|
131 |
}
|
132 |
.wprm-frame-menu {
|
133 |
+
width: 200px;
|
134 |
+
z-index: 150;
|
135 |
}
|
136 |
.wprm-frame-title .dashicons,
|
137 |
.wprm-frame.hide-router .wprm-frame-router {
|
138 |
+
display: none;
|
139 |
}
|
140 |
.wprm-frame-title {
|
141 |
+
top: 0;
|
142 |
+
height: 50px;
|
143 |
}
|
144 |
.wprm-frame-router,
|
145 |
.wprm-frame-title {
|
146 |
+
z-index: 200;
|
147 |
+
left: 200px;
|
148 |
+
position: absolute;
|
149 |
+
right: 0;
|
150 |
}
|
151 |
.wprm-menu-item {
|
152 |
+
-webkit-box-sizing: content-box;
|
153 |
+
-moz-box-sizing: content-box;
|
154 |
+
box-sizing: content-box;
|
155 |
}
|
156 |
.wprm-menu {
|
157 |
+
position: absolute;
|
158 |
+
left: 0;
|
159 |
+
margin: 0;
|
160 |
+
padding: 10px 0;
|
161 |
+
border-right-width: 1px;
|
162 |
+
border-right-style: solid;
|
163 |
+
border-right-color: #ccc;
|
164 |
+
user-select: none;
|
165 |
}
|
166 |
.wprm-menu,
|
167 |
.wprm-sidebar {
|
168 |
+
top: 0;
|
169 |
+
bottom: 0;
|
170 |
+
background: #f3f3f3;
|
171 |
+
right: 0;
|
172 |
}
|
173 |
.wprm-menu .active,
|
174 |
.wprm-menu .active:hover {
|
175 |
+
color: #23282d;
|
176 |
+
font-weight: 700;
|
177 |
}
|
178 |
.wprm-menu > a {
|
179 |
+
display: block;
|
180 |
+
position: relative;
|
181 |
+
padding: 8px 20px;
|
182 |
+
margin: 0;
|
183 |
+
color: #0073aa;
|
184 |
}
|
185 |
.wprm-menu > a,
|
186 |
.wprm-router > a {
|
187 |
+
line-height: 18px;
|
188 |
+
font-size: 14px;
|
189 |
+
text-decoration: none;
|
190 |
}
|
191 |
.wprm-frame a {
|
192 |
+
border-bottom: none;
|
193 |
+
color: #0073aa;
|
194 |
}
|
195 |
.wprm-frame .hidden {
|
196 |
+
display: none;
|
197 |
}
|
198 |
.wprm-menu .separator {
|
199 |
+
height: 0;
|
200 |
+
margin: 12px 20px;
|
201 |
+
padding: 0;
|
202 |
+
border-top: 1px solid #ddd;
|
203 |
}
|
204 |
.wprm-frame-title h1 {
|
205 |
+
padding: 0 16px;
|
206 |
+
font-size: 22px;
|
207 |
+
line-height: 50px;
|
208 |
+
margin: 0;
|
209 |
}
|
210 |
.wprm-frame-router {
|
211 |
+
top: 50px;
|
212 |
+
height: 36px;
|
213 |
}
|
214 |
.wprm-router {
|
215 |
+
position: relative;
|
216 |
+
padding: 0 6px;
|
217 |
+
margin: 0;
|
218 |
+
clear: both;
|
219 |
+
user-select: none;
|
220 |
+
&:not(.active) {
|
221 |
+
display: none;
|
222 |
+
}
|
223 |
}
|
224 |
.wprm-router > a {
|
225 |
+
position: relative;
|
226 |
+
float: left;
|
227 |
+
padding: 8px 10px 9px;
|
228 |
+
margin: 0;
|
229 |
+
height: 18px;
|
230 |
}
|
231 |
.wprm-router a {
|
232 |
+
-webkit-transition: none;
|
233 |
+
transition: none;
|
234 |
}
|
235 |
.wprm-router > a:last-child {
|
236 |
+
border-right: 0;
|
237 |
}
|
238 |
.wprm-router .active,
|
239 |
.wprm-router > a.active:last-child {
|
240 |
+
margin: -1px -1px 0;
|
241 |
+
background: #fff;
|
242 |
+
border: 1px solid #ddd;
|
243 |
+
border-bottom: none;
|
244 |
}
|
245 |
.wprm-router .active,
|
246 |
.wprm-router .active:hover {
|
247 |
+
color: #32373c;
|
248 |
}
|
249 |
.wprm-frame-content {
|
250 |
+
position: absolute;
|
251 |
+
top: 84px;
|
252 |
+
left: 200px;
|
253 |
+
right: 0;
|
254 |
+
bottom: 61px;
|
255 |
+
height: auto;
|
256 |
+
width: auto;
|
257 |
+
margin: 0;
|
258 |
+
overflow: auto;
|
259 |
+
background: #fff;
|
260 |
+
border-top: 1px solid #ddd;
|
261 |
+
border-bottom: 1px solid #ddd;
|
262 |
}
|
263 |
.wprm-frame-content-tab {
|
264 |
+
margin: 20px;
|
265 |
+
&:not(.active) {
|
266 |
+
display: none;
|
267 |
+
}
|
268 |
}
|
269 |
.wprm-frame-toolbar {
|
270 |
+
position: absolute;
|
271 |
+
left: 200px;
|
272 |
+
right: 0;
|
273 |
+
bottom: 0;
|
274 |
+
height: 60px;
|
275 |
+
z-index: 100;
|
276 |
}
|
277 |
.wprm-toolbar {
|
278 |
+
position: absolute;
|
279 |
+
top: 0;
|
280 |
+
left: 0;
|
281 |
+
right: 0;
|
282 |
+
z-index: 100;
|
283 |
+
height: 60px;
|
284 |
+
padding: 0 16px;
|
285 |
+
border: 0 solid #ddd;
|
286 |
+
overflow: hidden;
|
287 |
}
|
288 |
.wprm-modal-content .wprm-toolbar-primary.search-form {
|
289 |
+
width: 33%;
|
290 |
}
|
291 |
.wprm-toolbar-primary {
|
292 |
+
float: right;
|
293 |
+
height: 100%;
|
294 |
}
|
295 |
.wprm-modal-content .wprm-toolbar-primary .wprm-button {
|
296 |
+
float: right;
|
297 |
}
|
298 |
.wprm-toolbar-primary > .wprm-button,
|
299 |
.wprm-toolbar-primary > .wprm-button-group {
|
300 |
+
margin-left: 10px;
|
301 |
+
float: left;
|
302 |
+
margin-top: 15px;
|
303 |
}
|
304 |
@media only screen and (max-width: 900px) {
|
305 |
+
.wprm-frame:not(.hide-menu) .wprm-frame-title .dashicons {
|
306 |
+
display: inline-block;
|
307 |
+
line-height: 50px;
|
308 |
+
}
|
309 |
+
.wprm-frame:not(.hide-menu) .wprm-frame-menu {
|
310 |
+
position: static;
|
311 |
+
width: 0;
|
312 |
+
}
|
313 |
+
.wprm-frame:not(.hide-menu) .wprm-frame-title {
|
314 |
+
left: 0;
|
315 |
+
}
|
316 |
+
.wprm-frame:not(.hide-menu) .wprm-frame-content,
|
317 |
+
.wprm-frame:not(.hide-menu) .wprm-frame-router,
|
318 |
+
.wprm-frame:not(.hide-menu) .wprm-frame-title,
|
319 |
+
.wprm-frame:not(.hide-menu) .wprm-frame-toolbar {
|
320 |
+
left: 0;
|
321 |
+
}
|
322 |
+
.wprm-frame:not(.hide-menu) .wprm-menu.visible {
|
323 |
+
left: 0;
|
324 |
+
}
|
325 |
+
.wprm-frame:not(.hide-menu) .wprm-menu {
|
326 |
+
width: auto;
|
327 |
+
max-width: 80%;
|
328 |
+
overflow: auto;
|
329 |
+
z-index: 2000;
|
330 |
+
top: 50px;
|
331 |
+
left: -300px;
|
332 |
+
right: auto;
|
333 |
+
bottom: auto;
|
334 |
+
padding: 5px 0;
|
335 |
+
border: 1px solid #ccc;
|
336 |
+
}
|
337 |
+
.wprm-frame:not(.hide-menu) .wprm-menu > a.active {
|
338 |
+
display: none;
|
339 |
+
}
|
340 |
+
.wprm-frame:not(.hide-menu) .wprm-menu > a {
|
341 |
+
padding: 12px 16px;
|
342 |
+
font-size: 16px;
|
343 |
+
}
|
344 |
+
.wprm-frame:not(.hide-menu) .wprm-menu .separator {
|
345 |
+
margin: 5px 10px;
|
346 |
+
}
|
347 |
+
.wprm-frame:not(.hide-menu) .wprm-frame-title h1 {
|
348 |
+
color: #0073aa;
|
349 |
+
line-height: 3;
|
350 |
+
font-size: 18px;
|
351 |
+
float: left;
|
352 |
+
cursor: pointer;
|
353 |
+
}
|
354 |
}
|
355 |
@media only screen and (max-width: 640px), screen and (max-height: 400px) {
|
356 |
+
.wprm-modal {
|
357 |
+
position: fixed;
|
358 |
+
top: 0;
|
359 |
+
left: 0;
|
360 |
+
right: 0;
|
361 |
+
bottom: 0;
|
362 |
+
.wprm-frame-title {
|
363 |
+
height: 40px;
|
364 |
+
}
|
365 |
+
}
|
366 |
}
|
367 |
@media only screen and (max-width: 480px) {
|
368 |
+
.wprm-frame:not(.hide-menu) .wprm-frame-title .dashicons {
|
369 |
+
line-height: 40px;
|
370 |
+
}
|
371 |
+
.wprm-frame-router,
|
372 |
+
.wprm-frame:not(.hide-menu) .wprm-menu {
|
373 |
+
top: 40px;
|
374 |
+
}
|
375 |
+
.wprm-frame:not(.hide-menu) .wprm-frame-title h1,
|
376 |
+
.wprm-modal .wprm-frame-title h1 {
|
377 |
+
font-size: 18px;
|
378 |
+
line-height: 40px;
|
379 |
+
}
|
380 |
+
.wprm-frame-content {
|
381 |
+
top: 74px;
|
382 |
+
}
|
383 |
}
|
assets/css/admin/modal/_recipe-details.scss
CHANGED
@@ -58,26 +58,6 @@
|
|
58 |
resize: vertical;
|
59 |
}
|
60 |
|
61 |
-
::-webkit-input-placeholder {
|
62 |
-
color: #999;
|
63 |
-
opacity: 0.5;
|
64 |
-
}
|
65 |
-
|
66 |
-
:-moz-placeholder {
|
67 |
-
color: #999;
|
68 |
-
opacity: 0.5;
|
69 |
-
}
|
70 |
-
|
71 |
-
::-moz-placeholder {
|
72 |
-
color: #999;
|
73 |
-
opacity: 0.5;
|
74 |
-
}
|
75 |
-
|
76 |
-
:-ms-input-placeholder {
|
77 |
-
color: #999;
|
78 |
-
opacity: 0.5;
|
79 |
-
}
|
80 |
-
|
81 |
.wprm-recipe-image-preview {
|
82 |
float: right;
|
83 |
max-width: 100px;
|
58 |
resize: vertical;
|
59 |
}
|
60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
.wprm-recipe-image-preview {
|
62 |
float: right;
|
63 |
max-width: 100px;
|
assets/css/admin/modal/_shortcode-builder.scss
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wprm-shortcode-builder {
|
2 |
+
.wprm-shortcode-builder-container {
|
3 |
+
margin-bottom: 15px;
|
4 |
+
vertical-align: top;
|
5 |
+
}
|
6 |
+
|
7 |
+
.wprm-shortcode-builder-container-halfs {
|
8 |
+
display: inline-block;
|
9 |
+
width: 50%;
|
10 |
+
}
|
11 |
+
|
12 |
+
.wprm-shortcode-builder-container-thirds {
|
13 |
+
display: inline-block;
|
14 |
+
width: 33.3%;
|
15 |
+
}
|
16 |
+
|
17 |
+
label {
|
18 |
+
display: block;
|
19 |
+
font-weight: bold;
|
20 |
+
margin-bottom: 5px;
|
21 |
+
}
|
22 |
+
|
23 |
+
.wprm-shortcode-builder-helper {
|
24 |
+
margin-left: 5px;
|
25 |
+
font-size: 0.8em;
|
26 |
+
font-style: italic;
|
27 |
+
}
|
28 |
+
|
29 |
+
input {
|
30 |
+
margin: 0;
|
31 |
+
width: 100%;
|
32 |
+
max-width: 250px;
|
33 |
+
height: 34px;
|
34 |
+
line-height: 34px;
|
35 |
+
|
36 |
+
&.select2_wprm-search__field {
|
37 |
+
height: 18px;
|
38 |
+
line-height: 18px;
|
39 |
+
}
|
40 |
+
}
|
41 |
+
|
42 |
+
select {
|
43 |
+
width: 250px;
|
44 |
+
}
|
45 |
+
}
|
assets/css/admin/settings.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.wprm-settings select{min-width:200px}.wprm-settings .select2_wprm-container{z-index:99000}.wprm-settings .template-preview-container .template-preview{float:left;text-align:center;width:250px;height:230px;overflow:hidden;margin:5px}.wprm-settings .template-preview-container .template-name{font-weight:bold;line-height:30px}.wprm-settings .template-preview-container .template-screenshot{width:250px}.wprm-settings .template-preview-container .template-no-screenshot{width:250px;height:200px;line-height:200px;border:1px dashed #999;box-sizing:border-box}
|
assets/css/admin/settings.scss
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wprm-settings {
|
2 |
+
select {
|
3 |
+
min-width: 200px;
|
4 |
+
}
|
5 |
+
|
6 |
+
.select2_wprm-container {
|
7 |
+
z-index: 99000;
|
8 |
+
}
|
9 |
+
|
10 |
+
.template-preview-container {
|
11 |
+
.template-preview {
|
12 |
+
float: left;
|
13 |
+
text-align: center;
|
14 |
+
width: 250px;
|
15 |
+
height: 230px;
|
16 |
+
overflow: hidden;
|
17 |
+
margin: 5px;
|
18 |
+
}
|
19 |
+
|
20 |
+
.template-name {
|
21 |
+
font-weight: bold;
|
22 |
+
line-height: 30px;
|
23 |
+
}
|
24 |
+
|
25 |
+
.template-screenshot {
|
26 |
+
width: 250px;
|
27 |
+
}
|
28 |
+
|
29 |
+
.template-no-screenshot {
|
30 |
+
width: 250px;
|
31 |
+
height: 200px;
|
32 |
+
line-height: 200px;
|
33 |
+
border: 1px dashed #999;
|
34 |
+
box-sizing: border-box;
|
35 |
+
}
|
36 |
+
}
|
37 |
+
}
|
assets/js/admin/modal.js
CHANGED
@@ -2,15 +2,32 @@ var wprm_admin = wprm_admin || {};
|
|
2 |
|
3 |
wprm_admin.active_editor_id = false;
|
4 |
|
5 |
-
wprm_admin.
|
6 |
-
|
7 |
-
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
wprm_admin.active_editor_id = editor_id;
|
11 |
-
wprm_admin.set_recipe(recipe_id);
|
12 |
jQuery('.wprm-modal-container').show();
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
// Default to first menu item
|
15 |
jQuery('.wprm-menu').find('.wprm-menu-item').first().click();
|
16 |
};
|
@@ -21,11 +38,35 @@ wprm_admin.close_modal = function() {
|
|
21 |
jQuery('.wprm-modal-container').hide();
|
22 |
};
|
23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
jQuery(document).ready(function($) {
|
25 |
// Opening Modal
|
26 |
jQuery(document).on('click', '.wprm-modal-button', function() {
|
27 |
var editor_id = jQuery(this).data('editor');
|
28 |
-
wprm_admin.open_modal(editor_id
|
29 |
});
|
30 |
|
31 |
// Closing Modal
|
@@ -54,7 +95,7 @@ jQuery(document).ready(function($) {
|
|
54 |
var active_tab = false;
|
55 |
jQuery('.wprm-router').find('.wprm-menu-item').removeClass('active');
|
56 |
jQuery('.wprm-frame-router').find('#wprm-menu-' + menu_target).find('.wprm-menu-item').each(function(index) {
|
57 |
-
if (index
|
58 |
active_tab = jQuery(this);
|
59 |
}
|
60 |
});
|
@@ -62,6 +103,9 @@ jQuery(document).ready(function($) {
|
|
62 |
if (active_tab) {
|
63 |
active_tab.click();
|
64 |
}
|
|
|
|
|
|
|
65 |
});
|
66 |
|
67 |
// Modal Menu on Mobile
|
@@ -78,8 +122,25 @@ jQuery(document).ready(function($) {
|
|
78 |
jQuery('.wprm-router').find('.wprm-menu-item').removeClass('active');
|
79 |
menu_item.addClass('active');
|
80 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
// Show correct tab
|
82 |
jQuery('.wprm-frame-content').find('.wprm-frame-content-tab').removeClass('active');
|
83 |
jQuery('.wprm-frame-content').find('#wprm-tab-' + tab_target).addClass('active');
|
84 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
});
|
2 |
|
3 |
wprm_admin.active_editor_id = false;
|
4 |
|
5 |
+
wprm_admin.disable_menu = function() {
|
6 |
+
jQuery('.wprm-frame-menu').find('.wprm-menu-item').hide();
|
7 |
+
};
|
8 |
+
|
9 |
+
wprm_admin.open_modal = function(editor_id, args) {
|
10 |
+
args = args === undefined ? {} : args;
|
11 |
+
|
12 |
+
// Reset button
|
13 |
+
jQuery('.wprm-button-action').text(wprm_modal.text.action_button_default).show();
|
14 |
+
|
15 |
+
// Enable menu items
|
16 |
+
jQuery('.wprm-menu-item').show();
|
17 |
|
18 |
wprm_admin.active_editor_id = editor_id;
|
|
|
19 |
jQuery('.wprm-modal-container').show();
|
20 |
|
21 |
+
// Init tabs
|
22 |
+
var tabs = jQuery('.wprm-router').find('.wprm-menu-item');
|
23 |
+
jQuery(tabs).each(function() {
|
24 |
+
init_callback = jQuery(this).data('init');
|
25 |
+
|
26 |
+
if (init_callback && typeof wprm_admin[init_callback] == 'function') {
|
27 |
+
wprm_admin[init_callback](args);
|
28 |
+
}
|
29 |
+
});
|
30 |
+
|
31 |
// Default to first menu item
|
32 |
jQuery('.wprm-menu').find('.wprm-menu-item').first().click();
|
33 |
};
|
38 |
jQuery('.wprm-modal-container').hide();
|
39 |
};
|
40 |
|
41 |
+
wprm_admin.shortcode_escape_map = {
|
42 |
+
'"': "'"
|
43 |
+
};
|
44 |
+
|
45 |
+
wprm_admin.shortcode_escape = function(text) {
|
46 |
+
return String(text).replace(/["]/g, function(s) {
|
47 |
+
return wprm_admin.shortcode_escape_map[s];
|
48 |
+
});
|
49 |
+
};
|
50 |
+
|
51 |
+
wprm_admin.add_text_to_editor = function(text) {
|
52 |
+
text = ' ' + text + ' ';
|
53 |
+
|
54 |
+
if (wprm_admin.active_editor_id) {
|
55 |
+
if (typeof tinyMCE == 'undefined' || !tinyMCE.get(wprm_admin.active_editor_id) || tinyMCE.get(wprm_admin.active_editor_id).isHidden()) {
|
56 |
+
var current = jQuery('textarea#' + wprm_admin.active_editor_id).val();
|
57 |
+
jQuery('textarea#' + wprm_admin.active_editor_id).val(current + text);
|
58 |
+
} else {
|
59 |
+
tinyMCE.get(wprm_admin.active_editor_id).focus(true);
|
60 |
+
tinyMCE.activeEditor.execCommand('mceInsertContent', false, text);
|
61 |
+
}
|
62 |
+
}
|
63 |
+
};
|
64 |
+
|
65 |
jQuery(document).ready(function($) {
|
66 |
// Opening Modal
|
67 |
jQuery(document).on('click', '.wprm-modal-button', function() {
|
68 |
var editor_id = jQuery(this).data('editor');
|
69 |
+
wprm_admin.open_modal(editor_id);
|
70 |
});
|
71 |
|
72 |
// Closing Modal
|
95 |
var active_tab = false;
|
96 |
jQuery('.wprm-router').find('.wprm-menu-item').removeClass('active');
|
97 |
jQuery('.wprm-frame-router').find('#wprm-menu-' + menu_target).find('.wprm-menu-item').each(function(index) {
|
98 |
+
if (index === 0 || jQuery(this).data('tab') == menu_tab) {
|
99 |
active_tab = jQuery(this);
|
100 |
}
|
101 |
});
|
103 |
if (active_tab) {
|
104 |
active_tab.click();
|
105 |
}
|
106 |
+
|
107 |
+
// Change main title
|
108 |
+
jQuery('.wprm-frame-title').find('h1').text(menu_item.text());
|
109 |
});
|
110 |
|
111 |
// Modal Menu on Mobile
|
122 |
jQuery('.wprm-router').find('.wprm-menu-item').removeClass('active');
|
123 |
menu_item.addClass('active');
|
124 |
|
125 |
+
// Hide action button if no callback is set
|
126 |
+
if (menu_item.data('callback')) {
|
127 |
+
jQuery('.wprm-button-action').show();
|
128 |
+
} else {
|
129 |
+
jQuery('.wprm-button-action').hide();
|
130 |
+
}
|
131 |
+
|
132 |
// Show correct tab
|
133 |
jQuery('.wprm-frame-content').find('.wprm-frame-content-tab').removeClass('active');
|
134 |
jQuery('.wprm-frame-content').find('#wprm-tab-' + tab_target).addClass('active');
|
135 |
});
|
136 |
+
|
137 |
+
// Insert or Update Button
|
138 |
+
jQuery('.wprm-button-action').on('click', function() {
|
139 |
+
var active_tab = jQuery('.wprm-router.active').find('.wprm-menu-item.active'),
|
140 |
+
callback = active_tab.data('callback');
|
141 |
+
|
142 |
+
if (typeof wprm_admin[callback] == 'function') {
|
143 |
+
wprm_admin[callback](jQuery(this));
|
144 |
+
}
|
145 |
+
});
|
146 |
});
|
assets/js/admin/recipe-form.js
CHANGED
@@ -4,15 +4,18 @@ 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(
|
|
|
|
|
8 |
wprm_admin.editing_recipe = recipe_id;
|
9 |
wprm_admin.clear_recipe_fields();
|
10 |
|
11 |
if (recipe_id !== 0) {
|
12 |
-
jQuery('.wprm-button-
|
13 |
-
|
|
|
|
|
14 |
|
15 |
-
var button = jQuery('.wprm-button-update');
|
16 |
var data = {
|
17 |
action: 'wprm_get_recipe',
|
18 |
security: wprm_modal.nonce,
|
@@ -91,27 +94,29 @@ wprm_admin.set_recipe_fields = function(recipe) {
|
|
91 |
jQuery(this).click();
|
92 |
});
|
93 |
|
94 |
-
|
95 |
-
|
|
|
|
|
96 |
|
97 |
if (i > 0 || group.name !== '') {
|
98 |
wprm_admin.add_ingredient_group(group.name);
|
99 |
}
|
100 |
|
101 |
-
for (
|
102 |
var ingredient = group.ingredients[j];
|
103 |
wprm_admin.add_ingredient(ingredient.amount, ingredient.unit, ingredient.name, ingredient.notes);
|
104 |
}
|
105 |
}
|
106 |
|
107 |
-
for (
|
108 |
-
|
109 |
|
110 |
if (i > 0 || group.name !== '') {
|
111 |
wprm_admin.add_instruction_group(group.name);
|
112 |
}
|
113 |
|
114 |
-
for (
|
115 |
var instruction = group.instructions[j];
|
116 |
wprm_admin.add_instruction(instruction.text, instruction.image);
|
117 |
}
|
@@ -135,7 +140,7 @@ wprm_admin.set_recipe_tags = function(recipe, tag) {
|
|
135 |
term_ids.push(term.term_id);
|
136 |
|
137 |
// Add term to options if not in there
|
138 |
-
if (select.find('option[value=' + term.term_id + ']').length
|
139 |
select.append('<option value="' + term.term_id + '">' + term.name + '</option>');
|
140 |
}
|
141 |
}
|
@@ -275,6 +280,125 @@ wprm_admin.add_instruction_group = function(name) {
|
|
275 |
clone.find('input:first').val(name).focus();
|
276 |
};
|
277 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
278 |
jQuery(document).ready(function($) {
|
279 |
// Recipe and Instruction Image handler
|
280 |
jQuery('.wprm-recipe-details-form, .wprm-recipe-instructions-form').on('click', '.wprm-recipe-image-add', function(e) {
|
@@ -335,7 +459,7 @@ jQuery(document).ready(function($) {
|
|
335 |
e.preventDefault();
|
336 |
wprm_admin.add_ingredient();
|
337 |
}
|
338 |
-
})
|
339 |
jQuery('.wprm-recipe-instructions').on('keydown', '.wprm-recipe-instruction-text, .wprm-recipe-instruction-group-name', function(e) {
|
340 |
var keyCode = e.keyCode || e.which,
|
341 |
input = jQuery(this);
|
@@ -344,7 +468,7 @@ jQuery(document).ready(function($) {
|
|
344 |
e.preventDefault();
|
345 |
wprm_admin.add_instruction();
|
346 |
}
|
347 |
-
})
|
348 |
|
349 |
// Remove Recipe Ingredients and Instructions
|
350 |
jQuery('.wprm-recipe-ingredients-instructions-form').on('click', '.wprm-recipe-ingredients-instructions-delete', function() {
|
@@ -358,126 +482,4 @@ jQuery(document).ready(function($) {
|
|
358 |
cursor: 'move',
|
359 |
handle: '.wprm-recipe-ingredients-instructions-sort',
|
360 |
});
|
361 |
-
|
362 |
-
// Handle recipe insert/update
|
363 |
-
jQuery('.wprm-button-insert, .wprm-button-update').on('click', function() {
|
364 |
-
var button = jQuery(this);
|
365 |
-
|
366 |
-
// Recipe Details
|
367 |
-
var recipe = {
|
368 |
-
image_id: jQuery('#wprm-recipe-image-id').val(),
|
369 |
-
name: jQuery('#wprm-recipe-name').val(),
|
370 |
-
summary: jQuery('#wprm-recipe-summary').val(),
|
371 |
-
servings: jQuery('#wprm-recipe-servings').val(),
|
372 |
-
servings_unit: jQuery('#wprm-recipe-servings-unit').val(),
|
373 |
-
prep_time: jQuery('#wprm-recipe-prep-time').val(),
|
374 |
-
cook_time: jQuery('#wprm-recipe-cook-time').val(),
|
375 |
-
total_time: jQuery('#wprm-recipe-total-time').val(),
|
376 |
-
nutrition: {
|
377 |
-
calories: jQuery('#wprm-recipe-calories').val()
|
378 |
-
},
|
379 |
-
tags: {
|
380 |
-
course: jQuery('#wprm-recipe-tag-course').val(),
|
381 |
-
cuisine: jQuery('#wprm-recipe-tag-cuisine').val()
|
382 |
-
}
|
383 |
-
};
|
384 |
-
|
385 |
-
// Recipe Ingredients
|
386 |
-
var ingredients = [];
|
387 |
-
var ingredient_group = {
|
388 |
-
name: '',
|
389 |
-
ingredients: []
|
390 |
-
};
|
391 |
-
jQuery('.wprm-recipe-ingredients').find('tr').each(function() {
|
392 |
-
var row = jQuery(this);
|
393 |
-
if (row.hasClass('wprm-recipe-ingredient-group')) {
|
394 |
-
// Add current ingredient group to ingredients
|
395 |
-
if (ingredient_group.ingredients.length > 0) {
|
396 |
-
ingredients.push(ingredient_group);
|
397 |
-
}
|
398 |
-
|
399 |
-
ingredient_group = {
|
400 |
-
name: row.find('.wprm-recipe-ingredient-group-name').val(),
|
401 |
-
ingredients: []
|
402 |
-
};
|
403 |
-
} else {
|
404 |
-
ingredient_group.ingredients.push({
|
405 |
-
amount: row.find('.wprm-recipe-ingredient-amount').val(),
|
406 |
-
unit: row.find('.wprm-recipe-ingredient-unit').val(),
|
407 |
-
name: row.find('.wprm-recipe-ingredient-name').val(),
|
408 |
-
notes: row.find('.wprm-recipe-ingredient-notes').val()
|
409 |
-
});
|
410 |
-
}
|
411 |
-
});
|
412 |
-
// Add remaining ingredient group
|
413 |
-
if (ingredient_group.ingredients.length > 0) {
|
414 |
-
ingredients.push(ingredient_group);
|
415 |
-
}
|
416 |
-
recipe.ingredients = ingredients;
|
417 |
-
|
418 |
-
// Recipe Instructions
|
419 |
-
var instructions = [];
|
420 |
-
var instruction_group = {
|
421 |
-
name: '',
|
422 |
-
instructions: []
|
423 |
-
};
|
424 |
-
jQuery('.wprm-recipe-instructions').find('tr').each(function() {
|
425 |
-
var row = jQuery(this);
|
426 |
-
if (row.hasClass('wprm-recipe-instruction-group')) {
|
427 |
-
// Add current instruction group to instructions
|
428 |
-
if (instruction_group.instructions.length > 0) {
|
429 |
-
instructions.push(instruction_group);
|
430 |
-
}
|
431 |
-
|
432 |
-
instruction_group = {
|
433 |
-
name: row.find('.wprm-recipe-instruction-group-name').val(),
|
434 |
-
instructions: []
|
435 |
-
};
|
436 |
-
} else {
|
437 |
-
instruction_group.instructions.push({
|
438 |
-
text: row.find('textarea.wprm-recipe-instruction-text').val(),
|
439 |
-
image: row.find('.wprm-recipe-instruction-image').val()
|
440 |
-
});
|
441 |
-
}
|
442 |
-
});
|
443 |
-
// Add remaining ingredient group
|
444 |
-
if (instruction_group.instructions.length > 0) {
|
445 |
-
instructions.push(instruction_group);
|
446 |
-
}
|
447 |
-
recipe.instructions = instructions;
|
448 |
-
|
449 |
-
// Recipe Notes
|
450 |
-
if (jQuery('#wp-wprm_recipe_notes-wrap').hasClass('tmce-active')) {
|
451 |
-
recipe.notes = tinyMCE.activeEditor.getContent();
|
452 |
-
} else {
|
453 |
-
recipe.notes = jQuery('#wprm_recipe_notes').val();
|
454 |
-
}
|
455 |
-
|
456 |
-
// Ajax call to recipe saver
|
457 |
-
var data = {
|
458 |
-
action: 'wprm_save_recipe',
|
459 |
-
security: wprm_modal.nonce,
|
460 |
-
recipe_id: wprm_admin.editing_recipe,
|
461 |
-
recipe: recipe
|
462 |
-
};
|
463 |
-
|
464 |
-
wprm_admin.start_loader(button);
|
465 |
-
|
466 |
-
jQuery.post(wprm_modal.ajax_url, data, function(out) {
|
467 |
-
wprm_admin.stop_loader(button);
|
468 |
-
|
469 |
-
if (out.success) {
|
470 |
-
if (wprm_admin.editing_recipe == 0) {
|
471 |
-
wprm_admin.add_shortcode_to_editor(out.data.id);
|
472 |
-
} else {
|
473 |
-
// Refresh content in editor to reload recipe preview
|
474 |
-
if (typeof tinyMCE !== 'undefined' && tinyMCE.get(wprm_admin.active_editor_id) && !tinyMCE.get(wprm_admin.active_editor_id).isHidden()) {
|
475 |
-
tinyMCE.get(wprm_admin.active_editor_id).focus(true);
|
476 |
-
tinyMCE.activeEditor.setContent(tinyMCE.activeEditor.getContent());
|
477 |
-
}
|
478 |
-
}
|
479 |
-
wprm_admin.close_modal();
|
480 |
-
}
|
481 |
-
}, 'json');
|
482 |
-
});
|
483 |
});
|
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 |
|
13 |
if (recipe_id !== 0) {
|
14 |
+
var button = jQuery('.wprm-button-action');
|
15 |
+
|
16 |
+
button.text(wprm_modal.text.action_button_update);
|
17 |
+
wprm_admin.disable_menu();
|
18 |
|
|
|
19 |
var data = {
|
20 |
action: 'wprm_get_recipe',
|
21 |
security: wprm_modal.nonce,
|
94 |
jQuery(this).click();
|
95 |
});
|
96 |
|
97 |
+
var i, l, group, j, m;
|
98 |
+
|
99 |
+
for (i = 0, l = recipe.ingredients.length; i < l; i++) {
|
100 |
+
group = recipe.ingredients[i];
|
101 |
|
102 |
if (i > 0 || group.name !== '') {
|
103 |
wprm_admin.add_ingredient_group(group.name);
|
104 |
}
|
105 |
|
106 |
+
for (j = 0, m = group.ingredients.length; j < m; j++) {
|
107 |
var ingredient = group.ingredients[j];
|
108 |
wprm_admin.add_ingredient(ingredient.amount, ingredient.unit, ingredient.name, ingredient.notes);
|
109 |
}
|
110 |
}
|
111 |
|
112 |
+
for (i = 0, l = recipe.instructions.length; i < l; i++) {
|
113 |
+
group = recipe.instructions[i];
|
114 |
|
115 |
if (i > 0 || group.name !== '') {
|
116 |
wprm_admin.add_instruction_group(group.name);
|
117 |
}
|
118 |
|
119 |
+
for (j = 0, m = group.instructions.length; j < m; j++) {
|
120 |
var instruction = group.instructions[j];
|
121 |
wprm_admin.add_instruction(instruction.text, instruction.image);
|
122 |
}
|
140 |
term_ids.push(term.term_id);
|
141 |
|
142 |
// Add term to options if not in there
|
143 |
+
if (select.find('option[value=' + term.term_id + ']').length === 0) {
|
144 |
select.append('<option value="' + term.term_id + '">' + term.name + '</option>');
|
145 |
}
|
146 |
}
|
280 |
clone.find('input:first').val(name).focus();
|
281 |
};
|
282 |
|
283 |
+
wprm_admin.insert_update_recipe = function(button) {
|
284 |
+
// Recipe Details
|
285 |
+
var recipe = {
|
286 |
+
image_id: jQuery('#wprm-recipe-image-id').val(),
|
287 |
+
name: jQuery('#wprm-recipe-name').val(),
|
288 |
+
summary: jQuery('#wprm-recipe-summary').val(),
|
289 |
+
servings: jQuery('#wprm-recipe-servings').val(),
|
290 |
+
servings_unit: jQuery('#wprm-recipe-servings-unit').val(),
|
291 |
+
prep_time: jQuery('#wprm-recipe-prep-time').val(),
|
292 |
+
cook_time: jQuery('#wprm-recipe-cook-time').val(),
|
293 |
+
total_time: jQuery('#wprm-recipe-total-time').val(),
|
294 |
+
nutrition: {
|
295 |
+
calories: jQuery('#wprm-recipe-calories').val()
|
296 |
+
},
|
297 |
+
tags: {
|
298 |
+
course: jQuery('#wprm-recipe-tag-course').val(),
|
299 |
+
cuisine: jQuery('#wprm-recipe-tag-cuisine').val()
|
300 |
+
}
|
301 |
+
};
|
302 |
+
|
303 |
+
// Recipe Ingredients
|
304 |
+
var ingredients = [];
|
305 |
+
var ingredient_group = {
|
306 |
+
name: '',
|
307 |
+
ingredients: []
|
308 |
+
};
|
309 |
+
jQuery('.wprm-recipe-ingredients').find('tr').each(function() {
|
310 |
+
var row = jQuery(this);
|
311 |
+
if (row.hasClass('wprm-recipe-ingredient-group')) {
|
312 |
+
// Add current ingredient group to ingredients
|
313 |
+
if (ingredient_group.ingredients.length > 0) {
|
314 |
+
ingredients.push(ingredient_group);
|
315 |
+
}
|
316 |
+
|
317 |
+
ingredient_group = {
|
318 |
+
name: row.find('.wprm-recipe-ingredient-group-name').val(),
|
319 |
+
ingredients: []
|
320 |
+
};
|
321 |
+
} else {
|
322 |
+
ingredient_group.ingredients.push({
|
323 |
+
amount: row.find('.wprm-recipe-ingredient-amount').val(),
|
324 |
+
unit: row.find('.wprm-recipe-ingredient-unit').val(),
|
325 |
+
name: row.find('.wprm-recipe-ingredient-name').val(),
|
326 |
+
notes: row.find('.wprm-recipe-ingredient-notes').val()
|
327 |
+
});
|
328 |
+
}
|
329 |
+
});
|
330 |
+
// Add remaining ingredient group
|
331 |
+
if (ingredient_group.ingredients.length > 0) {
|
332 |
+
ingredients.push(ingredient_group);
|
333 |
+
}
|
334 |
+
recipe.ingredients = ingredients;
|
335 |
+
|
336 |
+
// Recipe Instructions
|
337 |
+
var instructions = [];
|
338 |
+
var instruction_group = {
|
339 |
+
name: '',
|
340 |
+
instructions: []
|
341 |
+
};
|
342 |
+
jQuery('.wprm-recipe-instructions').find('tr').each(function() {
|
343 |
+
var row = jQuery(this);
|
344 |
+
if (row.hasClass('wprm-recipe-instruction-group')) {
|
345 |
+
// Add current instruction group to instructions
|
346 |
+
if (instruction_group.instructions.length > 0) {
|
347 |
+
instructions.push(instruction_group);
|
348 |
+
}
|
349 |
+
|
350 |
+
instruction_group = {
|
351 |
+
name: row.find('.wprm-recipe-instruction-group-name').val(),
|
352 |
+
instructions: []
|
353 |
+
};
|
354 |
+
} else {
|
355 |
+
instruction_group.instructions.push({
|
356 |
+
text: row.find('textarea.wprm-recipe-instruction-text').val(),
|
357 |
+
image: row.find('.wprm-recipe-instruction-image').val()
|
358 |
+
});
|
359 |
+
}
|
360 |
+
});
|
361 |
+
// Add remaining ingredient group
|
362 |
+
if (instruction_group.instructions.length > 0) {
|
363 |
+
instructions.push(instruction_group);
|
364 |
+
}
|
365 |
+
recipe.instructions = instructions;
|
366 |
+
|
367 |
+
// Recipe Notes
|
368 |
+
if (jQuery('#wp-wprm_recipe_notes-wrap').hasClass('tmce-active')) {
|
369 |
+
recipe.notes = tinyMCE.activeEditor.getContent();
|
370 |
+
} else {
|
371 |
+
recipe.notes = jQuery('#wprm_recipe_notes').val();
|
372 |
+
}
|
373 |
+
|
374 |
+
// Ajax call to recipe saver
|
375 |
+
var data = {
|
376 |
+
action: 'wprm_save_recipe',
|
377 |
+
security: wprm_modal.nonce,
|
378 |
+
recipe_id: wprm_admin.editing_recipe,
|
379 |
+
recipe: recipe
|
380 |
+
};
|
381 |
+
|
382 |
+
wprm_admin.start_loader(button);
|
383 |
+
|
384 |
+
jQuery.post(wprm_modal.ajax_url, data, function(out) {
|
385 |
+
wprm_admin.stop_loader(button);
|
386 |
+
|
387 |
+
if (out.success) {
|
388 |
+
if (wprm_admin.editing_recipe === 0) {
|
389 |
+
wprm_admin.add_text_to_editor('[wprm-recipe id="' + out.data.id + '"]');
|
390 |
+
} else {
|
391 |
+
// Refresh content in editor to reload recipe preview
|
392 |
+
if (typeof tinyMCE !== 'undefined' && tinyMCE.get(wprm_admin.active_editor_id) && !tinyMCE.get(wprm_admin.active_editor_id).isHidden()) {
|
393 |
+
tinyMCE.get(wprm_admin.active_editor_id).focus(true);
|
394 |
+
tinyMCE.activeEditor.setContent(tinyMCE.activeEditor.getContent());
|
395 |
+
}
|
396 |
+
}
|
397 |
+
wprm_admin.close_modal();
|
398 |
+
}
|
399 |
+
}, 'json');
|
400 |
+
};
|
401 |
+
|
402 |
jQuery(document).ready(function($) {
|
403 |
// Recipe and Instruction Image handler
|
404 |
jQuery('.wprm-recipe-details-form, .wprm-recipe-instructions-form').on('click', '.wprm-recipe-image-add', function(e) {
|
459 |
e.preventDefault();
|
460 |
wprm_admin.add_ingredient();
|
461 |
}
|
462 |
+
});
|
463 |
jQuery('.wprm-recipe-instructions').on('keydown', '.wprm-recipe-instruction-text, .wprm-recipe-instruction-group-name', function(e) {
|
464 |
var keyCode = e.keyCode || e.which,
|
465 |
input = jQuery(this);
|
468 |
e.preventDefault();
|
469 |
wprm_admin.add_instruction();
|
470 |
}
|
471 |
+
});
|
472 |
|
473 |
// Remove Recipe Ingredients and Instructions
|
474 |
jQuery('.wprm-recipe-ingredients-instructions-form').on('click', '.wprm-recipe-ingredients-instructions-delete', function() {
|
482 |
cursor: 'move',
|
483 |
handle: '.wprm-recipe-ingredients-instructions-sort',
|
484 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
485 |
});
|
assets/js/admin/recipe-snippets.js
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var wprm_admin = wprm_admin || {};
|
2 |
+
|
3 |
+
wprm_admin.insert_jump_to_recipe = function(button) {
|
4 |
+
var id = parseInt(jQuery('#wprm-recipe-jump-id').val()),
|
5 |
+
text = wprm_admin.shortcode_escape(jQuery('#wprm-recipe-jump-text').val()),
|
6 |
+
shortcode = '[wprm-recipe-jump';
|
7 |
+
|
8 |
+
if (id > 0) {
|
9 |
+
shortcode += ' id="' + id + '"';
|
10 |
+
}
|
11 |
+
|
12 |
+
if (text) {
|
13 |
+
shortcode += ' text="' + text + '"';
|
14 |
+
}
|
15 |
+
|
16 |
+
shortcode += ']';
|
17 |
+
|
18 |
+
wprm_admin.add_text_to_editor(shortcode);
|
19 |
+
wprm_admin.close_modal();
|
20 |
+
};
|
21 |
+
|
22 |
+
wprm_admin.insert_print_recipe = function(button) {
|
23 |
+
var id = parseInt(jQuery('#wprm-recipe-print-id').val()),
|
24 |
+
text = wprm_admin.shortcode_escape(jQuery('#wprm-recipe-print-text').val()),
|
25 |
+
shortcode = '[wprm-recipe-print';
|
26 |
+
|
27 |
+
if (id > 0) {
|
28 |
+
shortcode += ' id="' + id + '"';
|
29 |
+
}
|
30 |
+
|
31 |
+
console.log(text);
|
32 |
+
|
33 |
+
if (text) {
|
34 |
+
shortcode += ' text="' + text + '"';
|
35 |
+
}
|
36 |
+
|
37 |
+
shortcode += ']';
|
38 |
+
|
39 |
+
wprm_admin.add_text_to_editor(shortcode);
|
40 |
+
wprm_admin.close_modal();
|
41 |
+
};
|
42 |
+
|
43 |
+
wprm_admin.reset_snippets = function(args) {
|
44 |
+
jQuery('#wprm-recipe-jump-id').val('0').trigger('change');
|
45 |
+
jQuery('#wprm-recipe-jump-text').val('');
|
46 |
+
|
47 |
+
jQuery('#wprm-recipe-print-id').val('0').trigger('change');
|
48 |
+
jQuery('#wprm-recipe-print-text').val('');
|
49 |
+
};
|
50 |
+
|
51 |
+
jQuery(document).ready(function($) {
|
52 |
+
jQuery('#wprm-recipe-jump-id, #wprm-recipe-print-id').select2_wprm({
|
53 |
+
width: '250px'
|
54 |
+
});
|
55 |
+
});
|
assets/js/admin/settings.js
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var wprm_admin = wprm_admin || {};
|
2 |
+
|
3 |
+
jQuery(document).ready(function($) {
|
4 |
+
jQuery('.wprm-settings').find('select').select2_wprm();
|
5 |
+
});
|
assets/js/admin/shortcode-tinymce.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
(function() {
|
2 |
tinymce.PluginManager.add('wprecipemaker', function(editor, url) {
|
3 |
function replaceShortcodes(content) {
|
4 |
-
return content.replace(/\[wprm-recipe([^\]]*)\]/g, function(match) {
|
5 |
return html(match);
|
6 |
});
|
7 |
}
|
@@ -48,16 +48,19 @@
|
|
48 |
|
49 |
editor.on('mouseup', function(event) {
|
50 |
var dom = editor.dom,
|
51 |
-
node = event.target
|
|
|
52 |
|
53 |
-
if (event.button !== 2) {
|
54 |
-
if (dom.getAttrib(node, 'data-wprm-recipe')) {
|
55 |
-
var id = dom.getAttrib(node, 'data-wprm-recipe');
|
56 |
-
wprm_admin.open_modal(editor.id, id);
|
57 |
-
} else if (dom.getAttrib(node, 'data-wprm-recipe-remove')) {
|
58 |
if (confirm(wprm_modal.text.shortcode_remove)) {
|
59 |
editor.dom.remove(node.parentNode);
|
60 |
}
|
|
|
|
|
|
|
|
|
|
|
61 |
}
|
62 |
}
|
63 |
});
|
1 |
(function() {
|
2 |
tinymce.PluginManager.add('wprecipemaker', function(editor, url) {
|
3 |
function replaceShortcodes(content) {
|
4 |
+
return content.replace(/\[wprm-recipe ([^\]]*)\]/g, function(match) {
|
5 |
return html(match);
|
6 |
});
|
7 |
}
|
48 |
|
49 |
editor.on('mouseup', function(event) {
|
50 |
var dom = editor.dom,
|
51 |
+
node = event.target,
|
52 |
+
shortcode = jQuery(node).hasClass('wprm-shortcode') ? jQuery(node) : jQuery(node).parents('.wprm-shortcode');
|
53 |
|
54 |
+
if (event.button !== 2 && shortcode.length > 0) {
|
55 |
+
if (dom.getAttrib(node, 'data-wprm-recipe-remove')) {
|
|
|
|
|
|
|
56 |
if (confirm(wprm_modal.text.shortcode_remove)) {
|
57 |
editor.dom.remove(node.parentNode);
|
58 |
}
|
59 |
+
} else {
|
60 |
+
var id = jQuery(shortcode).data('wprm-recipe');
|
61 |
+
wprm_admin.open_modal(editor.id, {
|
62 |
+
recipe_id: id
|
63 |
+
});
|
64 |
}
|
65 |
}
|
66 |
});
|
assets/js/admin/shortcode.js
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
var wprm_admin = wprm_admin || {};
|
2 |
-
|
3 |
-
wprm_admin.add_shortcode_to_editor = function(recipe_id) {
|
4 |
-
if (wprm_admin.active_editor_id) {
|
5 |
-
var text = ' [wprm-recipe id="' + recipe_id + '"] ';
|
6 |
-
|
7 |
-
if (typeof tinyMCE == 'undefined' || !tinyMCE.get(wprm_admin.active_editor_id) || tinyMCE.get(wprm_admin.active_editor_id).isHidden()) {
|
8 |
-
var current = jQuery('textarea#' + wprm_admin.active_editor_id).val();
|
9 |
-
jQuery('textarea#' + wprm_admin.active_editor_id).val(current + text);
|
10 |
-
} else {
|
11 |
-
tinyMCE.get(wprm_admin.active_editor_id).focus(true);
|
12 |
-
tinyMCE.activeEditor.execCommand('mceInsertContent', false, text);
|
13 |
-
}
|
14 |
-
}
|
15 |
-
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/public/print.js
CHANGED
@@ -21,22 +21,31 @@ wprm.print_html = function(html) {
|
|
21 |
}, 500);
|
22 |
};
|
23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
jQuery(document).ready(function($) {
|
25 |
jQuery('.wprm-recipe-print').on('click', function(e) {
|
26 |
e.preventDefault();
|
27 |
|
28 |
var recipe_id = jQuery(this).parents('.wprm-recipe-container').data('recipe-id');
|
|
|
|
|
|
|
|
|
29 |
|
30 |
-
var
|
31 |
-
|
32 |
-
security: wprm_public.nonce,
|
33 |
-
recipe_id: recipe_id
|
34 |
-
};
|
35 |
-
|
36 |
-
jQuery.post(wprm_public.ajax_url, data, function(out) {
|
37 |
-
if (out.success) {
|
38 |
-
wprm.print_html(out.data.html);
|
39 |
-
}
|
40 |
-
}, 'json');
|
41 |
});
|
42 |
});
|
21 |
}, 500);
|
22 |
};
|
23 |
|
24 |
+
wprm.print_recipe = function(recipe_id) {
|
25 |
+
var data = {
|
26 |
+
action: 'wprm_print_recipe',
|
27 |
+
security: wprm_public.nonce,
|
28 |
+
recipe_id: recipe_id
|
29 |
+
};
|
30 |
+
|
31 |
+
jQuery.post(wprm_public.ajax_url, data, function(out) {
|
32 |
+
if (out.success) {
|
33 |
+
wprm.print_html(out.data.html);
|
34 |
+
}
|
35 |
+
}, 'json');
|
36 |
+
};
|
37 |
+
|
38 |
jQuery(document).ready(function($) {
|
39 |
jQuery('.wprm-recipe-print').on('click', function(e) {
|
40 |
e.preventDefault();
|
41 |
|
42 |
var recipe_id = jQuery(this).parents('.wprm-recipe-container').data('recipe-id');
|
43 |
+
wprm.print_recipe(recipe_id);
|
44 |
+
});
|
45 |
+
jQuery('.wprm-print-recipe-shortcode').on('click', function(e) {
|
46 |
+
e.preventDefault();
|
47 |
|
48 |
+
var recipe_id = jQuery(this).data('recipe-id');
|
49 |
+
wprm.print_recipe(recipe_id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
});
|
51 |
});
|
includes/admin/class-wprm-import-manager.php
CHANGED
@@ -47,8 +47,8 @@ class WPRM_Import_Manager {
|
|
47 |
* @since 1.0.0
|
48 |
*/
|
49 |
public static function add_submenu_page() {
|
50 |
-
add_submenu_page( 'wprecipemaker', 'Import Recipes', 'Import Recipes', 'manage_options', 'wprm_import_overview', array( __CLASS__, 'overview_page_template' ) );
|
51 |
-
add_submenu_page( null, 'Import Recipes', 'Import Recipes', 'manage_options', 'wprm_import', array( __CLASS__, 'import_page_template' ) );
|
52 |
}
|
53 |
|
54 |
/**
|
@@ -57,9 +57,9 @@ class WPRM_Import_Manager {
|
|
57 |
* @since 1.0.0
|
58 |
*/
|
59 |
public static function enqueue() {
|
60 |
-
wp_enqueue_style( 'wprm-import', WPRM_URL . '
|
61 |
|
62 |
-
wp_enqueue_script( 'wprm-import', WPRM_URL . '
|
63 |
}
|
64 |
|
65 |
/**
|
47 |
* @since 1.0.0
|
48 |
*/
|
49 |
public static function add_submenu_page() {
|
50 |
+
add_submenu_page( 'wprecipemaker', __( 'Import Recipes', 'wp-recipe-maker' ), __( 'Import Recipes', 'wp-recipe-maker' ), 'manage_options', 'wprm_import_overview', array( __CLASS__, 'overview_page_template' ) );
|
51 |
+
add_submenu_page( null, __( 'Import Recipes', 'wp-recipe-maker' ), __( 'Import Recipes', 'wp-recipe-maker' ), 'manage_options', 'wprm_import', array( __CLASS__, 'import_page_template' ) );
|
52 |
}
|
53 |
|
54 |
/**
|
57 |
* @since 1.0.0
|
58 |
*/
|
59 |
public static function enqueue() {
|
60 |
+
wp_enqueue_style( 'wprm-import', WPRM_URL . 'assets/css/admin/import.min.css', array(), WPRM_VERSION, 'all' );
|
61 |
|
62 |
+
wp_enqueue_script( 'wprm-import', WPRM_URL . 'assets/js/admin/import.js', array( 'jquery' ), WPRM_VERSION, true );
|
63 |
}
|
64 |
|
65 |
/**
|
includes/admin/import/class-wprm-import-easyrecipe.php
CHANGED
@@ -43,7 +43,7 @@ class WPRM_Import_Easyrecipe extends WPRM_Import {
|
|
43 |
*/
|
44 |
public function get_recipes() {
|
45 |
if ( ! class_exists( 'simple_html_dom' ) && ! class_exists( 'simple_html_dom_node' ) ) {
|
46 |
-
require_once( WPRM_DIR . '
|
47 |
libxml_use_internal_errors( true );
|
48 |
}
|
49 |
|
@@ -106,7 +106,7 @@ class WPRM_Import_Easyrecipe extends WPRM_Import {
|
|
106 |
*/
|
107 |
public function get_recipe( $id ) {
|
108 |
if ( ! class_exists( 'simple_html_dom' ) && ! class_exists( 'simple_html_dom_node' ) ) {
|
109 |
-
require_once( WPRM_DIR . '
|
110 |
libxml_use_internal_errors( true );
|
111 |
}
|
112 |
|
@@ -293,7 +293,7 @@ class WPRM_Import_Easyrecipe extends WPRM_Import {
|
|
293 |
*/
|
294 |
public function replace_recipe( $id, $wprm_id ) {
|
295 |
if ( ! class_exists( 'simple_html_dom' ) && ! class_exists( 'simple_html_dom_node' ) ) {
|
296 |
-
require_once( WPRM_DIR . '
|
297 |
libxml_use_internal_errors( true );
|
298 |
}
|
299 |
|
43 |
*/
|
44 |
public function get_recipes() {
|
45 |
if ( ! class_exists( 'simple_html_dom' ) && ! class_exists( 'simple_html_dom_node' ) ) {
|
46 |
+
require_once( WPRM_DIR . 'vendor/simple_html_dom/simple_html_dom.php' );
|
47 |
libxml_use_internal_errors( true );
|
48 |
}
|
49 |
|
106 |
*/
|
107 |
public function get_recipe( $id ) {
|
108 |
if ( ! class_exists( 'simple_html_dom' ) && ! class_exists( 'simple_html_dom_node' ) ) {
|
109 |
+
require_once( WPRM_DIR . 'vendor/simple_html_dom/simple_html_dom.php' );
|
110 |
libxml_use_internal_errors( true );
|
111 |
}
|
112 |
|
293 |
*/
|
294 |
public function replace_recipe( $id, $wprm_id ) {
|
295 |
if ( ! class_exists( 'simple_html_dom' ) && ! class_exists( 'simple_html_dom_node' ) ) {
|
296 |
+
require_once( WPRM_DIR . 'vendor/simple_html_dom/simple_html_dom.php' );
|
297 |
libxml_use_internal_errors( true );
|
298 |
}
|
299 |
|
includes/admin/menu/class-wprm-admin-menu-faq.php
CHANGED
@@ -25,6 +25,7 @@ class WPRM_Admin_Menu_Faq {
|
|
25 |
* @since 1.0.0
|
26 |
*/
|
27 |
public static function init() {
|
|
|
28 |
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue' ) );
|
29 |
add_action( 'admin_head-toplevel_page_wprecipemaker', array( __CLASS__, 'add_support_widget' ) );
|
30 |
add_action( 'admin_menu', array( __CLASS__, 'add_submenu_page' ) );
|
@@ -36,7 +37,25 @@ class WPRM_Admin_Menu_Faq {
|
|
36 |
* @since 1.0.0
|
37 |
*/
|
38 |
public static function enqueue() {
|
39 |
-
wp_enqueue_style( 'wprm-import', WPRM_URL . '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
}
|
41 |
|
42 |
/**
|
25 |
* @since 1.0.0
|
26 |
*/
|
27 |
public static function init() {
|
28 |
+
add_action( 'admin_init', array( __CLASS__, 'redirect' ) );
|
29 |
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue' ) );
|
30 |
add_action( 'admin_head-toplevel_page_wprecipemaker', array( __CLASS__, 'add_support_widget' ) );
|
31 |
add_action( 'admin_menu', array( __CLASS__, 'add_submenu_page' ) );
|
37 |
* @since 1.0.0
|
38 |
*/
|
39 |
public static function enqueue() {
|
40 |
+
wp_enqueue_style( 'wprm-import', WPRM_URL . 'assets/css/admin/faq.min.css', array(), WPRM_VERSION, 'all' );
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Redirect to FAQ page if this plugin was activated by itself.
|
45 |
+
*
|
46 |
+
* @since 1.2.0
|
47 |
+
*/
|
48 |
+
public static function redirect() {
|
49 |
+
// Check if a single plugin was just activated.
|
50 |
+
if ( isset( $_GET['activate'] ) ) { // Input var okay.
|
51 |
+
// Make sure it was our plugin that was just activated.
|
52 |
+
if ( get_option( 'wprm_activated', false ) ) {
|
53 |
+
delete_option( 'wprm_activated' );
|
54 |
+
|
55 |
+
wp_safe_redirect( admin_url( 'admin.php?page=wprecipemaker' ) );
|
56 |
+
exit();
|
57 |
+
}
|
58 |
+
}
|
59 |
}
|
60 |
|
61 |
/**
|
includes/admin/menu/class-wprm-admin-menu.php
CHANGED
@@ -35,7 +35,7 @@ class WPRM_Admin_Menu {
|
|
35 |
*/
|
36 |
public static function add_menu_page() {
|
37 |
// Base64 encoded svg icon.
|
38 |
-
$icon = 'PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjI0cHgiIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0Ij48ZyA+
|
39 |
add_menu_page( 'WP Recipe Maker', 'WP Recipe Maker', 'manage_options', 'wprecipemaker', array( 'WPRM_Admin_Menu_Faq', 'page_template' ), 'data:image/svg+xml;base64,' . $icon, 58 );
|
40 |
}
|
41 |
}
|
35 |
*/
|
36 |
public static function add_menu_page() {
|
37 |
// Base64 encoded svg icon.
|
38 |
+
$icon = 'PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjI0cHgiIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0Ij48ZyA+DQo8cGF0aCBmaWxsPSIjZmZmZmZmIiBkPSJNMTAsMEM5LjQsMCw5LDAuNCw5LDF2NEg3VjFjMC0wLjYtMC40LTEtMS0xUzUsMC40LDUsMXY0SDNWMWMwLTAuNi0wLjQtMS0xLTFTMSwwLjQsMSwxdjhjMCwxLjcsMS4zLDMsMywzDQp2MTBjMCwxLjEsMC45LDIsMiwyczItMC45LDItMlYxMmMxLjcsMCwzLTEuMywzLTNWMUMxMSwwLjQsMTAuNiwwLDEwLDB6Ii8+DQo8cGF0aCBkYXRhLWNvbG9yPSJjb2xvci0yIiBmaWxsPSIjZmZmZmZmIiBkPSJNMTksMGMtMy4zLDAtNiwyLjctNiw2djljMCwwLjYsMC40LDEsMSwxaDJ2NmMwLDEuMSwwLjksMiwyLDJzMi0wLjksMi0yVjENCkMyMCwwLjQsMTkuNiwwLDE5LDB6Ii8+DQo8L2c+PC9zdmc+';
|
39 |
add_menu_page( 'WP Recipe Maker', 'WP Recipe Maker', 'manage_options', 'wprecipemaker', array( 'WPRM_Admin_Menu_Faq', 'page_template' ), 'data:image/svg+xml;base64,' . $icon, 58 );
|
40 |
}
|
41 |
}
|
includes/admin/modal/class-wprm-modal.php
CHANGED
@@ -37,21 +37,23 @@ class WPRM_Modal {
|
|
37 |
* @since 1.0.0
|
38 |
*/
|
39 |
public static function enqueue() {
|
40 |
-
wp_enqueue_style( 'wprm-medium-editor', WPRM_URL . '
|
41 |
-
wp_enqueue_style( 'wprm-medium-editor-theme', WPRM_URL . '
|
42 |
-
wp_enqueue_style( 'wprm-select2', WPRM_URL . '
|
43 |
-
wp_enqueue_style( 'wprm-modal', WPRM_URL . '
|
44 |
|
45 |
-
wp_enqueue_script( 'wprm-medium-editor', WPRM_URL . '
|
46 |
-
wp_enqueue_script( 'wprm-select2', WPRM_URL . '
|
47 |
-
wp_enqueue_script( 'wprm-modal', WPRM_URL . '
|
48 |
-
wp_enqueue_script( 'wprm-
|
49 |
-
wp_enqueue_script( 'wprm-recipe-
|
50 |
|
51 |
wp_localize_script( 'wprm-modal', 'wprm_modal', array(
|
52 |
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
53 |
'nonce' => wp_create_nonce( 'wprm' ),
|
54 |
'text' => array(
|
|
|
|
|
55 |
'media_title' => __( 'Select or Upload Image', 'wp-recipe-maker' ),
|
56 |
'media_button' => __( 'Use Image', 'wp-recipe-maker' ),
|
57 |
'shortcode_remove' => __( 'Are you sure you want to remove this recipe?', 'wp-recipe-maker' ),
|
@@ -109,20 +111,44 @@ class WPRM_Modal {
|
|
109 |
'order' => 100,
|
110 |
'label' => __( 'Recipe Details', 'wp-recipe-maker' ),
|
111 |
'template' => WPRM_DIR . 'templates/admin/modal/tabs/recipe-details.php',
|
|
|
|
|
112 |
),
|
113 |
'recipe-ingredients-instructions' => array(
|
114 |
'order' => 200,
|
115 |
'label' => __( 'Ingredients & Instructions', 'wp-recipe-maker' ),
|
116 |
'template' => WPRM_DIR . 'templates/admin/modal/tabs/recipe-ingredients-instructions.php',
|
|
|
117 |
),
|
118 |
'recipe-notes' => array(
|
119 |
'order' => 300,
|
120 |
'label' => __( 'Recipe Notes', 'wp-recipe-maker' ),
|
121 |
'template' => WPRM_DIR . 'templates/admin/modal/tabs/recipe-notes.php',
|
|
|
122 |
),
|
123 |
),
|
124 |
'default_tab' => 'recipe-details',
|
125 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
);
|
127 |
|
128 |
// Allow menu to be altered.
|
37 |
* @since 1.0.0
|
38 |
*/
|
39 |
public static function enqueue() {
|
40 |
+
wp_enqueue_style( 'wprm-medium-editor', WPRM_URL . 'vendor/medium-editor/css/medium-editor.min.css', array(), WPRM_VERSION, 'all' );
|
41 |
+
wp_enqueue_style( 'wprm-medium-editor-theme', WPRM_URL . 'vendor/medium-editor/css/themes/beagle.min.css', array(), WPRM_VERSION, 'all' );
|
42 |
+
wp_enqueue_style( 'wprm-select2', WPRM_URL . 'vendor/select2/css/select2.min.css', array(), WPRM_VERSION, 'all' );
|
43 |
+
wp_enqueue_style( 'wprm-modal', WPRM_URL . 'assets/css/admin/modal.min.css', array(), WPRM_VERSION, 'all' );
|
44 |
|
45 |
+
wp_enqueue_script( 'wprm-medium-editor', WPRM_URL . 'vendor/medium-editor/js/medium-editor.min.js', array( 'jquery' ), WPRM_VERSION, true );
|
46 |
+
wp_enqueue_script( 'wprm-select2', WPRM_URL . 'vendor/select2/js/select2.min.js', array( 'jquery' ), WPRM_VERSION, true );
|
47 |
+
wp_enqueue_script( 'wprm-modal', WPRM_URL . 'assets/js/admin/modal.js', array( 'jquery' ), WPRM_VERSION, true );
|
48 |
+
wp_enqueue_script( 'wprm-recipe-form', WPRM_URL . 'assets/js/admin/recipe-form.js', array( 'jquery', 'jquery-ui-sortable', 'wprm-modal', 'wprm-medium-editor', 'wprm-select2' ), WPRM_VERSION, true );
|
49 |
+
wp_enqueue_script( 'wprm-recipe-snippets', WPRM_URL . 'assets/js/admin/recipe-snippets.js', array( 'jquery', 'wprm-modal' ), WPRM_VERSION, true );
|
50 |
|
51 |
wp_localize_script( 'wprm-modal', 'wprm_modal', array(
|
52 |
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
53 |
'nonce' => wp_create_nonce( 'wprm' ),
|
54 |
'text' => array(
|
55 |
+
'action_button_default' => __( 'Insert', 'wp-recipe-maker' ),
|
56 |
+
'action_button_update' => __( 'Update', 'wp-recipe-maker' ),
|
57 |
'media_title' => __( 'Select or Upload Image', 'wp-recipe-maker' ),
|
58 |
'media_button' => __( 'Use Image', 'wp-recipe-maker' ),
|
59 |
'shortcode_remove' => __( 'Are you sure you want to remove this recipe?', 'wp-recipe-maker' ),
|
111 |
'order' => 100,
|
112 |
'label' => __( 'Recipe Details', 'wp-recipe-maker' ),
|
113 |
'template' => WPRM_DIR . 'templates/admin/modal/tabs/recipe-details.php',
|
114 |
+
'callback' => 'insert_update_recipe',
|
115 |
+
'init' => 'set_recipe',
|
116 |
),
|
117 |
'recipe-ingredients-instructions' => array(
|
118 |
'order' => 200,
|
119 |
'label' => __( 'Ingredients & Instructions', 'wp-recipe-maker' ),
|
120 |
'template' => WPRM_DIR . 'templates/admin/modal/tabs/recipe-ingredients-instructions.php',
|
121 |
+
'callback' => 'insert_update_recipe',
|
122 |
),
|
123 |
'recipe-notes' => array(
|
124 |
'order' => 300,
|
125 |
'label' => __( 'Recipe Notes', 'wp-recipe-maker' ),
|
126 |
'template' => WPRM_DIR . 'templates/admin/modal/tabs/recipe-notes.php',
|
127 |
+
'callback' => 'insert_update_recipe',
|
128 |
),
|
129 |
),
|
130 |
'default_tab' => 'recipe-details',
|
131 |
),
|
132 |
+
'recipe-snippets' => array(
|
133 |
+
'order' => 200,
|
134 |
+
'label' => __( 'Recipe Snippets', 'wp-recipe-maker' ),
|
135 |
+
'tabs' => array(
|
136 |
+
'recipe-snippets-jump' => array(
|
137 |
+
'order' => 100,
|
138 |
+
'label' => __( 'Jump to Recipe', 'wp-recipe-maker' ),
|
139 |
+
'template' => WPRM_DIR . 'templates/admin/modal/tabs/recipe-snippets-jump.php',
|
140 |
+
'callback' => 'insert_jump_to_recipe',
|
141 |
+
'init' => 'reset_snippets',
|
142 |
+
),
|
143 |
+
'recipe-snippets-print' => array(
|
144 |
+
'order' => 200,
|
145 |
+
'label' => __( 'Print Recipe', 'wp-recipe-maker' ),
|
146 |
+
'template' => WPRM_DIR . 'templates/admin/modal/tabs/recipe-snippets-print.php',
|
147 |
+
'callback' => 'insert_print_recipe',
|
148 |
+
),
|
149 |
+
),
|
150 |
+
'default_tab' => 'recipe-snippets-jump',
|
151 |
+
),
|
152 |
);
|
153 |
|
154 |
// Allow menu to be altered.
|
includes/admin/modal/class-wprm-shortcode-preview.php
CHANGED
@@ -48,8 +48,10 @@ class WPRM_Shortcode_Preview {
|
|
48 |
|
49 |
if ( ! is_null( $post ) && WPRM_POST_TYPE === $post->post_type ) {
|
50 |
$recipe = WPRM_Recipe_Manager::get_recipe( $recipe_id );
|
51 |
-
|
52 |
-
|
|
|
|
|
53 |
}
|
54 |
}
|
55 |
|
@@ -64,9 +66,9 @@ class WPRM_Shortcode_Preview {
|
|
64 |
* @param array $plugin_array Plugins to be used by TinyMCE.
|
65 |
*/
|
66 |
public static function tinymce_shortcode_plugin( $plugin_array ) {
|
67 |
-
$plugin_array['wprecipemaker'] = WPRM_URL . '
|
68 |
return $plugin_array;
|
69 |
-
|
70 |
}
|
71 |
|
72 |
WPRM_Shortcode_Preview::init();
|
48 |
|
49 |
if ( ! is_null( $post ) && WPRM_POST_TYPE === $post->post_type ) {
|
50 |
$recipe = WPRM_Recipe_Manager::get_recipe( $recipe_id );
|
51 |
+
ob_start();
|
52 |
+
require( WPRM_DIR . 'templates/admin/modal/shortcode-preview.php' );
|
53 |
+
$preview .= ob_get_contents();
|
54 |
+
ob_end_clean();
|
55 |
}
|
56 |
}
|
57 |
|
66 |
* @param array $plugin_array Plugins to be used by TinyMCE.
|
67 |
*/
|
68 |
public static function tinymce_shortcode_plugin( $plugin_array ) {
|
69 |
+
$plugin_array['wprecipemaker'] = WPRM_URL . 'assets/js/admin/shortcode-tinymce.js';
|
70 |
return $plugin_array;
|
71 |
+
}
|
72 |
}
|
73 |
|
74 |
WPRM_Shortcode_Preview::init();
|
includes/class-wp-recipe-maker.php
CHANGED
@@ -41,7 +41,7 @@ class WP_Recipe_Maker {
|
|
41 |
* @since 1.0.0
|
42 |
*/
|
43 |
private function define_constants() {
|
44 |
-
define( 'WPRM_VERSION', '1.
|
45 |
define( 'WPRM_POST_TYPE', 'wprm_recipe' );
|
46 |
define( 'WPRM_DIR', plugin_dir_path( dirname( __FILE__ ) ) );
|
47 |
define( 'WPRM_URL', plugin_dir_url( dirname( __FILE__ ) ) );
|
@@ -64,6 +64,7 @@ class WP_Recipe_Maker {
|
|
64 |
require_once( WPRM_DIR . 'includes/public/class-wprm-print.php' );
|
65 |
require_once( WPRM_DIR . 'includes/public/class-wprm-recipe-manager.php' );
|
66 |
require_once( WPRM_DIR . 'includes/public/class-wprm-recipe.php' );
|
|
|
67 |
require_once( WPRM_DIR . 'includes/public/class-wprm-shortcode.php' );
|
68 |
require_once( WPRM_DIR . 'includes/public/class-wprm-taxonomies.php' );
|
69 |
require_once( WPRM_DIR . 'includes/public/class-wprm-template-manager.php' );
|
41 |
* @since 1.0.0
|
42 |
*/
|
43 |
private function define_constants() {
|
44 |
+
define( 'WPRM_VERSION', '1.2.0' );
|
45 |
define( 'WPRM_POST_TYPE', 'wprm_recipe' );
|
46 |
define( 'WPRM_DIR', plugin_dir_path( dirname( __FILE__ ) ) );
|
47 |
define( 'WPRM_URL', plugin_dir_url( dirname( __FILE__ ) ) );
|
64 |
require_once( WPRM_DIR . 'includes/public/class-wprm-print.php' );
|
65 |
require_once( WPRM_DIR . 'includes/public/class-wprm-recipe-manager.php' );
|
66 |
require_once( WPRM_DIR . 'includes/public/class-wprm-recipe.php' );
|
67 |
+
require_once( WPRM_DIR . 'includes/public/class-wprm-settings.php' );
|
68 |
require_once( WPRM_DIR . 'includes/public/class-wprm-shortcode.php' );
|
69 |
require_once( WPRM_DIR . 'includes/public/class-wprm-taxonomies.php' );
|
70 |
require_once( WPRM_DIR . 'includes/public/class-wprm-template-manager.php' );
|
includes/class-wprm-activator.php
CHANGED
@@ -31,5 +31,7 @@ class WPRM_Activator {
|
|
31 |
WPRM_Post_Type::register_post_type();
|
32 |
WPRM_Taxonomies::register_taxonomies();
|
33 |
WPRM_Taxonomies::insert_default_taxonomy_terms();
|
|
|
|
|
34 |
}
|
35 |
}
|
31 |
WPRM_Post_Type::register_post_type();
|
32 |
WPRM_Taxonomies::register_taxonomies();
|
33 |
WPRM_Taxonomies::insert_default_taxonomy_terms();
|
34 |
+
|
35 |
+
add_option( 'wprm_activated', true );
|
36 |
}
|
37 |
}
|
includes/public/class-wprm-comment-rating.php
CHANGED
@@ -44,7 +44,7 @@ class WPRM_Comment_Rating {
|
|
44 |
* @since 1.1.0
|
45 |
*/
|
46 |
public static function enqueue() {
|
47 |
-
wp_enqueue_script( 'wprm-comment-rating', WPRM_URL . '
|
48 |
}
|
49 |
|
50 |
/**
|
@@ -53,8 +53,8 @@ class WPRM_Comment_Rating {
|
|
53 |
* @since 1.1.0
|
54 |
*/
|
55 |
public static function enqueue_admin() {
|
56 |
-
wp_enqueue_script( 'wprm-comment-rating', WPRM_URL . '
|
57 |
-
wp_enqueue_style( 'wprm-comments', WPRM_URL . '
|
58 |
}
|
59 |
|
60 |
/**
|
44 |
* @since 1.1.0
|
45 |
*/
|
46 |
public static function enqueue() {
|
47 |
+
wp_enqueue_script( 'wprm-comment-rating', WPRM_URL . 'assets/js/public/comment-rating.js', array( 'jquery' ), WPRM_VERSION, true );
|
48 |
}
|
49 |
|
50 |
/**
|
53 |
* @since 1.1.0
|
54 |
*/
|
55 |
public static function enqueue_admin() {
|
56 |
+
wp_enqueue_script( 'wprm-comment-rating', WPRM_URL . 'assets/js/public/comment-rating.js', array( 'jquery' ), WPRM_VERSION, true );
|
57 |
+
wp_enqueue_style( 'wprm-comments', WPRM_URL . 'assets/css/admin/comments.min.css', array(), WPRM_VERSION, 'all' );
|
58 |
}
|
59 |
|
60 |
/**
|
includes/public/class-wprm-fallback-recipe.php
CHANGED
@@ -41,7 +41,7 @@ class WPRM_Fallback_Recipe {
|
|
41 |
$recipe_shortcodes = array();
|
42 |
$pattern = get_shortcode_regex( array( 'wprm-recipe' ) );
|
43 |
|
44 |
-
if ( preg_match_all( '/'. $pattern .'/s', $content, $matches ) && array_key_exists( 2, $matches ) ) {
|
45 |
foreach ( $matches[2] as $key => $value ) {
|
46 |
if ( 'wprm-recipe' === $value ) {
|
47 |
$recipe_shortcodes[ $matches[0][ $key ] ] = shortcode_parse_atts( stripslashes( $matches[3][ $key ] ) );
|
41 |
$recipe_shortcodes = array();
|
42 |
$pattern = get_shortcode_regex( array( 'wprm-recipe' ) );
|
43 |
|
44 |
+
if ( preg_match_all( '/' . $pattern . '/s', $content, $matches ) && array_key_exists( 2, $matches ) ) {
|
45 |
foreach ( $matches[2] as $key => $value ) {
|
46 |
if ( 'wprm-recipe' === $value ) {
|
47 |
$recipe_shortcodes[ $matches[0][ $key ] ] = shortcode_parse_atts( stripslashes( $matches[3][ $key ] ) );
|
includes/public/class-wprm-metadata.php
CHANGED
@@ -129,7 +129,7 @@ class WPRM_Metadata {
|
|
129 |
$metadata['aggregateRating'] = array(
|
130 |
'@type' => 'AggregateRating',
|
131 |
'ratingValue' => $rating['average'],
|
132 |
-
'
|
133 |
);
|
134 |
}
|
135 |
|
129 |
$metadata['aggregateRating'] = array(
|
130 |
'@type' => 'AggregateRating',
|
131 |
'ratingValue' => $rating['average'],
|
132 |
+
'ratingCount' => $rating['count'],
|
133 |
);
|
134 |
}
|
135 |
|
includes/public/class-wprm-print.php
CHANGED
@@ -37,7 +37,7 @@ class WPRM_Print {
|
|
37 |
* @since 1.0.0
|
38 |
*/
|
39 |
public static function enqueue() {
|
40 |
-
wp_enqueue_script( 'wprm-print', WPRM_URL . '
|
41 |
|
42 |
wp_localize_script( 'wprm-print', 'wprm_public', array(
|
43 |
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
@@ -60,7 +60,7 @@ class WPRM_Print {
|
|
60 |
|
61 |
$styles = WPRM_Template_Manager::get_template_styles( $recipe, 'print' );
|
62 |
|
63 |
-
$print_html = '<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />' . $styles . '</head><body>';
|
64 |
$print_html .= WPRM_Template_Manager::get_template( $recipe, 'print' );
|
65 |
}
|
66 |
$print_html .= '</body></html>';
|
37 |
* @since 1.0.0
|
38 |
*/
|
39 |
public static function enqueue() {
|
40 |
+
wp_enqueue_script( 'wprm-print', WPRM_URL . 'assets/js/public/print.js', array( 'jquery' ), WPRM_VERSION, true );
|
41 |
|
42 |
wp_localize_script( 'wprm-print', 'wprm_public', array(
|
43 |
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
60 |
|
61 |
$styles = WPRM_Template_Manager::get_template_styles( $recipe, 'print' );
|
62 |
|
63 |
+
$print_html = '<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />' . $styles . '</head><body class="wprm-print">';
|
64 |
$print_html .= WPRM_Template_Manager::get_template( $recipe, 'print' );
|
65 |
}
|
66 |
$print_html .= '</body></html>';
|
includes/public/class-wprm-recipe-manager.php
CHANGED
@@ -37,6 +37,52 @@ class WPRM_Recipe_Manager {
|
|
37 |
add_action( 'wp_ajax_wprm_get_recipe', array( __CLASS__, 'ajax_get_recipe' ) );
|
38 |
}
|
39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
/**
|
41 |
* Get recipe data by ID through AJAX.
|
42 |
*
|
37 |
add_action( 'wp_ajax_wprm_get_recipe', array( __CLASS__, 'ajax_get_recipe' ) );
|
38 |
}
|
39 |
|
40 |
+
/**
|
41 |
+
* Get all recipes.
|
42 |
+
*
|
43 |
+
* @since 1.2.0
|
44 |
+
*/
|
45 |
+
public static function get_recipes() {
|
46 |
+
// TODO Use cache.
|
47 |
+
$recipes = array();
|
48 |
+
|
49 |
+
$limit = 200;
|
50 |
+
$offset = 0;
|
51 |
+
|
52 |
+
while ( true ) {
|
53 |
+
$args = array(
|
54 |
+
'post_type' => WPRM_POST_TYPE,
|
55 |
+
'post_status' => 'any',
|
56 |
+
'orderby' => 'date',
|
57 |
+
'order' => 'DESC',
|
58 |
+
'posts_per_page' => $limit,
|
59 |
+
'offset' => $offset,
|
60 |
+
);
|
61 |
+
|
62 |
+
$query = new WP_Query( $args );
|
63 |
+
|
64 |
+
if ( ! $query->have_posts() ) {
|
65 |
+
break;
|
66 |
+
}
|
67 |
+
|
68 |
+
$posts = $query->posts;
|
69 |
+
|
70 |
+
foreach ( $posts as $post ) {
|
71 |
+
$recipes[ $post->ID ] = array(
|
72 |
+
'name' => $post->post_title,
|
73 |
+
);
|
74 |
+
|
75 |
+
wp_cache_delete( $post->ID, 'posts' );
|
76 |
+
wp_cache_delete( $post->ID, 'post_meta' );
|
77 |
+
}
|
78 |
+
|
79 |
+
$offset += $limit;
|
80 |
+
wp_cache_flush();
|
81 |
+
}
|
82 |
+
|
83 |
+
return $recipes;
|
84 |
+
}
|
85 |
+
|
86 |
/**
|
87 |
* Get recipe data by ID through AJAX.
|
88 |
*
|
includes/public/class-wprm-recipe.php
CHANGED
@@ -160,6 +160,16 @@ class WPRM_Recipe {
|
|
160 |
return wp_get_attachment_image( $this->image_id(), $size );
|
161 |
}
|
162 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
163 |
/**
|
164 |
* Get the recipe image ID.
|
165 |
*
|
160 |
return wp_get_attachment_image( $this->image_id(), $size );
|
161 |
}
|
162 |
|
163 |
+
/**
|
164 |
+
* Get the recipe image data.
|
165 |
+
*
|
166 |
+
* @since 1.2.0
|
167 |
+
* @param mixed $size Thumbnail name or size array of the image we want.
|
168 |
+
*/
|
169 |
+
public function image_data( $size = 'thumbnail' ) {
|
170 |
+
return wp_get_attachment_image_src( $this->image_id(), $size );
|
171 |
+
}
|
172 |
+
|
173 |
/**
|
174 |
* Get the recipe image ID.
|
175 |
*
|
includes/public/class-wprm-settings.php
ADDED
@@ -0,0 +1,154 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Responsible for the plugin settings.
|
4 |
+
*
|
5 |
+
* @link http://bootstrapped.ventures
|
6 |
+
* @since 1.2.0
|
7 |
+
*
|
8 |
+
* @package WP_Recipe_Maker
|
9 |
+
* @subpackage WP_Recipe_Maker/includes/public
|
10 |
+
*/
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Responsible for the plugin settings.
|
14 |
+
*
|
15 |
+
* @since 1.2.0
|
16 |
+
* @package WP_Recipe_Maker
|
17 |
+
* @subpackage WP_Recipe_Maker/includes/public
|
18 |
+
* @author Brecht Vandersmissen <brecht@bootstrapped.ventures>
|
19 |
+
*/
|
20 |
+
class WPRM_Settings {
|
21 |
+
/**
|
22 |
+
* Cached version of the plugin settings.
|
23 |
+
*
|
24 |
+
* @since 1.2.0
|
25 |
+
* @access private
|
26 |
+
* @var array $settings Array containing the plugin settings.
|
27 |
+
*/
|
28 |
+
private static $settings = array();
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Defaults for the plugin settings.
|
32 |
+
*
|
33 |
+
* @since 1.2.0
|
34 |
+
* @access private
|
35 |
+
* @var array $defaults Default values for unset settings.
|
36 |
+
*/
|
37 |
+
private static $defaults = array(
|
38 |
+
'default_recipe_template' => 'simple',
|
39 |
+
'default_print_template' => 'clean-print',
|
40 |
+
);
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Register actions and filters.
|
44 |
+
*
|
45 |
+
* @since 1.2.0
|
46 |
+
*/
|
47 |
+
public static function init() {
|
48 |
+
add_action( 'admin_menu', array( __CLASS__, 'add_submenu_page' ), 20 );
|
49 |
+
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue' ) );
|
50 |
+
add_action( 'admin_post_wprm_settings', array( __CLASS__, 'form_save_settings' ) );
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Enqueue stylesheets and scripts.
|
55 |
+
*
|
56 |
+
* @since 1.2.0
|
57 |
+
*/
|
58 |
+
public static function enqueue() {
|
59 |
+
wp_enqueue_style( 'wprm-settings', WPRM_URL . 'assets/css/admin/settings.min.css', array(), WPRM_VERSION, 'all' );
|
60 |
+
|
61 |
+
wp_enqueue_script( 'wprm-settings', WPRM_URL . 'assets/js/admin/settings.js', array( 'jquery' ), WPRM_VERSION, true );
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Add the settings submenu to the WPRM menu.
|
66 |
+
*
|
67 |
+
* @since 1.2.0
|
68 |
+
*/
|
69 |
+
public static function add_submenu_page() {
|
70 |
+
add_submenu_page( 'wprecipemaker', __( 'WPRM Settings', 'wp-recipe-maker' ), __( 'Settings', 'wp-recipe-maker' ), 'manage_options', 'wprm_settings', array( __CLASS__, 'settings_page_template' ) );
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Get the template for the settings page.
|
75 |
+
*
|
76 |
+
* @since 1.2.0
|
77 |
+
*/
|
78 |
+
public static function settings_page_template() {
|
79 |
+
require_once( WPRM_DIR . 'templates/admin/settings/settings.php' );
|
80 |
+
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Get the value for a specific setting.
|
84 |
+
*
|
85 |
+
* @since 1.2.0
|
86 |
+
* @param mixed $setting Setting to get the value for.
|
87 |
+
*/
|
88 |
+
public static function get( $setting ) {
|
89 |
+
$settings = self::get_settings();
|
90 |
+
|
91 |
+
if ( isset( $settings[ $setting ] ) ) {
|
92 |
+
return $settings[ $setting ];
|
93 |
+
} else {
|
94 |
+
$defaults = self::$defaults;
|
95 |
+
if ( isset( $defaults[ $setting ] ) ) {
|
96 |
+
return $defaults[ $setting ];
|
97 |
+
} else {
|
98 |
+
return false;
|
99 |
+
}
|
100 |
+
}
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Get all the settings.
|
105 |
+
*
|
106 |
+
* @since 1.2.0
|
107 |
+
*/
|
108 |
+
public static function get_settings() {
|
109 |
+
// Lazy load settings.
|
110 |
+
if ( empty( self::$settings ) ) {
|
111 |
+
self::load_settings();
|
112 |
+
}
|
113 |
+
|
114 |
+
return self::$settings;
|
115 |
+
}
|
116 |
+
|
117 |
+
/**
|
118 |
+
* Load all the plugin settings.
|
119 |
+
*
|
120 |
+
* @since 1.2.0
|
121 |
+
*/
|
122 |
+
private static function load_settings() {
|
123 |
+
self::$settings = get_option( 'wprm_settings', array() );
|
124 |
+
}
|
125 |
+
|
126 |
+
/**
|
127 |
+
* Save the settings.
|
128 |
+
*
|
129 |
+
* @since 1.2.0
|
130 |
+
*/
|
131 |
+
public static function form_save_settings() {
|
132 |
+
if ( isset( $_POST['wprm_settings'] ) && wp_verify_nonce( sanitize_key( $_POST['wprm_settings'] ), 'wprm_settings' ) ) { // Input var okay.
|
133 |
+
$default_recipe_template = isset( $_POST['default_recipe_template'] ) ? sanitize_title( wp_unslash( $_POST['default_recipe_template'] ) ) : ''; // Input var okay.
|
134 |
+
$default_print_template = isset( $_POST['default_print_template'] ) ? sanitize_title( wp_unslash( $_POST['default_print_template'] ) ) : ''; // Input var okay.
|
135 |
+
|
136 |
+
$settings = self::get_settings();
|
137 |
+
|
138 |
+
if ( $default_recipe_template ) {
|
139 |
+
$settings['default_recipe_template'] = $default_recipe_template;
|
140 |
+
}
|
141 |
+
|
142 |
+
if ( $default_print_template ) {
|
143 |
+
$settings['default_print_template'] = $default_print_template;
|
144 |
+
}
|
145 |
+
|
146 |
+
update_option( 'wprm_settings', $settings );
|
147 |
+
self::$settings = $settings;
|
148 |
+
}
|
149 |
+
wp_safe_redirect( admin_url( 'admin.php?page=wprm_settings' ) );
|
150 |
+
exit();
|
151 |
+
}
|
152 |
+
}
|
153 |
+
|
154 |
+
WPRM_Settings::init();
|
includes/public/class-wprm-shortcode.php
CHANGED
@@ -26,6 +26,8 @@ class WPRM_Shortcode {
|
|
26 |
*/
|
27 |
public static function init() {
|
28 |
add_shortcode( 'wprm-recipe', array( __CLASS__, 'recipe_shortcode' ) );
|
|
|
|
|
29 |
add_action( 'wp_enqueue_scripts', array( __CLASS__, 'enqueue' ) );
|
30 |
}
|
31 |
|
@@ -35,7 +37,7 @@ class WPRM_Shortcode {
|
|
35 |
* @since 1.1.0
|
36 |
*/
|
37 |
public static function enqueue() {
|
38 |
-
wp_enqueue_style( 'wprm-public', WPRM_URL . '
|
39 |
}
|
40 |
|
41 |
/**
|
@@ -62,6 +64,70 @@ class WPRM_Shortcode {
|
|
62 |
return '';
|
63 |
}
|
64 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
}
|
66 |
|
67 |
WPRM_Shortcode::init();
|
26 |
*/
|
27 |
public static function init() {
|
28 |
add_shortcode( 'wprm-recipe', array( __CLASS__, 'recipe_shortcode' ) );
|
29 |
+
add_shortcode( 'wprm-recipe-jump', array( __CLASS__, 'jump_to_recipe_shortcode' ) );
|
30 |
+
add_shortcode( 'wprm-recipe-print', array( __CLASS__, 'print_recipe_shortcode' ) );
|
31 |
add_action( 'wp_enqueue_scripts', array( __CLASS__, 'enqueue' ) );
|
32 |
}
|
33 |
|
37 |
* @since 1.1.0
|
38 |
*/
|
39 |
public static function enqueue() {
|
40 |
+
wp_enqueue_style( 'wprm-public', WPRM_URL . 'assets/css/public/public.min.css', array(), WPRM_VERSION, 'all' );
|
41 |
}
|
42 |
|
43 |
/**
|
64 |
return '';
|
65 |
}
|
66 |
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Output for the jump to recipe shortcode.
|
70 |
+
*
|
71 |
+
* @since 1.2.0
|
72 |
+
* @param array $atts Options passed along with the shortcode.
|
73 |
+
*/
|
74 |
+
public static function jump_to_recipe_shortcode( $atts ) {
|
75 |
+
$atts = shortcode_atts( array(
|
76 |
+
'id' => '0',
|
77 |
+
'text' => __( 'Jump to Recipe', 'wp-recipe-maker' ),
|
78 |
+
), $atts, 'wprm_recipe_jump' );
|
79 |
+
|
80 |
+
$recipe_id = intval( $atts['id'] );
|
81 |
+
$text = $atts['text'];
|
82 |
+
|
83 |
+
// Get first recipe in post content if no ID is set.
|
84 |
+
if ( ! $recipe_id ) {
|
85 |
+
$parent_post = get_post();
|
86 |
+
$recipes = WPRM_Recipe_Manager::get_recipe_ids_from_content( $parent_post->post_content );
|
87 |
+
|
88 |
+
if ( isset( $recipes[0] ) ) {
|
89 |
+
$recipe_id = $recipes[0];
|
90 |
+
}
|
91 |
+
}
|
92 |
+
|
93 |
+
if ( $recipe_id ) {
|
94 |
+
return '<a href="#wprm-recipe-container-' . esc_attr( $recipe_id ) . '" class="wprm-jump-to-recipe-shortcode">' . esc_html( $text ) . '</a>';
|
95 |
+
} else {
|
96 |
+
return '';
|
97 |
+
}
|
98 |
+
}
|
99 |
+
|
100 |
+
/**
|
101 |
+
* Output for the print recipe shortcode.
|
102 |
+
*
|
103 |
+
* @since 1.2.0
|
104 |
+
* @param array $atts Options passed along with the shortcode.
|
105 |
+
*/
|
106 |
+
public static function print_recipe_shortcode( $atts ) {
|
107 |
+
$atts = shortcode_atts( array(
|
108 |
+
'id' => '0',
|
109 |
+
'text' => __( 'Print Recipe', 'wp-recipe-maker' ),
|
110 |
+
), $atts, 'wprm_recipe_print' );
|
111 |
+
|
112 |
+
$recipe_id = intval( $atts['id'] );
|
113 |
+
$text = $atts['text'];
|
114 |
+
|
115 |
+
// Get first recipe in post content if no ID is set.
|
116 |
+
if ( ! $recipe_id ) {
|
117 |
+
$parent_post = get_post();
|
118 |
+
$recipes = WPRM_Recipe_Manager::get_recipe_ids_from_content( $parent_post->post_content );
|
119 |
+
|
120 |
+
if ( isset( $recipes[0] ) ) {
|
121 |
+
$recipe_id = $recipes[0];
|
122 |
+
}
|
123 |
+
}
|
124 |
+
|
125 |
+
if ( $recipe_id ) {
|
126 |
+
return '<a href="#" class="wprm-print-recipe-shortcode" data-recipe-id="' . esc_attr( $recipe_id ) . '">' . esc_html( $text ) . '</a>';
|
127 |
+
} else {
|
128 |
+
return '';
|
129 |
+
}
|
130 |
+
}
|
131 |
}
|
132 |
|
133 |
WPRM_Shortcode::init();
|
includes/public/class-wprm-template-manager.php
CHANGED
@@ -18,6 +18,14 @@
|
|
18 |
* @author Brecht Vandersmissen <brecht@bootstrapped.ventures>
|
19 |
*/
|
20 |
class WPRM_Template_Manager {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
/**
|
23 |
* Register actions and filters.
|
@@ -34,7 +42,10 @@ class WPRM_Template_Manager {
|
|
34 |
* @since 1.0.0
|
35 |
*/
|
36 |
public static function enqueue() {
|
37 |
-
|
|
|
|
|
|
|
38 |
}
|
39 |
|
40 |
/**
|
@@ -45,10 +56,16 @@ class WPRM_Template_Manager {
|
|
45 |
* @param mixed $type Type of template we want to get, defaults to single.
|
46 |
*/
|
47 |
public static function get_template( $recipe, $type = 'single' ) {
|
48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
|
50 |
ob_start();
|
51 |
-
require(
|
52 |
$template = ob_get_contents();
|
53 |
ob_end_clean();
|
54 |
|
@@ -63,10 +80,16 @@ class WPRM_Template_Manager {
|
|
63 |
* @param mixed $type Type of template we want to get, defaults to single.
|
64 |
*/
|
65 |
public static function get_template_styles( $recipe, $type = 'single' ) {
|
66 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
|
68 |
ob_start();
|
69 |
-
require(
|
70 |
$css = ob_get_contents();
|
71 |
ob_end_clean();
|
72 |
|
@@ -74,6 +97,93 @@ class WPRM_Template_Manager {
|
|
74 |
|
75 |
return $style;
|
76 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
}
|
78 |
|
79 |
WPRM_Template_Manager::init();
|
18 |
* @author Brecht Vandersmissen <brecht@bootstrapped.ventures>
|
19 |
*/
|
20 |
class WPRM_Template_Manager {
|
21 |
+
/**
|
22 |
+
* Cached version of all the available templates.
|
23 |
+
*
|
24 |
+
* @since 1.2.0
|
25 |
+
* @access private
|
26 |
+
* @var array $templates Array containing all templates that have been loaded.
|
27 |
+
*/
|
28 |
+
private static $templates = array();
|
29 |
|
30 |
/**
|
31 |
* Register actions and filters.
|
42 |
* @since 1.0.0
|
43 |
*/
|
44 |
public static function enqueue() {
|
45 |
+
$template_slug = WPRM_Settings::get( 'default_recipe_template' );
|
46 |
+
$template = self::get_template_by_slug( $template_slug );
|
47 |
+
|
48 |
+
wp_enqueue_style( 'wprm-template', $template['url'] . '/' . $template['slug'] . '.min.css', array(), WPRM_VERSION, 'all' );
|
49 |
}
|
50 |
|
51 |
/**
|
56 |
* @param mixed $type Type of template we want to get, defaults to single.
|
57 |
*/
|
58 |
public static function get_template( $recipe, $type = 'single' ) {
|
59 |
+
if ( 'print' === $type ) {
|
60 |
+
$template_slug = WPRM_Settings::get( 'default_print_template' );
|
61 |
+
$template = self::get_template_by_slug( $template_slug );
|
62 |
+
} else {
|
63 |
+
$template_slug = WPRM_Settings::get( 'default_recipe_template' );
|
64 |
+
$template = self::get_template_by_slug( $template_slug );
|
65 |
+
}
|
66 |
|
67 |
ob_start();
|
68 |
+
require( $template['dir'] . '/' . $template['slug'] . '.php' );
|
69 |
$template = ob_get_contents();
|
70 |
ob_end_clean();
|
71 |
|
80 |
* @param mixed $type Type of template we want to get, defaults to single.
|
81 |
*/
|
82 |
public static function get_template_styles( $recipe, $type = 'single' ) {
|
83 |
+
if ( 'print' === $type ) {
|
84 |
+
$template_slug = WPRM_Settings::get( 'default_print_template' );
|
85 |
+
$template = self::get_template_by_slug( $template_slug );
|
86 |
+
} else {
|
87 |
+
$template_slug = WPRM_Settings::get( 'default_recipe_template' );
|
88 |
+
$template = self::get_template_by_slug( $template_slug );
|
89 |
+
}
|
90 |
|
91 |
ob_start();
|
92 |
+
require( $template['dir'] . '/' . $template['slug'] . '.min.css' );
|
93 |
$css = ob_get_contents();
|
94 |
ob_end_clean();
|
95 |
|
97 |
|
98 |
return $style;
|
99 |
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Get template by name.
|
103 |
+
*
|
104 |
+
* @since 1.2.0
|
105 |
+
* @param mixed $slug Slug of the template we want to get.
|
106 |
+
*/
|
107 |
+
public static function get_template_by_slug( $slug ) {
|
108 |
+
$templates = self::get_templates();
|
109 |
+
$template = isset( $templates[ $slug ] ) ? $templates[ $slug ] : false;
|
110 |
+
|
111 |
+
return $template;
|
112 |
+
}
|
113 |
+
|
114 |
+
/**
|
115 |
+
* Get all available templates.
|
116 |
+
*
|
117 |
+
* @since 1.2.0
|
118 |
+
*/
|
119 |
+
public static function get_templates() {
|
120 |
+
if ( empty( self::$templates ) ) {
|
121 |
+
self::load_templates();
|
122 |
+
}
|
123 |
+
|
124 |
+
return self::$templates;
|
125 |
+
}
|
126 |
+
|
127 |
+
/**
|
128 |
+
* Load all available templates.
|
129 |
+
*
|
130 |
+
* @since 1.2.0
|
131 |
+
*/
|
132 |
+
private static function load_templates() {
|
133 |
+
$templates = array();
|
134 |
+
|
135 |
+
// Load included templates.
|
136 |
+
$dirs = array_filter( glob( WPRM_DIR . 'templates/recipe/*' ), 'is_dir' );
|
137 |
+
|
138 |
+
foreach ( $dirs as $dir ) {
|
139 |
+
$template = self::load_template( $dir, false );
|
140 |
+
$templates[ $template['slug'] ] = $template;
|
141 |
+
}
|
142 |
+
|
143 |
+
// Load custom templates.
|
144 |
+
$theme_dir = get_stylesheet_directory();
|
145 |
+
|
146 |
+
if ( file_exists( $theme_dir . '/wprm-templates' ) && file_exists( $theme_dir . '/wprm-templates/recipe' ) ) {
|
147 |
+
$theme_url = get_stylesheet_directory_uri();
|
148 |
+
|
149 |
+
$dirs = array_filter( glob( $theme_dir . '/wprm-templates/recipe/*' ), 'is_dir' );
|
150 |
+
|
151 |
+
foreach ( $dirs as $dir ) {
|
152 |
+
$template = self::load_template( $dir, true );
|
153 |
+
$templates[ $template['slug'] ] = $template;
|
154 |
+
}
|
155 |
+
}
|
156 |
+
|
157 |
+
self::$templates = $templates;
|
158 |
+
}
|
159 |
+
|
160 |
+
/**
|
161 |
+
* Load template from directory.
|
162 |
+
*
|
163 |
+
* @since 1.2.0
|
164 |
+
* @param mixed $dir Directory to load the template from.
|
165 |
+
* @param boolean $custom Wether or not this is a custom template included by the user.
|
166 |
+
*/
|
167 |
+
private static function load_template( $dir, $custom = false ) {
|
168 |
+
$slug = basename( $dir );
|
169 |
+
$name = ucwords( str_replace( '-', ' ', $slug ) );
|
170 |
+
|
171 |
+
$screenshot = false;
|
172 |
+
$screenshots = glob( $dir . '/' . $slug . '.{jpg,jpeg,png,gif}', GLOB_BRACE );
|
173 |
+
if ( ! empty( $screenshots ) ) {
|
174 |
+
$info = pathinfo( $screenshots[0] );
|
175 |
+
$screenshot = $info['extension'];
|
176 |
+
}
|
177 |
+
|
178 |
+
return array(
|
179 |
+
'custom' => $custom,
|
180 |
+
'name' => $name,
|
181 |
+
'slug' => $slug,
|
182 |
+
'dir' => $dir,
|
183 |
+
'url' => WPRM_URL . 'templates/recipe/' . $slug,
|
184 |
+
'screenshot' => $screenshot,
|
185 |
+
);
|
186 |
+
}
|
187 |
}
|
188 |
|
189 |
WPRM_Template_Manager::init();
|
readme.txt
CHANGED
@@ -23,6 +23,7 @@ An overview of WP Recipe Maker features:
|
|
23 |
* Clean **print recipe** version for your visitors
|
24 |
* **Fallback recipe** shows up when the plugin is disabled
|
25 |
* Add **photos** to any step of the recipe
|
|
|
26 |
* This plugin is **fully responsive**, your recipes will look good on any device
|
27 |
* Structure your ingredients and instructions in **groups** (e.g. icing and cake batter)
|
28 |
* **Full text search** for your recipes
|
@@ -48,6 +49,11 @@ Feel free to contact us with any feature requests or ideas.
|
|
48 |
|
49 |
== Frequently asked questions ==
|
50 |
|
|
|
|
|
|
|
|
|
|
|
51 |
= What's the difference with WP Ultimate Recipe? =
|
52 |
|
53 |
[WP Ultimate Recipe](http://www.wpultimaterecipe.com/) is the popular recipe plugin that we released in 2013 and have been working on ever since. This gave us a great idea of what most food bloggers are looking for.
|
@@ -65,9 +71,19 @@ Yes! We pride ourselves on offering awesome support and almost always answer sup
|
|
65 |
1. Example Pasta Pesto recipe with the Simple template.
|
66 |
2. Use the "WP Recipe Maker" button to add recipes or click on the recipe preview to edit one.
|
67 |
3. The recipe form.
|
|
|
68 |
|
69 |
== Changelog ==
|
70 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
= 1.1.0 =
|
72 |
* Feature: Comment ratings with metadata
|
73 |
* Feature: Inline metadata for Pinterest rich pins
|
@@ -85,6 +101,9 @@ Yes! We pride ourselves on offering awesome support and almost always answer sup
|
|
85 |
|
86 |
== Upgrade notice ==
|
87 |
|
|
|
|
|
|
|
88 |
= 1.1.0 =
|
89 |
Update highly recommended for SEO purposes.
|
90 |
|
23 |
* Clean **print recipe** version for your visitors
|
24 |
* **Fallback recipe** shows up when the plugin is disabled
|
25 |
* Add **photos** to any step of the recipe
|
26 |
+
* Print recipe and **jump to recipe** shortcodes
|
27 |
* This plugin is **fully responsive**, your recipes will look good on any device
|
28 |
* Structure your ingredients and instructions in **groups** (e.g. icing and cake batter)
|
29 |
* **Full text search** for your recipes
|
49 |
|
50 |
== Frequently asked questions ==
|
51 |
|
52 |
+
= Can I create my own recipe template? =
|
53 |
+
Yes! We will include some easy templating options to the plugin in the future, but anyone who knows HTML and CSS can already code their own template.
|
54 |
+
|
55 |
+
Take a look at the /templates/recipe/ folder for an example of the included templates. You can create your own template in this same structure by adding a /wprm-templates/recipe/your-template/ folder to your (child) theme.
|
56 |
+
|
57 |
= What's the difference with WP Ultimate Recipe? =
|
58 |
|
59 |
[WP Ultimate Recipe](http://www.wpultimaterecipe.com/) is the popular recipe plugin that we released in 2013 and have been working on ever since. This gave us a great idea of what most food bloggers are looking for.
|
71 |
1. Example Pasta Pesto recipe with the Simple template.
|
72 |
2. Use the "WP Recipe Maker" button to add recipes or click on the recipe preview to edit one.
|
73 |
3. The recipe form.
|
74 |
+
4. Example Pasta Pesto recipe with the Tastefully Simple (EasyRecipe like) template.
|
75 |
|
76 |
== Changelog ==
|
77 |
|
78 |
+
= 1.2.0 =
|
79 |
+
* Feature: New "Tastefully Simple" template, similar to EasyRecipe
|
80 |
+
* Feature: New "Clean Print with Image" recipe template
|
81 |
+
* Feature: Print recipe shortcode
|
82 |
+
* Feature: Jump to recipe shortcode
|
83 |
+
* Improvement: Shortcode preview includes image and summary
|
84 |
+
* Fix: use ratingCount instead of reviewCount for JSON-LD metadata
|
85 |
+
* Fix: Trailing slash issue in asset URLs
|
86 |
+
|
87 |
= 1.1.0 =
|
88 |
* Feature: Comment ratings with metadata
|
89 |
* Feature: Inline metadata for Pinterest rich pins
|
101 |
|
102 |
== Upgrade notice ==
|
103 |
|
104 |
+
= 1.2.0 =
|
105 |
+
Update for some new SEO improvements and recipe templates.
|
106 |
+
|
107 |
= 1.1.0 =
|
108 |
Update highly recommended for SEO purposes.
|
109 |
|
templates/admin/menu/faq.php
CHANGED
@@ -22,7 +22,7 @@ $version = WPRM_VERSION;
|
|
22 |
$full_name = $name . ' ' . $version;
|
23 |
|
24 |
// Image directory.
|
25 |
-
$img_dir = WPRM_URL . '
|
26 |
?>
|
27 |
|
28 |
<div class="wrap about-wrap wprm-faq">
|
@@ -45,5 +45,5 @@ $img_dir = WPRM_URL . '/assets/images/faq';
|
|
45 |
</a>
|
46 |
</h2>
|
47 |
|
48 |
-
<?php include( WPRM_DIR . '
|
49 |
</div>
|
22 |
$full_name = $name . ' ' . $version;
|
23 |
|
24 |
// Image directory.
|
25 |
+
$img_dir = WPRM_URL . 'assets/images/faq';
|
26 |
?>
|
27 |
|
28 |
<div class="wrap about-wrap wprm-faq">
|
45 |
</a>
|
46 |
</h2>
|
47 |
|
48 |
+
<?php include( WPRM_DIR . 'templates/admin/menu/faq/' . $sub . '.php' ); ?>
|
49 |
</div>
|
templates/admin/menu/faq/getting_started.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Template for the WP Recipe Maker FAQ Getting Started page.
|
4 |
*
|
5 |
* @link http://bootstrapped.ventures
|
6 |
-
* @since 1.
|
7 |
*
|
8 |
* @package WP_Recipe_Maker
|
9 |
* @subpackage WP_Recipe_Maker/templates/admin/menu/faq
|
3 |
* Template for the WP Recipe Maker FAQ Getting Started page.
|
4 |
*
|
5 |
* @link http://bootstrapped.ventures
|
6 |
+
* @since 1.1.0
|
7 |
*
|
8 |
* @package WP_Recipe_Maker
|
9 |
* @subpackage WP_Recipe_Maker/templates/admin/menu/faq
|
templates/admin/menu/faq/support.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Template for the WP Recipe Maker FAQ Support page.
|
4 |
*
|
5 |
* @link http://bootstrapped.ventures
|
6 |
-
* @since 1.
|
7 |
*
|
8 |
* @package WP_Recipe_Maker
|
9 |
* @subpackage WP_Recipe_Maker/templates/admin/menu/faq
|
3 |
* Template for the WP Recipe Maker FAQ Support page.
|
4 |
*
|
5 |
* @link http://bootstrapped.ventures
|
6 |
+
* @since 1.1.0
|
7 |
*
|
8 |
* @package WP_Recipe_Maker
|
9 |
* @subpackage WP_Recipe_Maker/templates/admin/menu/faq
|
templates/admin/menu/faq/welcome.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Template for the WP Recipe Maker FAQ Welcome page.
|
4 |
*
|
5 |
* @link http://bootstrapped.ventures
|
6 |
-
* @since 1.
|
7 |
*
|
8 |
* @package WP_Recipe_Maker
|
9 |
* @subpackage WP_Recipe_Maker/templates/admin/menu/faq
|
3 |
* Template for the WP Recipe Maker FAQ Welcome page.
|
4 |
*
|
5 |
* @link http://bootstrapped.ventures
|
6 |
+
* @since 1.1.0
|
7 |
*
|
8 |
* @package WP_Recipe_Maker
|
9 |
* @subpackage WP_Recipe_Maker/templates/admin/menu/faq
|
templates/admin/menu/faq/whats_new.php
CHANGED
@@ -12,6 +12,17 @@
|
|
12 |
?>
|
13 |
|
14 |
<h3>Latest Update (<?php echo esc_html( $version ); ?>)</h3>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
<ul>
|
16 |
<li>Feature: Comment ratings with metadata</li>
|
17 |
<li>Feature: Inline metadata for Pinterest rich pins</li>
|
12 |
?>
|
13 |
|
14 |
<h3>Latest Update (<?php echo esc_html( $version ); ?>)</h3>
|
15 |
+
<ul>
|
16 |
+
<li>Feature: New "Tastefully Simple" template, similar to EasyRecipe</li>
|
17 |
+
<li>Feature: New "Clean Print with Image" recipe template</li>
|
18 |
+
<li>Feature: Print recipe shortcode</li>
|
19 |
+
<li>Feature: Jump to recipe shortcode</li>
|
20 |
+
<li>Improvement: Shortcode preview includes image and summary</li>
|
21 |
+
<li>Fix: use ratingCount instead of reviewCount for JSON-LD metadata</li>
|
22 |
+
<li>Fix: Trailing slash issue in asset URLs</li>
|
23 |
+
</ul>
|
24 |
+
|
25 |
+
<h3>1.1.0</h3>
|
26 |
<ul>
|
27 |
<li>Feature: Comment ratings with metadata</li>
|
28 |
<li>Feature: Inline metadata for Pinterest rich pins</li>
|
templates/admin/modal/modal.php
CHANGED
@@ -53,8 +53,10 @@
|
|
53 |
$tab_uid = $menu_item . '-' . $tab;
|
54 |
$tab_class = $default_tab === $tab ? ' active' : '';
|
55 |
$label = isset( $tab_options['label'] ) ? $tab_options['label'] : '';
|
|
|
|
|
56 |
|
57 |
-
echo '<a href="#" class="wprm-menu-item' . esc_attr( $tab_class ) . '" data-tab="' . esc_attr( $tab_uid ) . '">' . esc_html( $label ) . '</a>';
|
58 |
}
|
59 |
|
60 |
echo '</div>';
|
@@ -88,8 +90,7 @@
|
|
88 |
<div class="wprm-frame-toolbar">
|
89 |
<div class="wprm-toolbar">
|
90 |
<div class="wprm-toolbar-primary search-form">
|
91 |
-
<button type="button" class="button wprm-button button-primary button-large wprm-button-
|
92 |
-
<button type="button" class="button wprm-button button-primary button-large wprm-button-update"><?php esc_html_e( 'Update', 'wp-recipe-maker' ); ?></button>
|
93 |
</div>
|
94 |
</div>
|
95 |
</div>
|
53 |
$tab_uid = $menu_item . '-' . $tab;
|
54 |
$tab_class = $default_tab === $tab ? ' active' : '';
|
55 |
$label = isset( $tab_options['label'] ) ? $tab_options['label'] : '';
|
56 |
+
$callback = isset( $tab_options['callback'] ) ? $tab_options['callback'] : '';
|
57 |
+
$init = isset( $tab_options['init'] ) ? $tab_options['init'] : '';
|
58 |
|
59 |
+
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 ) . '">' . esc_html( $label ) . '</a>';
|
60 |
}
|
61 |
|
62 |
echo '</div>';
|
90 |
<div class="wprm-frame-toolbar">
|
91 |
<div class="wprm-toolbar">
|
92 |
<div class="wprm-toolbar-primary search-form">
|
93 |
+
<button type="button" class="button wprm-button button-primary button-large wprm-button-action"><?php esc_html_e( 'Insert', 'wp-recipe-maker' ); ?></button>
|
|
|
94 |
</div>
|
95 |
</div>
|
96 |
</div>
|
templates/admin/modal/shortcode-preview.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Template for the recipe shortcode preview.
|
4 |
+
*
|
5 |
+
* @link http://bootstrapped.ventures
|
6 |
+
* @since 1.2.0
|
7 |
+
*
|
8 |
+
* @package WP_Recipe_Maker
|
9 |
+
* @subpackage WP_Recipe_Maker/templates/admin/modal
|
10 |
+
*/
|
11 |
+
|
12 |
+
?>
|
13 |
+
<?php
|
14 |
+
$image = $recipe->image( array( 100, 100 ) );
|
15 |
+
if ( $image ) :
|
16 |
+
?>
|
17 |
+
<span contentEditable="false" style="display: inline-block; float: left; margin: 0 10px 10px 0;"><?php echo wp_kses_post( $image ); ?></span>
|
18 |
+
<?php endif; // Image. ?>
|
19 |
+
<span contentEditable="false" style="display: inline-block; margin-bottom: 10px;"><?php echo esc_html( $recipe->name() ); ?></span>
|
20 |
+
<span contentEditable="false" style="display: block; margin-bottom: 10px;"><?php echo esc_html( wp_strip_all_tags( $recipe->summary() ) ); ?></span>
|
21 |
+
<span contentEditable="false" style="display: block; clear: both; height: 1px; line-height: 1px;"> </span>
|
templates/admin/modal/tabs/recipe-snippets-jump.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Template for the Jump to Recipe tab in the modal.
|
4 |
+
*
|
5 |
+
* @link http://bootstrapped.ventures
|
6 |
+
* @since 1.2.0
|
7 |
+
*
|
8 |
+
* @package WP_Recipe_Maker
|
9 |
+
* @subpackage WP_Recipe_Maker/templates/admin/modal/tabs
|
10 |
+
*/
|
11 |
+
|
12 |
+
?>
|
13 |
+
|
14 |
+
<p>
|
15 |
+
<?php printf( esc_html__( 'The %s shortcode can be used to add a link that jumps your visitors to a recipe on the page.', 'wp-recipe-maker' ), esc_html( '[wprm-recipe-jump]' ) ); ?>
|
16 |
+
</p>
|
17 |
+
<h3><?php esc_html_e( 'Shortcode Examples' ); ?></h3>
|
18 |
+
<p>
|
19 |
+
[wprm-recipe-jump]<br />
|
20 |
+
<em><?php esc_html_e( 'Add a link that jumps to the first recipe found on the page with "Jump to Recipe" as the link text.', 'wp-recipe-maker' ); ?></em>
|
21 |
+
</p>
|
22 |
+
<p>
|
23 |
+
[wprm-recipe-jump id="123"]<br />
|
24 |
+
<em><?php esc_html_e( 'Add a link that jumps to the recipe with ID 123 with "Jump to Recipe" as the link text.', 'wp-recipe-maker' ); ?></em>
|
25 |
+
</p>
|
26 |
+
<p>
|
27 |
+
[wprm-recipe-jump id="123" text="View Recipe"]<br />
|
28 |
+
<em><?php esc_html_e( 'Add a link that jumps to the recipe with ID 123 with "View Recipe" as the link text.', 'wp-recipe-maker' ); ?></em>
|
29 |
+
</p>
|
30 |
+
<h3><?php esc_html_e( 'Shortcode Builder' ); ?></h3>
|
31 |
+
<div class="wprm-shortcode-builder">
|
32 |
+
<div class="wprm-shortcode-builder-container">
|
33 |
+
<label for="wprm-recipe-jump-id"><?php esc_html_e( 'Recipe', 'wp-recipe-maker' ); ?></label>
|
34 |
+
<select id="wprm-recipe-jump-id">
|
35 |
+
<option value="0"><?php esc_html_e( 'First recipe on page', 'wp-recipe-maker' ); ?></option>
|
36 |
+
<?php
|
37 |
+
foreach ( WPRM_Recipe_Manager::get_recipes() as $id => $recipe ) {
|
38 |
+
echo '<option value="' . esc_attr( $id ) . '">#' . esc_html( $id ) . ' - ' . esc_html( $recipe['name'] ) . '</option>';
|
39 |
+
}
|
40 |
+
?>
|
41 |
+
</select>
|
42 |
+
</div>
|
43 |
+
<div class="wprm-shortcode-builder-container">
|
44 |
+
<label for="wprm-recipe-jump-text"><?php esc_html_e( 'Text', 'wp-recipe-maker' ); ?></label>
|
45 |
+
<input type="text" id="wprm-recipe-jump-text" placeholder="<?php esc_attr_e( 'Jump to Recipe', 'wp-recipe-maker' ); ?>" />
|
46 |
+
<span class="wprm-shortcode-builder-helper"><?php esc_html_e( 'Leave blank to use default', 'wp-recipe-maker' ); ?></span>
|
47 |
+
</div>
|
48 |
+
</div>
|
templates/admin/modal/tabs/recipe-snippets-print.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Template for the Print Recipe tab in the modal.
|
4 |
+
*
|
5 |
+
* @link http://bootstrapped.ventures
|
6 |
+
* @since 1.2.0
|
7 |
+
*
|
8 |
+
* @package WP_Recipe_Maker
|
9 |
+
* @subpackage WP_Recipe_Maker/templates/admin/modal/tabs
|
10 |
+
*/
|
11 |
+
|
12 |
+
?>
|
13 |
+
|
14 |
+
<p>
|
15 |
+
<?php printf( esc_html__( 'The %s shortcode can be used to add a link for printing a recipe.', 'wp-recipe-maker' ), esc_html( '[wprm-recipe-print]' ) ); ?>
|
16 |
+
</p>
|
17 |
+
<h3><?php esc_html_e( 'Shortcode Examples' ); ?></h3>
|
18 |
+
<p>
|
19 |
+
[wprm-recipe-print]<br />
|
20 |
+
<em><?php esc_html_e( 'Add a link that prints the first recipe found on the page with "Print Recipe" as the link text.', 'wp-recipe-maker' ); ?></em>
|
21 |
+
</p>
|
22 |
+
<p>
|
23 |
+
[wprm-recipe-print id="123"]<br />
|
24 |
+
<em><?php esc_html_e( 'Add a link that prints the recipe with ID 123 with "Print Recipe" as the link text.', 'wp-recipe-maker' ); ?></em>
|
25 |
+
</p>
|
26 |
+
<p>
|
27 |
+
[wprm-recipe-print id="123" text="Print my new Recipe"]<br />
|
28 |
+
<em><?php esc_html_e( 'Add a link that prints the recipe with ID 123 with "Print my new Recipe" as the link text.', 'wp-recipe-maker' ); ?></em>
|
29 |
+
</p>
|
30 |
+
<h3><?php esc_html_e( 'Shortcode Builder' ); ?></h3>
|
31 |
+
<div class="wprm-shortcode-builder">
|
32 |
+
<div class="wprm-shortcode-builder-container">
|
33 |
+
<label for="wprm-recipe-print-id"><?php esc_html_e( 'Recipe', 'wp-recipe-maker' ); ?></label>
|
34 |
+
<select id="wprm-recipe-print-id">
|
35 |
+
<option value="0"><?php esc_html_e( 'First recipe on page', 'wp-recipe-maker' ); ?></option>
|
36 |
+
<?php
|
37 |
+
foreach ( WPRM_Recipe_Manager::get_recipes() as $id => $recipe ) {
|
38 |
+
echo '<option value="' . esc_attr( $id ) . '">#' . esc_html( $id ) . ' - ' . esc_html( $recipe['name'] ) . '</option>';
|
39 |
+
}
|
40 |
+
?>
|
41 |
+
</select>
|
42 |
+
</div>
|
43 |
+
<div class="wprm-shortcode-builder-container">
|
44 |
+
<label for="wprm-recipe-print-text"><?php esc_html_e( 'Text', 'wp-recipe-maker' ); ?></label>
|
45 |
+
<input type="text" id="wprm-recipe-print-text" placeholder="<?php esc_attr_e( 'Print Recipe', 'wp-recipe-maker' ); ?>" />
|
46 |
+
<span class="wprm-shortcode-builder-helper"><?php esc_html_e( 'Leave blank to use default', 'wp-recipe-maker' ); ?></span>
|
47 |
+
</div>
|
48 |
+
</div>
|
templates/admin/settings/settings.php
ADDED
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Template for recipe settings page.
|
4 |
+
*
|
5 |
+
* @link http://bootstrapped.ventures
|
6 |
+
* @since 1.0.0
|
7 |
+
*
|
8 |
+
* @package WP_Recipe_Maker
|
9 |
+
* @subpackage WP_Recipe_Maker/templates/admin/settings
|
10 |
+
*/
|
11 |
+
|
12 |
+
?>
|
13 |
+
|
14 |
+
<div class="wrap wprm-settings">
|
15 |
+
<h1><?php esc_html_e( 'WP Recipe Maker Settings', 'wp-recipe-maker' ); ?></h1>
|
16 |
+
<form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>">
|
17 |
+
<input type="hidden" name="action" value="wprm_settings">
|
18 |
+
<?php wp_nonce_field( 'wprm_settings', 'wprm_settings', false ); ?>
|
19 |
+
<h2 class="title"><?php esc_html_e( 'Recipe Template', 'wp-recipe-maker' ); ?></h2>
|
20 |
+
<p>
|
21 |
+
<?php esc_html_e( 'Change the look of recipes on your website.', 'wp-recipe-maker' ); ?>
|
22 |
+
</p>
|
23 |
+
<?php
|
24 |
+
$templates = WPRM_Template_Manager::get_templates();
|
25 |
+
?>
|
26 |
+
<table class="form-table">
|
27 |
+
<tbody>
|
28 |
+
<tr>
|
29 |
+
<th scope="row">
|
30 |
+
<label for="default_recipe_template"><?php esc_html_e( 'Default Recipe Template', 'wp-recipe-maker' ); ?></label>
|
31 |
+
</th>
|
32 |
+
<td>
|
33 |
+
<select id="default_recipe_template" name="default_recipe_template">
|
34 |
+
<?php
|
35 |
+
$setting = WPRM_Settings::get( 'default_recipe_template' );
|
36 |
+
foreach ( $templates as $template ) {
|
37 |
+
$selected = $setting === $template['slug'] ? ' selected="selected"' : '';
|
38 |
+
echo '<option value="' . esc_attr( $template['slug'] ) . '"' . esc_attr( $selected ) . '>' . esc_html( $template['name'] ) . '</option>';
|
39 |
+
}
|
40 |
+
?>
|
41 |
+
</select>
|
42 |
+
<p class="description" id="tagline-default_recipe_template">
|
43 |
+
<?php esc_html_e( 'The default template to use for recipes on your website.', 'wp-recipe-maker' ); ?>
|
44 |
+
</p>
|
45 |
+
</td>
|
46 |
+
</tr>
|
47 |
+
<tr>
|
48 |
+
<th scope="row">
|
49 |
+
<label for="default_print_template"><?php esc_html_e( 'Default Print Template', 'wp-recipe-maker' ); ?></label>
|
50 |
+
</th>
|
51 |
+
<td>
|
52 |
+
<select id="default_print_template" name="default_print_template">
|
53 |
+
<?php
|
54 |
+
$setting = WPRM_Settings::get( 'default_print_template' );
|
55 |
+
foreach ( $templates as $template ) {
|
56 |
+
$selected = $setting === $template['slug'] ? ' selected="selected"' : '';
|
57 |
+
echo '<option value="' . esc_attr( $template['slug'] ) . '"' . esc_attr( $selected ) . '>' . esc_html( $template['name'] ) . '</option>';
|
58 |
+
}
|
59 |
+
?>
|
60 |
+
</select>
|
61 |
+
<p class="description" id="tagline-default_print_template">
|
62 |
+
<?php esc_html_e( 'The default template to use when printing a recipe.', 'wp-recipe-maker' ); ?>
|
63 |
+
</p>
|
64 |
+
</td>
|
65 |
+
</tr>
|
66 |
+
<tr>
|
67 |
+
<td colspan="2" class="template-preview-container">
|
68 |
+
<?php
|
69 |
+
foreach ( $templates as $template ) {
|
70 |
+
echo '<div class="template-preview">';
|
71 |
+
echo '<div class="template-name">' . esc_html( $template['name'] ) . '</div>';
|
72 |
+
if ( $template['screenshot'] ) {
|
73 |
+
$image_url = $template['url'] . '/' . $template['slug'] . '.' . $template['screenshot'];
|
74 |
+
echo '<img src="' . esc_url( $image_url ) . '" class="template-screenshot" width="250" />';
|
75 |
+
} else {
|
76 |
+
echo '<div class="template-no-screenshot">' . esc_html__( 'No Screenshot', 'wp-recipe-maker' ) . '</div>';
|
77 |
+
}
|
78 |
+
echo '</div>';
|
79 |
+
}
|
80 |
+
?>
|
81 |
+
</td>
|
82 |
+
</tr>
|
83 |
+
</tbody>
|
84 |
+
</table>
|
85 |
+
<?php submit_button( __( 'Save Changes', 'wp-recipe-maker' ) ); ?>
|
86 |
+
</form>
|
87 |
+
</div>
|
templates/recipe/clean-print-with-image/clean-print-with-image.jpg
ADDED
Binary file
|
templates/recipe/clean-print-with-image/clean-print-with-image.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.wprm-recipe-clean-print{font-size:0.9em}.wprm-recipe-clean-print .wprm-recipe-image{float:left;margin:0 15px 15px 0}.wprm-recipe-clean-print h2.wprm-recipe-name,.wprm-recipe-clean-print h3.wprm-recipe-header,.wprm-recipe-clean-print h4.wprm-recipe-group-name{font-variant:normal;text-transform:none;letter-spacing:normal;margin:0}.wprm-recipe-clean-print h2.wprm-recipe-name{clear:none;font-size:1.8em}.wprm-recipe-clean-print .wprm-recipe-details-container,.wprm-recipe-clean-print .wprm-recipe-summary{margin-bottom:15px}.wprm-recipe-clean-print .wprm-recipe-details-name{display:inline-block;font-weight:bold;min-width:130px}.wprm-recipe-clean-print .wprm-recipe-details-unit{font-size:0.8em}.wprm-recipe-clean-print h3.wprm-recipe-header{margin-top:10px;font-size:1.2em}.wprm-recipe-clean-print ol,.wprm-recipe-clean-print ul{margin:0 0 8px}.wprm-recipe-clean-print ol li,.wprm-recipe-clean-print ul li{margin:0 0 0 32px}.wprm-recipe-clean-print h4.wprm-recipe-group-name{margin-top:5px !important;font-weight:300;font-size:1em}.wprm-recipe-clean-print .wprm-recipe-ingredient-notes{color:#999999}.wprm-recipe-clean-print .wprm-recipe-instructions .wprm-recipe-instruction{margin-bottom:5px}.wprm-recipe-clean-print .wprm-recipe-instruction-text p{margin:0 0 5px}.wprm-recipe-clean-print .wprm-recipe-instruction-text p:last-of-type{margin-bottom:0}
|
templates/recipe/clean-print-with-image/clean-print-with-image.php
ADDED
@@ -0,0 +1,143 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Clean print recipe template.
|
4 |
+
*
|
5 |
+
* @link http://bootstrapped.ventures
|
6 |
+
* @since 1.0.0
|
7 |
+
*
|
8 |
+
* @package WP_Recipe_Maker
|
9 |
+
* @subpackage WP_Recipe_Maker/templates/recipe/clean-print
|
10 |
+
*/
|
11 |
+
|
12 |
+
// @codingStandardsIgnoreStart
|
13 |
+
?>
|
14 |
+
<div class="wprm-recipe wprm-recipe-clean-print">
|
15 |
+
<div class="wprm-recipe-image"><?php echo $recipe->image(); ?></div>
|
16 |
+
<h2 class="wprm-recipe-name"><?php echo $recipe->name(); ?></h2>
|
17 |
+
<div class="wprm-recipe-summary">
|
18 |
+
<?php echo $recipe->summary(); ?>
|
19 |
+
</div>
|
20 |
+
<div class="wprm-recipe-details-container wprm-recipe-tags-container">
|
21 |
+
<?php
|
22 |
+
$courses = $recipe->tags( 'course' );
|
23 |
+
if ( count( $courses ) > 0 ) : ?>
|
24 |
+
<div class="wprm-recipe-course-container">
|
25 |
+
<span class="wprm-recipe-details-name wprm-recipe-course-name"><?php _e( 'Course', 'wp-recipe-maker' ); ?></span>
|
26 |
+
<span class="wprm-recipe-course">
|
27 |
+
<?php foreach ( $courses as $index => $course ) {
|
28 |
+
if ( 0 !== $index ) {
|
29 |
+
echo ', ';
|
30 |
+
}
|
31 |
+
echo $course->name;
|
32 |
+
} ?>
|
33 |
+
</span>
|
34 |
+
</div>
|
35 |
+
<?php endif; // Course. ?>
|
36 |
+
<?php
|
37 |
+
$cuisines = $recipe->tags( 'cuisine' );
|
38 |
+
if ( count( $recipe->tags( 'cuisine' ) ) > 0 ) : ?>
|
39 |
+
<div class="wprm-recipe-cuisine-container">
|
40 |
+
<span class="wprm-recipe-details-name wprm-recipe-cuisine-name"><?php _e( 'Cuisine', 'wp-recipe-maker' ); ?></span>
|
41 |
+
<span class="wprm-recipe-details wprm-recipe-cuisine">
|
42 |
+
<?php foreach ( $cuisines as $index => $cuisine ) {
|
43 |
+
if ( 0 !== $index ) {
|
44 |
+
echo ', ';
|
45 |
+
}
|
46 |
+
echo $cuisine->name;
|
47 |
+
} ?>
|
48 |
+
</span>
|
49 |
+
</div>
|
50 |
+
<?php endif; // Cuisine. ?>
|
51 |
+
</div>
|
52 |
+
<div class="wprm-recipe-details-container wprm-recipe-times-container">
|
53 |
+
<?php if ( $recipe->prep_time() ) : ?>
|
54 |
+
<div class="wprm-recipe-prep-time-container">
|
55 |
+
<span class="wprm-recipe-details-name wprm-recipe-prep-time-name"><?php _e( 'Prep Time', 'wp-recipe-maker' ); ?></span> <span class="wprm-recipe-details wprm-recipe-prep-time"><?php echo $recipe->prep_time(); ?></span> <span class="wprm-recipe-details-unit wprm-recipe-prep-time-unit"><?php _e( 'minutes', 'wp-recipe-maker' ); ?></span>
|
56 |
+
</div>
|
57 |
+
<?php endif; // Prep time. ?>
|
58 |
+
<?php if ( $recipe->cook_time() ) : ?>
|
59 |
+
<div class="wprm-recipe-cook-time-container">
|
60 |
+
<span class="wprm-recipe-details-name wprm-recipe-cook-time-name"><?php _e( 'Cook Time', 'wp-recipe-maker' ); ?></span> <span class="wprm-recipe-details wprm-recipe-cook-time"><?php echo $recipe->cook_time(); ?></span> <span class="wprm-recipe-details-unit wprm-recipe-cook-time-unit"><?php _e( 'minutes', 'wp-recipe-maker' ); ?></span>
|
61 |
+
</div>
|
62 |
+
<?php endif; // Cook time. ?>
|
63 |
+
<?php if ( $recipe->total_time() ) : ?>
|
64 |
+
<div class="wprm-recipe-total-time-container">
|
65 |
+
<span class="wprm-recipe-details-name wprm-recipe-total-time-name"><?php _e( 'Total Time', 'wp-recipe-maker' ); ?></span> <span class="wprm-recipe-details wprm-recipe-total-time"><?php echo $recipe->total_time(); ?></span> <span class="wprm-recipe-details-unit wprm-recipe-total-time-unit"><?php _e( 'minutes', 'wp-recipe-maker' ); ?></span>
|
66 |
+
</div>
|
67 |
+
<?php endif; // Total time. ?>
|
68 |
+
</div>
|
69 |
+
<div class="wprm-recipe-details-container">
|
70 |
+
<?php if ( $recipe->servings() ) : ?>
|
71 |
+
<div class="wprm-recipe-servings-container">
|
72 |
+
<span class="wprm-recipe-details-name wprm-recipe-servings-name"><?php _e( 'Servings', 'wp-recipe-maker' ); ?></span> <span class="wprm-recipe-details wprm-recipe-servings"><?php echo $recipe->servings(); ?></span> <span class="wprm-recipe-details-unit wprm-recipe-servings-unit"><?php echo $recipe->servings_unit(); ?></span>
|
73 |
+
</div>
|
74 |
+
<?php endif; // Servings. ?>
|
75 |
+
<?php if ( $recipe->calories() ) : ?>
|
76 |
+
<div class="wprm-recipe-calories-container">
|
77 |
+
<span class="wprm-recipe-details-name wprm-recipe-calories-name"><?php _e( 'Calories', 'wp-recipe-maker' ); ?></span> <span class="wprm-recipe-details wprm-recipe-calories"><?php echo $recipe->calories(); ?></span> <span class="wprm-recipe-details-unit wprm-recipe-calories-unit"><?php _e( 'kcal', 'wp-recipe-maker' ); ?></span>
|
78 |
+
</div>
|
79 |
+
<?php endif; // Calories. ?>
|
80 |
+
</div>
|
81 |
+
|
82 |
+
<?php
|
83 |
+
$ingredients = $recipe->ingredients();
|
84 |
+
if ( count( $ingredients ) > 0 ) : ?>
|
85 |
+
<div class="wprm-recipe-ingredients-container">
|
86 |
+
<h3 class="wprm-recipe-header"><?php _e( 'Ingredients', 'wp-recipe-maker' ); ?></h3>
|
87 |
+
<?php foreach ( $ingredients as $ingredient_group ) : ?>
|
88 |
+
<div class="wprm-recipe-ingredient-group">
|
89 |
+
<?php if ( $ingredient_group['name'] ) : ?>
|
90 |
+
<h4 class="wprm-recipe-group-name wprm-recipe-ingredient-group-name"><?php echo $ingredient_group['name']; ?></h4>
|
91 |
+
<?php endif; // Ingredient group name. ?>
|
92 |
+
<ul class="wprm-recipe-ingredients">
|
93 |
+
<?php foreach ( $ingredient_group['ingredients'] as $ingredient ) : ?>
|
94 |
+
<li class="wprm-recipe-ingredient">
|
95 |
+
<?php if ( $ingredient['amount'] ) : ?>
|
96 |
+
<span class="wprm-recipe-ingredient-amount"><?php echo $ingredient['amount']; ?></span>
|
97 |
+
<?php endif; // Ingredient amount. ?>
|
98 |
+
<?php if ( $ingredient['unit'] ) : ?>
|
99 |
+
<span class="wprm-recipe-ingredient-unit"><?php echo $ingredient['unit']; ?></span>
|
100 |
+
<?php endif; // Ingredient unit. ?>
|
101 |
+
<?php if ( $ingredient['name'] ) : ?>
|
102 |
+
<span class="wprm-recipe-ingredient-name"><?php echo $ingredient['name']; ?></span>
|
103 |
+
<?php endif; // Ingredient name. ?>
|
104 |
+
<?php if ( $ingredient['notes'] ) : ?>
|
105 |
+
<span class="wprm-recipe-ingredient-notes"><?php echo $ingredient['notes']; ?></span>
|
106 |
+
<?php endif; // Ingredient notes. ?>
|
107 |
+
</li>
|
108 |
+
<?php endforeach; // Ingredients. ?>
|
109 |
+
</ul>
|
110 |
+
</div>
|
111 |
+
<?php endforeach; // Ingredient groups. ?>
|
112 |
+
</div>
|
113 |
+
<?php endif; // Ingredients. ?>
|
114 |
+
<?php
|
115 |
+
$instructions = $recipe->instructions();
|
116 |
+
if ( count( $instructions ) > 0 ) : ?>
|
117 |
+
<div class="wprm-recipe-instructions-container">
|
118 |
+
<h3 class="wprm-recipe-header"><?php _e( 'Instructions', 'wp-recipe-maker' ); ?></h3>
|
119 |
+
<?php foreach ( $instructions as $instruction_group ) : ?>
|
120 |
+
<div class="wprm-recipe-instruction-group">
|
121 |
+
<?php if ( $instruction_group['name'] ) : ?>
|
122 |
+
<h4 class="wprm-recipe-group-name wprm-recipe-instruction-group-name"><?php echo $instruction_group['name']; ?></h4>
|
123 |
+
<?php endif; // Instruction group name. ?>
|
124 |
+
<ol class="wprm-recipe-instructions">
|
125 |
+
<?php foreach ( $instruction_group['instructions'] as $instruction ) : ?>
|
126 |
+
<li class="wprm-recipe-instruction">
|
127 |
+
<?php if ( $instruction['text'] ) : ?>
|
128 |
+
<div class="wprm-recipe-instruction-text"><?php echo $instruction['text']; ?></div>
|
129 |
+
<?php endif; // Instruction text. ?>
|
130 |
+
</li>
|
131 |
+
<?php endforeach; // Instructions. ?>
|
132 |
+
</ol>
|
133 |
+
</div>
|
134 |
+
<?php endforeach; // Instruction groups. ?>
|
135 |
+
</div>
|
136 |
+
<?php endif; // Instructions. ?>
|
137 |
+
<?php if ( $recipe->notes() ) : ?>
|
138 |
+
<div class="wprm-recipe-notes-container">
|
139 |
+
<h3 class="wprm-recipe-header"><?php _e( 'Recipe Notes', 'wp-recipe-maker' ); ?></h3>
|
140 |
+
<?php echo $recipe->notes(); ?>
|
141 |
+
</div>
|
142 |
+
<?php endif; // Notes ?>
|
143 |
+
</div>
|
templates/recipe/clean-print-with-image/clean-print-with-image.scss
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wprm-recipe-clean-print {
|
2 |
+
font-size: 0.9em;
|
3 |
+
|
4 |
+
.wprm-recipe-image {
|
5 |
+
float: left;
|
6 |
+
margin: 0 15px 15px 0;
|
7 |
+
}
|
8 |
+
|
9 |
+
h2.wprm-recipe-name,
|
10 |
+
h3.wprm-recipe-header,
|
11 |
+
h4.wprm-recipe-group-name {
|
12 |
+
font-variant: normal;
|
13 |
+
text-transform: none;
|
14 |
+
letter-spacing: normal;
|
15 |
+
margin: 0;
|
16 |
+
}
|
17 |
+
|
18 |
+
h2.wprm-recipe-name {
|
19 |
+
clear: none;
|
20 |
+
font-size: 1.8em;
|
21 |
+
}
|
22 |
+
|
23 |
+
.wprm-recipe-details-container,
|
24 |
+
.wprm-recipe-summary {
|
25 |
+
margin-bottom: 15px;
|
26 |
+
}
|
27 |
+
|
28 |
+
.wprm-recipe-details-name {
|
29 |
+
display: inline-block;
|
30 |
+
font-weight: bold;
|
31 |
+
min-width: 130px;
|
32 |
+
}
|
33 |
+
|
34 |
+
.wprm-recipe-details-unit {
|
35 |
+
font-size: 0.8em;
|
36 |
+
}
|
37 |
+
|
38 |
+
h3.wprm-recipe-header {
|
39 |
+
margin-top: 10px;
|
40 |
+
font-size: 1.2em;
|
41 |
+
}
|
42 |
+
|
43 |
+
ol,
|
44 |
+
ul {
|
45 |
+
margin: 0 0 8px;
|
46 |
+
|
47 |
+
li {
|
48 |
+
margin: 0 0 0 32px;
|
49 |
+
}
|
50 |
+
}
|
51 |
+
|
52 |
+
h4.wprm-recipe-group-name {
|
53 |
+
margin-top: 5px !important;
|
54 |
+
font-weight: 300;
|
55 |
+
font-size: 1em;
|
56 |
+
}
|
57 |
+
|
58 |
+
.wprm-recipe-ingredient-notes {
|
59 |
+
color: #999999;
|
60 |
+
}
|
61 |
+
|
62 |
+
.wprm-recipe-instructions {
|
63 |
+
.wprm-recipe-instruction {
|
64 |
+
margin-bottom: 5px;
|
65 |
+
}
|
66 |
+
}
|
67 |
+
|
68 |
+
.wprm-recipe-instruction-text {
|
69 |
+
p {
|
70 |
+
margin: 0 0 5px;
|
71 |
+
}
|
72 |
+
|
73 |
+
p:last-of-type {
|
74 |
+
margin-bottom: 0;
|
75 |
+
}
|
76 |
+
}
|
77 |
+
}
|
templates/recipe/clean-print/clean-print.jpg
ADDED
Binary file
|
templates/recipe/simple/simple.jpg
ADDED
Binary file
|
templates/recipe/simple/simple.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.wprm-recipe-simple{border-top:1px solid #aaaaaa;background-color:#fafafa;padding:10px;margin:20px 0;font-size:0.9em}.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}.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:0.8em}.wprm-recipe-simple .wprm-recipe-image-container .wprm-recipe-print{font-size:0.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:bold;min-width:130px}.wprm-recipe-simple .wprm-recipe-details-unit{font-size:0.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{color:#999999}.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}@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 #aaaaaa;background-color:#fafafa;padding:10px;margin:20px 0;font-size:0.9em}.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}.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:0.8em}.wprm-recipe-simple .wprm-recipe-image-container .wprm-recipe-print{font-size:0.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:bold;min-width:130px}.wprm-recipe-simple .wprm-recipe-details-unit{font-size:0.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{color:#999999}.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-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.scss
CHANGED
@@ -116,6 +116,11 @@
|
|
116 |
margin: 5px 0 15px;
|
117 |
}
|
118 |
}
|
|
|
|
|
|
|
|
|
|
|
119 |
@media only screen and (max-width: 640px) {
|
120 |
.wprm-recipe-simple {
|
121 |
.wprm-recipe-image-container {
|
116 |
margin: 5px 0 15px;
|
117 |
}
|
118 |
}
|
119 |
+
.wprm-print {
|
120 |
+
.wprm-recipe-print {
|
121 |
+
display: none;
|
122 |
+
}
|
123 |
+
}
|
124 |
@media only screen and (max-width: 640px) {
|
125 |
.wprm-recipe-simple {
|
126 |
.wprm-recipe-image-container {
|
templates/recipe/tastefully-simple/tastefully-simple.jpg
ADDED
Binary file
|
templates/recipe/tastefully-simple/tastefully-simple.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.wprm-recipe-container .wprm-recipe-tastefully-simple,.wprm-print .wprm-recipe-tastefully-simple{font:12px Verdana, Arial, Geneva, sans-serif;border:1px dashed #666;color:#666;padding:10px;background:#FFF}.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,.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{margin:0;padding:0;line-height:inherit}.wprm-recipe-container .wprm-recipe-tastefully-simple svg,.wprm-print .wprm-recipe-tastefully-simple svg{vertical-align:middle;width:16px;height:16px;margin:0}.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-clear-left,.wprm-print .wprm-recipe-tastefully-simple .wprm-clear-left{clear:left;line-height:0;height:0}.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-image-container,.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-image-container{float:right;max-width:40%;text-align:right}.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-image-container .wprm-recipe-rating,.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-image-container .wprm-recipe-rating{margin-bottom:5px}.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-image-container .wprm-recipe-rating svg path,.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-image-container .wprm-recipe-rating svg path{fill:#feb600}.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-image-container .wprm-recipe-rating svg polygon,.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-image-container .wprm-recipe-rating svg polygon{stroke:#feb600}.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-image-container .wprm-recipe-rating .wprm-recipe-rating-details,.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-image-container .wprm-recipe-rating .wprm-recipe-rating-details{font:10px "Trebuchet MS",Arial,Helvetica,sans-serif}.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-image-container .wprm-recipe-buttons,.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-image-container .wprm-recipe-buttons{margin-top:10px;text-align:center}.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-image-container .wprm-recipe-buttons .wprm-recipe-print,.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-image-container .wprm-recipe-buttons .wprm-recipe-print{color:#ffffff;background:#666666;font-size:11px;cursor:pointer;-webkit-border-radius:5px 5px 5px 5px;-moz-border-radius:5px 5px 5px 5px;border-radius:5px 5px 5px 5px;padding:0.4em 1em}.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-name,.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-name{font:150% Verdana, Geneva, sans-serif;margin-bottom:15px}.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-times-container,.wprm-print .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-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-times-container .wprm-recipe-time-container,.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-times-container .wprm-recipe-time-container{width:33%;text-align:center;float:left;font-weight:bold;border-left:1px solid #ccc}.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-times-container .wprm-recipe-time-container:first-child,.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-times-container .wprm-recipe-time-container:first-child{border-left:none}.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-times-container .wprm-recipe-time-container .wprm-recipe-time-header,.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-times-container .wprm-recipe-time-container .wprm-recipe-time-header{margin-bottom:4px}.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-times-container .wprm-recipe-time-container .wprm-recipe-time,.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-times-container .wprm-recipe-time-container .wprm-recipe-time{font-size:10px;font-weight:normal}.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-summary,.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-summary{margin-bottom:10px}.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-summary p,.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-summary p{margin-bottom:10px}.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-details-container,.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-ingredients-container,.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-details-container,.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-ingredients-container{margin-bottom:10px}.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-header,.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-header{font-size:1.4em;font-weight:700;margin-top:1em;margin-bottom:1em}.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-group-name,.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-group-name{margin-top:3px;margin-bottom:3px;font-weight:700}.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-ingredients li,.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-ingredients li{list-style:disc inside;margin-left:10px;line-height:inherit;background:0 0}.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-instructions li,.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-instructions li{list-style:decimal;margin-left:30px;line-height:inherit;background:0 0}.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-notes-container ul li,.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-notes-container ul li{list-style:disc inside;margin-left:10px}.wprm-recipe-container .wprm-recipe-tastefully-simple .wprm-recipe-notes-container ol li,.wprm-print .wprm-recipe-tastefully-simple .wprm-recipe-notes-container ol li{list-style:decimal;margin-left:30px}.wprm-print .wprm-recipe-print{display:none}@media only screen and (max-width: 480px){.wprm-recipe-tastefully-simple .wprm-recipe-image-container{float:none;width:100%;max-width:none}}
|
templates/recipe/tastefully-simple/tastefully-simple.php
ADDED
@@ -0,0 +1,181 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Tastefully simple recipe template.
|
4 |
+
*
|
5 |
+
* @link http://bootstrapped.ventures
|
6 |
+
* @since 1.0.0
|
7 |
+
*
|
8 |
+
* @package WP_Recipe_Maker
|
9 |
+
* @subpackage WP_Recipe_Maker/templates/recipe/tastfully-simple
|
10 |
+
*/
|
11 |
+
|
12 |
+
// @codingStandardsIgnoreStart
|
13 |
+
?>
|
14 |
+
<div class="wprm-recipe wprm-recipe-tastefully-simple" itemscope itemtype="http://schema.org/Recipe">
|
15 |
+
<meta itemprop="author" content="<?php echo $recipe->author(); ?>" />
|
16 |
+
<meta itemprop="datePublished" content="<?php echo $recipe->date(); ?>" />
|
17 |
+
<meta itemprop="image" content="<?php echo $recipe->image_url( 'full' ); ?>" />
|
18 |
+
<div class="wprm-recipe-image-container">
|
19 |
+
<?php
|
20 |
+
$rating = $recipe->rating();
|
21 |
+
if ( $rating['count'] > 0 ) :
|
22 |
+
?>
|
23 |
+
<div class="wprm-recipe-rating">
|
24 |
+
<?php
|
25 |
+
$rating_value = ceil ( $rating['average'] );
|
26 |
+
for ( $i = 1; $i <= 5; $i++ ) {
|
27 |
+
echo '<span class="wprm-rating-star">';
|
28 |
+
if ( $i <= $rating_value ) {
|
29 |
+
include( WPRM_DIR . 'assets/icons/star-full.svg' );
|
30 |
+
} else {
|
31 |
+
include( WPRM_DIR . 'assets/icons/star-empty.svg' );
|
32 |
+
}
|
33 |
+
echo '</span>';
|
34 |
+
}
|
35 |
+
?>
|
36 |
+
<div class="wprm-recipe-rating-details" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"><span itemprop="ratingValue"><?php echo esc_html( $rating['average'] ); ?></span> <?php esc_html_e( 'from', 'wp-recipe-maker' ); ?> <span itemprop="ratingCount"><?php echo esc_html( $rating['count'] ); ?></span> <?php echo esc_html( _n( 'vote', 'votes', $rating['count'], 'wp-recipe-maker' ) ); ?></div>
|
37 |
+
</div>
|
38 |
+
<?php endif; // Rating. ?>
|
39 |
+
<div class="wprm-recipe-image"><?php echo $recipe->image(); ?></div>
|
40 |
+
<div class="wprm-recipe-buttons">
|
41 |
+
<span class="wprm-recipe-print"><?php _e( 'Print', 'wp-recipe-maker' ); ?></span>
|
42 |
+
</div>
|
43 |
+
</div>
|
44 |
+
<div class="wprm-recipe-name" itemprop="name"><?php echo $recipe->name(); ?></div>
|
45 |
+
<?php if ( $recipe->prep_time() || $recipe->prep_time() || $recipe->prep_time() ) : ?>
|
46 |
+
<div class="wprm-recipe-times-container">
|
47 |
+
<?php if ( $recipe->prep_time() ) : ?>
|
48 |
+
<div class="wprm-recipe-time-container">
|
49 |
+
<meta itemprop="prepTime" content="PT<?php echo $recipe->prep_time(); ?>M" />
|
50 |
+
<div class="wprm-recipe-time-header"><?php _e( 'Prep Time', 'wp-recipe-maker' ); ?></div>
|
51 |
+
<div class="wprm-recipe-time"><?php echo $recipe->prep_time(); ?> <?php _e( 'mins', 'wp-recipe-maker' ); ?></div>
|
52 |
+
</div>
|
53 |
+
<?php endif; // Prep time. ?>
|
54 |
+
<?php if ( $recipe->cook_time() ) : ?>
|
55 |
+
<div class="wprm-recipe-time-container">
|
56 |
+
<meta itemprop="cookTime" content="PT<?php echo $recipe->cook_time(); ?>M" />
|
57 |
+
<div class="wprm-recipe-time-header"><?php _e( 'Cook Time', 'wp-recipe-maker' ); ?></div>
|
58 |
+
<div class="wprm-recipe-time"><?php echo $recipe->cook_time(); ?> <?php _e( 'mins', 'wp-recipe-maker' ); ?></div>
|
59 |
+
</div>
|
60 |
+
<?php endif; // Cook time. ?>
|
61 |
+
<?php if ( $recipe->total_time() ) : ?>
|
62 |
+
<div class="wprm-recipe-time-container">
|
63 |
+
<meta itemprop="totalTime" content="PT<?php echo $recipe->total_time(); ?>M" />
|
64 |
+
<div class="wprm-recipe-time-header"><?php _e( 'Total Time', 'wp-recipe-maker' ); ?></div>
|
65 |
+
<div class="wprm-recipe-time"><?php echo $recipe->total_time(); ?> <?php _e( 'mins', 'wp-recipe-maker' ); ?></div>
|
66 |
+
</div>
|
67 |
+
<?php endif; // Total time. ?>
|
68 |
+
<div class="wprm-clear-left"> </div>
|
69 |
+
</div>
|
70 |
+
<?php endif; // Recipe times. ?>
|
71 |
+
<div class="wprm-recipe-summary" itemprop="description">
|
72 |
+
<?php echo $recipe->summary(); ?>
|
73 |
+
</div>
|
74 |
+
<div class="wprm-recipe-details-container">
|
75 |
+
<?php
|
76 |
+
$courses = $recipe->tags( 'course' );
|
77 |
+
if ( count( $courses ) > 0 ) : ?>
|
78 |
+
<div class="wprm-recipe-course-container">
|
79 |
+
<span class="wprm-recipe-details-name wprm-recipe-course-name"><?php _e( 'Course', 'wp-recipe-maker' ); ?>:</span>
|
80 |
+
<span class="wprm-recipe-course" itemprop="recipeCategory">
|
81 |
+
<?php foreach ( $courses as $index => $course ) {
|
82 |
+
if ( 0 !== $index ) {
|
83 |
+
echo ', ';
|
84 |
+
}
|
85 |
+
echo $course->name;
|
86 |
+
} ?>
|
87 |
+
</span>
|
88 |
+
</div>
|
89 |
+
<?php endif; // Course. ?>
|
90 |
+
<?php
|
91 |
+
$cuisines = $recipe->tags( 'cuisine' );
|
92 |
+
if ( count( $recipe->tags( 'cuisine' ) ) > 0 ) : ?>
|
93 |
+
<div class="wprm-recipe-cuisine-container">
|
94 |
+
<span class="wprm-recipe-details-name wprm-recipe-cuisine-name"><?php _e( 'Cuisine', 'wp-recipe-maker' ); ?>:</span>
|
95 |
+
<span class="wprm-recipe-details wprm-recipe-cuisine" itemprop="recipeCuisine">
|
96 |
+
<?php foreach ( $cuisines as $index => $cuisine ) {
|
97 |
+
if ( 0 !== $index ) {
|
98 |
+
echo ', ';
|
99 |
+
}
|
100 |
+
echo $cuisine->name;
|
101 |
+
} ?>
|
102 |
+
</span>
|
103 |
+
</div>
|
104 |
+
<?php endif; // Cuisine. ?>
|
105 |
+
<?php if ( $recipe->servings() ) : ?>
|
106 |
+
<div class="wprm-recipe-servings-container">
|
107 |
+
<span class="wprm-recipe-details-name wprm-recipe-servings-name"><?php _e( 'Servings', 'wp-recipe-maker' ); ?></span>: <span itemprop="recipeYield"><span class="wprm-recipe-details wprm-recipe-servings"><?php echo $recipe->servings(); ?></span> <span class="wprm-recipe-details-unit wprm-recipe-servings-unit"><?php echo $recipe->servings_unit(); ?></span></span>
|
108 |
+
</div>
|
109 |
+
<?php endif; // Servings. ?>
|
110 |
+
<?php if ( $recipe->calories() ) : ?>
|
111 |
+
<div class="wprm-recipe-calories-container" itemprop="nutrition" itemscope itemtype="http://schema.org/NutritionInformation">
|
112 |
+
<span class="wprm-recipe-details-name wprm-recipe-calories-name"><?php _e( 'Calories', 'wp-recipe-maker' ); ?></span>: <span itemprop="calories"><span class="wprm-recipe-details wprm-recipe-calories"><?php echo $recipe->calories(); ?></span> <span class="wprm-recipe-details-unit wprm-recipe-calories-unit"><?php _e( 'kcal', 'wp-recipe-maker' ); ?></span></span>
|
113 |
+
</div>
|
114 |
+
<?php endif; // Calories. ?>
|
115 |
+
</div>
|
116 |
+
|
117 |
+
<?php
|
118 |
+
$ingredients = $recipe->ingredients();
|
119 |
+
if ( count( $ingredients ) > 0 ) : ?>
|
120 |
+
<div class="wprm-recipe-ingredients-container">
|
121 |
+
<div class="wprm-recipe-header"><?php _e( 'Ingredients', 'wp-recipe-maker' ); ?></div>
|
122 |
+
<?php foreach ( $ingredients as $ingredient_group ) : ?>
|
123 |
+
<div class="wprm-recipe-ingredient-group">
|
124 |
+
<?php if ( $ingredient_group['name'] ) : ?>
|
125 |
+
<div class="wprm-recipe-group-name wprm-recipe-ingredient-group-name"><?php echo $ingredient_group['name']; ?></div>
|
126 |
+
<?php endif; // Ingredient group name. ?>
|
127 |
+
<ul class="wprm-recipe-ingredients">
|
128 |
+
<?php foreach ( $ingredient_group['ingredients'] as $ingredient ) : ?>
|
129 |
+
<li class="wprm-recipe-ingredient" itemprop="recipeIngredient">
|
130 |
+
<?php if ( $ingredient['amount'] ) : ?>
|
131 |
+
<span class="wprm-recipe-ingredient-amount"><?php echo $ingredient['amount']; ?></span>
|
132 |
+
<?php endif; // Ingredient amount. ?>
|
133 |
+
<?php if ( $ingredient['unit'] ) : ?>
|
134 |
+
<span class="wprm-recipe-ingredient-unit"><?php echo $ingredient['unit']; ?></span>
|
135 |
+
<?php endif; // Ingredient unit. ?>
|
136 |
+
<?php if ( $ingredient['name'] ) : ?>
|
137 |
+
<span class="wprm-recipe-ingredient-name"><?php echo $ingredient['name']; ?></span>
|
138 |
+
<?php endif; // Ingredient name. ?>
|
139 |
+
<?php if ( $ingredient['notes'] ) : ?>
|
140 |
+
<span class="wprm-recipe-ingredient-notes"><?php echo $ingredient['notes']; ?></span>
|
141 |
+
<?php endif; // Ingredient notes. ?>
|
142 |
+
</li>
|
143 |
+
<?php endforeach; // Ingredients. ?>
|
144 |
+
</ul>
|
145 |
+
</div>
|
146 |
+
<?php endforeach; // Ingredient groups. ?>
|
147 |
+
</div>
|
148 |
+
<?php endif; // Ingredients. ?>
|
149 |
+
<?php
|
150 |
+
$instructions = $recipe->instructions();
|
151 |
+
if ( count( $instructions ) > 0 ) : ?>
|
152 |
+
<div class="wprm-recipe-instructions-container">
|
153 |
+
<div class="wprm-recipe-header"><?php _e( 'Instructions', 'wp-recipe-maker' ); ?></div>
|
154 |
+
<?php foreach ( $instructions as $instruction_group ) : ?>
|
155 |
+
<div class="wprm-recipe-instruction-group">
|
156 |
+
<?php if ( $instruction_group['name'] ) : ?>
|
157 |
+
<div class="wprm-recipe-group-name wprm-recipe-instruction-group-name"><?php echo $instruction_group['name']; ?></div>
|
158 |
+
<?php endif; // Instruction group name. ?>
|
159 |
+
<ol class="wprm-recipe-instructions">
|
160 |
+
<?php foreach ( $instruction_group['instructions'] as $instruction ) : ?>
|
161 |
+
<li class="wprm-recipe-instruction">
|
162 |
+
<?php if ( $instruction['text'] ) : ?>
|
163 |
+
<div class="wprm-recipe-instruction-text" itemprop="recipeInstructions"><?php echo $instruction['text']; ?></div>
|
164 |
+
<?php endif; // Instruction text. ?>
|
165 |
+
<?php if ( $instruction['image'] ) : ?>
|
166 |
+
<div class="wprm-recipe-instruction-image"><?php echo wp_get_attachment_image( $instruction['image'], 'thumbnail' ); ?></div>
|
167 |
+
<?php endif; // Instruction image. ?>
|
168 |
+
</li>
|
169 |
+
<?php endforeach; // Instructions. ?>
|
170 |
+
</ol>
|
171 |
+
</div>
|
172 |
+
<?php endforeach; // Instruction groups. ?>
|
173 |
+
</div>
|
174 |
+
<?php endif; // Instructions. ?>
|
175 |
+
<?php if ( $recipe->notes() ) : ?>
|
176 |
+
<div class="wprm-recipe-notes-container">
|
177 |
+
<div class="wprm-recipe-header"><?php _e( 'Recipe Notes', 'wp-recipe-maker' ); ?></div>
|
178 |
+
<?php echo $recipe->notes(); ?>
|
179 |
+
</div>
|
180 |
+
<?php endif; // Notes ?>
|
181 |
+
</div>
|
templates/recipe/tastefully-simple/tastefully-simple.scss
ADDED
@@ -0,0 +1,174 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.wprm-recipe-container .wprm-recipe-tastefully-simple,
|
2 |
+
.wprm-print .wprm-recipe-tastefully-simple {
|
3 |
+
font: 12px Verdana, Arial, Geneva, sans-serif;
|
4 |
+
border: 1px dashed #666;
|
5 |
+
color: #666;
|
6 |
+
padding: 10px;
|
7 |
+
background: #FFF;
|
8 |
+
|
9 |
+
div,
|
10 |
+
li,
|
11 |
+
ol,
|
12 |
+
p,
|
13 |
+
span,
|
14 |
+
ul {
|
15 |
+
margin: 0;
|
16 |
+
padding: 0;
|
17 |
+
line-height: inherit;
|
18 |
+
}
|
19 |
+
|
20 |
+
svg {
|
21 |
+
vertical-align: middle;
|
22 |
+
width: 16px;
|
23 |
+
height: 16px;
|
24 |
+
margin: 0;
|
25 |
+
}
|
26 |
+
|
27 |
+
.wprm-clear-left {
|
28 |
+
clear: left;
|
29 |
+
line-height: 0;
|
30 |
+
height: 0;
|
31 |
+
}
|
32 |
+
|
33 |
+
.wprm-recipe-image-container {
|
34 |
+
float: right;
|
35 |
+
max-width: 40%;
|
36 |
+
text-align: right;
|
37 |
+
|
38 |
+
.wprm-recipe-rating {
|
39 |
+
margin-bottom: 5px;
|
40 |
+
|
41 |
+
svg path {
|
42 |
+
fill: #feb600;
|
43 |
+
}
|
44 |
+
|
45 |
+
svg polygon {
|
46 |
+
stroke: #feb600;
|
47 |
+
}
|
48 |
+
|
49 |
+
.wprm-recipe-rating-details {
|
50 |
+
font: 10px "Trebuchet MS",Arial,Helvetica,sans-serif;
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
54 |
+
.wprm-recipe-buttons {
|
55 |
+
margin-top: 10px;
|
56 |
+
text-align: center;
|
57 |
+
|
58 |
+
.wprm-recipe-print {
|
59 |
+
color: #ffffff;
|
60 |
+
background: #666666;
|
61 |
+
font-size: 11px;
|
62 |
+
cursor: pointer;
|
63 |
+
-webkit-border-radius: 5px 5px 5px 5px;
|
64 |
+
-moz-border-radius: 5px 5px 5px 5px;
|
65 |
+
border-radius: 5px 5px 5px 5px;
|
66 |
+
padding: 0.4em 1em;
|
67 |
+
}
|
68 |
+
}
|
69 |
+
}
|
70 |
+
|
71 |
+
.wprm-recipe-name {
|
72 |
+
font: 150% Verdana, Geneva, sans-serif;
|
73 |
+
margin-bottom: 15px;
|
74 |
+
}
|
75 |
+
|
76 |
+
.wprm-recipe-times-container {
|
77 |
+
border-top: 1px dotted #666;
|
78 |
+
border-bottom: 1px dotted #666;
|
79 |
+
width: 60%;
|
80 |
+
padding-top: 5px;
|
81 |
+
padding-bottom: 5px;
|
82 |
+
margin-bottom: 10px;
|
83 |
+
|
84 |
+
.wprm-recipe-time-container {
|
85 |
+
width: 33%;
|
86 |
+
text-align: center;
|
87 |
+
float: left;
|
88 |
+
font-weight: bold;
|
89 |
+
border-left: 1px solid #ccc;
|
90 |
+
|
91 |
+
&:first-child {
|
92 |
+
border-left: none;
|
93 |
+
}
|
94 |
+
|
95 |
+
.wprm-recipe-time-header {
|
96 |
+
margin-bottom: 4px;
|
97 |
+
}
|
98 |
+
|
99 |
+
.wprm-recipe-time {
|
100 |
+
font-size: 10px;
|
101 |
+
font-weight: normal;
|
102 |
+
}
|
103 |
+
}
|
104 |
+
}
|
105 |
+
|
106 |
+
.wprm-recipe-summary {
|
107 |
+
margin-bottom: 10px;
|
108 |
+
|
109 |
+
p {
|
110 |
+
margin-bottom: 10px;
|
111 |
+
}
|
112 |
+
}
|
113 |
+
|
114 |
+
.wprm-recipe-details-container,
|
115 |
+
.wprm-recipe-ingredients-container {
|
116 |
+
margin-bottom: 10px;
|
117 |
+
}
|
118 |
+
|
119 |
+
.wprm-recipe-header {
|
120 |
+
font-size: 1.4em;
|
121 |
+
font-weight: 700;
|
122 |
+
margin-top: 1em;
|
123 |
+
margin-bottom: 1em;
|
124 |
+
}
|
125 |
+
|
126 |
+
.wprm-recipe-group-name {
|
127 |
+
margin-top: 3px;
|
128 |
+
margin-bottom: 3px;
|
129 |
+
font-weight: 700;
|
130 |
+
}
|
131 |
+
|
132 |
+
.wprm-recipe-ingredients {
|
133 |
+
li {
|
134 |
+
list-style: disc inside;
|
135 |
+
margin-left: 10px;
|
136 |
+
line-height: inherit;
|
137 |
+
background: 0 0;
|
138 |
+
}
|
139 |
+
}
|
140 |
+
|
141 |
+
.wprm-recipe-instructions {
|
142 |
+
li {
|
143 |
+
list-style: decimal;
|
144 |
+
margin-left: 30px;
|
145 |
+
line-height: inherit;
|
146 |
+
background: 0 0;
|
147 |
+
}
|
148 |
+
}
|
149 |
+
|
150 |
+
.wprm-recipe-notes-container {
|
151 |
+
ul li {
|
152 |
+
list-style: disc inside;
|
153 |
+
margin-left: 10px;
|
154 |
+
}
|
155 |
+
ol li {
|
156 |
+
list-style: decimal;
|
157 |
+
margin-left: 30px;
|
158 |
+
}
|
159 |
+
}
|
160 |
+
}
|
161 |
+
.wprm-print {
|
162 |
+
.wprm-recipe-print {
|
163 |
+
display: none;
|
164 |
+
}
|
165 |
+
}
|
166 |
+
@media only screen and (max-width: 480px) {
|
167 |
+
.wprm-recipe-tastefully-simple {
|
168 |
+
.wprm-recipe-image-container {
|
169 |
+
float: none;
|
170 |
+
width: 100%;
|
171 |
+
max-width: none;
|
172 |
+
}
|
173 |
+
}
|
174 |
+
}
|
wp-recipe-maker.php
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* Plugin Name: WP Recipe Maker
|
16 |
* Plugin URI: http://bootstrapped.ventures/
|
17 |
* Description: The easy and user-friendly recipe plugin for everyone. Automatic JSON-LD metadata for better SEO will get you more visitors!
|
18 |
-
* Version: 1.
|
19 |
* Author: Bootstrapped Ventures
|
20 |
* Author URI: http://bootstrapped.ventures/
|
21 |
* License: GPL-2.0+
|
15 |
* Plugin Name: WP Recipe Maker
|
16 |
* Plugin URI: http://bootstrapped.ventures/
|
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.2.0
|
19 |
* Author: Bootstrapped Ventures
|
20 |
* Author URI: http://bootstrapped.ventures/
|
21 |
* License: GPL-2.0+
|