Skip to content

Instantly share code, notes, and snippets.

@stnkris
Created July 14, 2014 19:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stnkris/58601609a899eb7f9fc3 to your computer and use it in GitHub Desktop.
Save stnkris/58601609a899eb7f9fc3 to your computer and use it in GitHub Desktop.
--- <unnamed>
+++ /home/kris/Desktop/patch.diff
@@ -456,7 +456,24 @@
delete_post_meta( $recipe_id, $field, $old );
}
}
- }
+ } // endforeach
+
+ //if ( ! wp_is_post_revision( $recipe_id ) ){
+ // unhook this function so it doesn't loop infinitely
+ remove_action('save_post', array($this, __FUNCTION__));
+
+ $recipe->post_content = $data['rpr_recipe_description'];
+
+ // update the post, which calls save_post again
+ $x = wp_update_post( array(
+ 'ID' => $recipe_id,
+ 'post_content' => $recipe->post_content,
+ 'post_excerpt' => $recipe->post_content
+ ) );
+
+ // re-hook this function
+ add_action('save_post', array($this, __FUNCTION__));
+ //}
}
}
@stnkris
Copy link
Author

stnkris commented Jul 14, 2014

This is the patch for php/class/rpr_core.php

@jckoester
Copy link

Included this in development version on branch "excerpts" (https://github.com/dasmaeh/recipepress-reloaded/tree/excerpts).
Will be in release 0.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment