Support » Plugin: ReciPress » [Plugin: ReciPress] don't use php short tags

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Tammy Hart



    You are right about the short tags. That was shortsighted on my part and I will update those properly.

    I have an photo for every instruction option built in, but I commented it out to get the first release out as it’s not quite polished up to everything I want for it. If you like at meta_box.php, you can find where the code is commented out. I made many changes after doing that so I can’t promise what will happen if you uncomment it, but feel free to play with the functionality if you like.

    I toyed with the idea of leaving this out and making it an add-on later but wanted to test the demand for it first.

    No worries – it is still a dev release after all.

    A couple of other things:

    • typo on line 19 of output.php – “Yeild”
    • and I can’t save Measurements on the initial post save; that may be because I added a few custom measurements in the options? I’ll check tomorrow.
    • You’ll be pleased to know that uncommenting the image per instruction bits in meta_box.php almost works right away:
      • the table is now too wide for the edit template – adding “float:left” to the “Upload Image” button is a quick fix for my screen width at least
      • it saves the post ID of the media library image, not the src so on line 234 you’ll need something like:
        if($row['image']) { $src = wp_get_attachment_image_src( $row['image'], 'thumbnail' ); echo $src[0]; }
      • and likewise on the frontend side in functions.php, something like:
        $output .= '<li style="clear:right">';
        if (isset($instruction['image']) AND is_numeric($instruction['image'])) {
        $src = wp_get_attachment_image_src( $instruction['image'], 'thumbnail' );
        $output.= '<img style="float:right;margin-bottom:10px" src="'.$src[0].'" width="'.$src[1].'" height="'.$src[2].'" alt="" />';
        $output .= $instruction['description'].'
      • ‘;
        in the instructions loop, although preferably a bit less quick’n’dirty 🙂 I also needed to add “clear:right” to the #recipress_recipe .recipe-taxes style…

    Another thought/feature request – using something like soundex to determine that something like “carrot” and “carrots” are the same ingredient?

    Re. not saving the ingredient measurements when adding a new recipe: I’ve checked now and it is because I added custom units. As they’ve been stored in the db options with carriage returns as the separator and update_post_meta() doesn’t do any trimming, they don’t subsequently match any of themselves again.

    In meta_box.php, I’ve changed:
    if ($new && $new != $old) {
    update_post_meta($post_id, $field['id'], $new);

    to quickly trim measurements:
    if ($new && $new != $old) {
    if ('ingredient' == $field['id']) foreach ($new as &$ingredient) $ingredient['measurement'] = rtrim($ingredient['measurement']);
    update_post_meta($post_id, $field['id'], $new);

    but it’d probably be better handled when saving the custom units initially.

    Also, has been working very nicely with the instruction images – I can now flip through a mini gallery of full size photos per recipe. Now I just need to take better photos 🙂

    Plugin Author Tammy Hart



    Just wanted to make sure that you’re aware this feature is now available in the current releases, so don’t by update shy. 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: ReciPress] don't use php short tags’ is closed to new replies.