It’s only been twelve days since the last update, and there weren’t any major bugs to fix, but this update brings major changes to how the back end is handled inĀ preparationĀ for ReciPress Pro.
The Changelog
- Added functions to add and remove items from arrays
- Cleaned up recipress_fields array and changed the way items are added
- Cleaned up recipress_options_fields array and changed the way items are added
- Converted the output into a filterable array
- Added default to recipress_recipe
If you’ve been muddling around with making changes to the way the recipe is outputted, options, or the meta box, this update will put a double rainbow in your sky.
Filterables
The functions recipress_options_fields(), recipress_fields(), and the_recipe() are now filterable and each item is it’s own array value with a unique key. Plus, there’s a couple of built in funcitons that will let you add and remove array items. This will let you filter the function to add items in specific places, change items, and even remove them altogether. Here are a few examples:
Add an Allergy Information Textarea to the Meta Box After the Instructions Input
add_filter('recipress_fields', 'recipress_insert_allergies');
function recipress_insert_allergies($meta_fields) {
$allergies = array(
'allergies' => array(
'name' => __('Allergy Information', 'recipress'),
'desc' => __('Describe any allergy information about this recipe.', 'recipress'),
'id' => 'allergies',
'type' => 'textarea'
)
);
return recipress_array_insert($meta_fields, 'instructions', $allergies);
}
Add the Allergy Information to the Recipe Output After the Instructions
add_filter('the_recipe', 'recipress_allergies');
function recipress_allergies($recipe) {
$allergies = array(
'allergies' => '<p><small>'.recipress_recipe('allergies').'</small></p>'
);
if (recipress_recipe('allergies'))
return recipress_array_insert($recipe, 'instructions', $allergies);
else
return $recipe;
}
To find out more about these new functions, see the documentation on Filterables.
hi,
I just want to report a bug on recipress.
I noticed many times some recipes are desactivated from the post.
I don’t know really when it happens because I schedule a lot of my recipe days before the publish time. Sometimes, I update them before they are published and sometime not.
Picture are uploaded and sometimes updated.
Anyway, I have some people who have contacted me letting me know the recipe is off. Then I go back into my admin to find the post and they are right I can see the recipe is off from the post. I have to check the box again.
Hope you can understand me, I am french. Please visit my website http://www.cuisine-ophelie.com and visit recette section and see.
Thanks