import React from 'react'; import PropTypes from 'prop-types'; import { Element } from 'react-scroll'; const SettingUnitConversionUnits = (props) => { const units = props.value; const onChange = (unit, field, value) => { let newUnit = props.value[unit]; newUnit[field] = value; let newUnits = props.value; newUnits[unit] = newUnit; props.onValueChange(newUnits); }; return ( { Object.keys(units).map((unit, index) => ) }
  Aliases Singular Plural
{ units[unit].label } onChange(unit, 'aliases', e.target.value)} /> onChange(unit, 'singular', e.target.value)} /> onChange(unit, 'plural', e.target.value)} />
); } SettingUnitConversionUnits.propTypes = { setting: PropTypes.object.isRequired, value: PropTypes.any.isRequired, onValueChange: PropTypes.func.isRequired, } export default SettingUnitConversionUnits;import React, { Fragment, useState } from 'react'; import { Element, Link } from 'react-scroll'; import CopyToClipboard from 'react-copy-to-clipboard'; import Header from '../../general/Header'; import Footer from '../../general/Footer'; import Loader from 'Shared/Loader'; import { __wprm } from 'Shared/Translations'; import Api from 'Shared/Api'; import Icon from 'Shared/Icon'; import FieldGroup from '../../fields/FieldGroup'; import RecipeImport from './RecipeImport'; import RecipeMedia from './RecipeMedia'; import RecipePostType from './RecipePostType'; import RecipeGeneral from './RecipeGeneral'; import RecipeTimes from './RecipeTimes'; import RecipeCategories from './RecipeCategories'; import RecipeIngredients from './RecipeIngredients'; import RecipeEquipment from './RecipeEquipment'; import RecipeInstructions from './RecipeInstructions'; import RecipeNutrition from './RecipeNutrition'; import RecipeCustomFields from './RecipeCustomFields'; import RecipeNotes from './RecipeNotes'; const EditRecipe = (props) => { const hasUpload = props.recipe.video_id > 0; const hasEmbed = ! hasUpload && ( -1 == props.recipe.video_id || props.recipe.video_embed ); const hasVideo = hasUpload || hasEmbed; const [nutritionWarning, setNutritionWarning] = useState(false); let structure = [ { id: 'import', name: __wprm( 'Import' ), elem: ( ) }, { id: 'media', name: __wprm( 'Media' ), elem: ( ) } ]; if ( 'public' === wprm_admin.settings.post_type_structure || 'manual' === wprm_admin.settings.recipe_use_author ) { structure.push({ id: 'postType', name: __wprm( 'Post Type' ), elem: ( ) }); } structure.push({ id: 'general', name: __wprm( 'General' ), elem: ( ) }); structure.push({ id: 'times', name: __wprm( 'Times' ), elem: ( ) }); structure.push({ id: 'categories', name: __wprm( 'Categories' ), elem: ( ) }); structure.push({ id: 'equipment', name: __wprm( 'Equipment' ), elem: ( ) }); structure.push({ id: 'ingredients', name: 'howto' === props.recipe.type ? __wprm( 'Materials' ) : __wprm( 'Ingredients' ), elem: ( ) }); structure.push({ id: 'instructions', name: __wprm( 'Instructions' ), elem: ( ) }); // Only show nutrition for food recipes. if ( 'howto' !== props.recipe.type ) { let nutritionName = __wprm( 'Nutrition' ); let nutritionClassName = 'wprm-admin-modal-recipe-quicklink'; if ( nutritionWarning ) { nutritionClassName += ' wprm-admin-modal-recipe-quicklink-warning'; nutritionName = ( { __wprm( 'Nutrition' ) } ); } structure.push({ id: 'nutrition', name: nutritionName, className: nutritionClassName, elem: ( ) }); } // Only show custom fields when available and at least 1 is set. if ( wprm_admin_modal.custom_fields && wprm_admin_modal.custom_fields.fields && 0 < Object.keys( wprm_admin_modal.custom_fields.fields ).length ) { structure.push({ id: 'custom-fields', name: __wprm( 'Custom Fields' ), elem: ( { let newFields = Object.assign({}, JSON.parse( JSON.stringify( props.recipe.custom_fields ) ) ); newFields[ field ] = value; props.onRecipeChange({ custom_fields: newFields, }); }} /> ) }); } structure.push({ id: 'notes', name: __wprm( 'Notes' ), elem: ( ) }); return (
{ props.loadingRecipe ? __wprm( 'Loading Recipe...' ) : { props.recipe.id ? `${ __wprm( 'Editing Recipe' ) } #${props.recipe.id}${props.recipe.name ? ` - ${props.recipe.name}` : ''}` : `${ __wprm( 'Creating new Recipe' ) }${props.recipe.name ? ` - ${props.recipe.name}` : ''}` } }
{ structure.map((group, index) => ( { group.name } )) }
{ props.loadingRecipe ? :
{ structure.map((group, index) => ( { group.elem } )) }
}
{ 'waiting' === props.saveResult ? :
{ 'failed' === props.saveResult && { if ( result ) { alert( __wprm( 'The recipe has been copied and can be used in the "Import from JSON" feature.' ) ); } else { alert( __wprm( 'Something went wrong. Please contact support.' ) ); } }} > { e.preventDefault(); } }> { __wprm( 'Something went wrong during saving.' ) } { __wprm( 'Click to copy the recipe to your clipboard.' ) } } { 'ok' === props.saveResult ? { __wprm( 'Saved successfully' ) } : null }
}
); } export default EditRecipe;const conversionEndpoint = wprmp_admin.endpoints.unit_conversion; import ApiWrapper from 'Shared/ApiWrapper'; export default { get( ingredients, system = 'default' ) { const data = { ingredients, system, }; return ApiWrapper.call( `${conversionEndpoint}`, 'POST', data ); }, };
/** * WordPress dependencies */ import { Path, SVG } from '@wordpress/components'; export default ( ); jQuery(function(e){if("undefined"==typeof wc_orders_params)return!1;var t=function(){e(document).on("click",".post-type-shop_order .wp-list-table tbody td, .woocommerce_page_wc-orders .wp-list-table.orders tbody td",this.onRowClick).on("click",".order-preview:not(.disabled)",this.onPreview)};t.prototype.onRowClick=function(t){if(e(t.target).filter("a, a *, .no-link, .no-link *, button, button *").length)return!0;if(window.getSelection&&window.getSelection().toString().length)return!0;var r=e(this).closest("tr").find("a.order-view").attr("href");r&&r.length&&(t.preventDefault(),t.metaKey||t.ctrlKey?window.open(r,"_blank"):window.location=r)},t.prototype.onPreview=function(){var t=e(this),r=t.data("orderId");return t.data("order-data")?e(this).WCBackboneModal({template:"wc-modal-view-order",variable:t.data("orderData")}):(t.addClass("disabled"),e.ajax({url:wc_orders_params.ajax_url,data:{order_id:r,action:"woocommerce_get_order_details",security:wc_orders_params.preview_nonce},type:"GET",success:function(r){e(".order-preview").removeClass("disabled"),r.success&&(t.data("orderData",r.data),e(this).WCBackboneModal({template:"wc-modal-view-order",variable:r.data}))}})),!1},new t});

WP Recipe Maker Plugin Preview

Hi there!

Welcome to a live preview of the WP Recipe Maker plugin! We created an example recipe for you and added it to a regular WordPress post. This can give you an idea of how the plugin works and what it looks like.

Things you can check out in this preview:


If you want to learn even more, check out our demo site or WP Recipe Maker homepage. But our best recommendation is to just install WP Recipe Maker on your site and play around with it. There is a ton to discover!