November 12, 2013 at 2:15 am 9971
|gpspake||In the Notification options, you can select %category% to display the selected categories. Is there a way to do the same thing with a custom taxonomy?|
November 26, 2013 at 9:08 pm 12887
Sorry I missed the topic at all. There is no currently filters available so you can’t change it without modifying the code.
November 27, 2013 at 1:51 am 12899
Yeah, sorry I meant to jump in here and post this in case anyone is interested…
This does require code modification but, if you really need it, it’s fairly simple. Ideally, these options would be abstracted and there would be a filter but considering this is sort of a bonus feature in this plugin, it’s not really necessary. In my example, the actual taxonomy could be abstracted (Kind of like the custom field option) but, since I only needed one custom taxonomy, I just hard coded it.
Note – This is for 2.1.7 but I’m sure the same applies to 2.1.8
To add custom taxonomies to the notification email, you just need to add a few lines to class/frontend-form-post.php
In the prepare_mail_body function there is an array of options (assigned to $post_field_replace) with variables you should recognize from the notification page in the form builder (ex: %post_title%’, ‘%post_content%’, etc..).
These variables correspond to the values set in the array below ($post_field_replace). It should be pretty clear how this works by looking at the code.
So, all you really need to do is add ‘%taxonomy%’ to the $post_field_replace array and add $this->pending_post_count( ‘mycustomtaxonomy’ ) to the corresponding place in the $post_field_replace array.
In the end it should look like this…
Obviously, this will work for other things as well as taxonomy too.