Forum Replies Created

Viewing 8 Topics - 1 through 8 (of 8 total)
Author Posts
December 4, 2013 at 8:40 pm in reply to: jQuery pop up in rich editor 13306
gpspake gpspake

@tareq,
I’ve stumbled across that page and several examples of people using it but I can’t seem to get it to work in my code.

November 27, 2013 at 1:51 am in reply to: Include custom taxonomy in notification 12899
gpspake gpspake

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…

$post_field_search = array( '%post_title%', '%post_content%', '%post_excerpt%', '%pending_post_count%' ,'%tags%', '%category%', '%taxonomy%',
    '%author%', '%sitename%', '%siteurl%', '%permalink%', '%editlink%' );

$post_field_replace = array(
    $post->post_title,
    $post->post_content,
    $post->post_excerpt,
    $this->pending_post_count( 'mycustomtaxonomy' ),
    get_the_term_list( $post_id, 'post_tag', '', ', '),
    get_the_term_list( $post_id, 'category', '', ', '),
    get_the_term_list( $post_id, 'listserv', '', ', '),
    $user->display_name,
    get_bloginfo( 'name' ),
    home_url(),
    get_permalink( $post_id ),
    admin_url( 'post.php?action=edit&post=' . $post_id )
);

Obviously, this will work for other things as well as taxonomy too.
Hope this helps…

November 13, 2013 at 6:20 am in reply to: Send Notification to Multiple Emails 10024
gpspake gpspake

It should work with a comma followed by a space. I send the confirmation emails to about 10 different addresses this way. You may want to copy and paste it in to your regular email client and send, just to make sure there’s not a typo somewhere.

As for the edit_post link, you may have the ‘Override the post edit link’ option set to ‘Yes’ in settings. Try setting that to ‘No’ and see if you are redirected to the back-end from the email.

November 13, 2013 at 6:02 am in reply to: Setting word limit for excerpt 10019
gpspake gpspake

Ok, I’m back and that worked perfectly. I took it a step farther and added a character count in the help text by adding a line to the example jQuery. Now, in addition to the character limit, user see how many characters they have left. feel free to add this to the example doc as it is already very useful.

Help text:
Brief description to describe the post. <span class="excerpt-char-count">400</span> characters remaining.

jQuery

//Text Limit for WPUFE
function wpufe_limit_text() {
   
  if ( is_page('test') ) {
		?>		
	    <script type="text/javascript">
	        (function($) {
	 
	            function limitText(field, maxChar){
	                var ref = $(field),
	                    val = ref.val();
	 
	                if ( val.length >= maxChar ) {
	                    ref.val(val.substr(0, maxChar));
	                }
	            }
	 
	            // Insert Limitations here
	            $('#post_excerpt').on('keyup', function(event) {
	                limitText(this, 400);
	                $( ".excerpt-char-count" ).html( 400 - $(this).val().length );	                
	            });

	        })(jQuery);
	    </script>
		<?php
	}
}
add_action( 'wp_footer', 'wpufe_limit_text' );
November 12, 2013 at 1:49 am in reply to: Setting word limit for excerpt 9970
gpspake gpspake

Perfect. I’m going to try this out; I’ll report back with results. Thanks.

November 11, 2013 at 8:11 pm in reply to: Javascript confirmation on post submission. 9949
gpspake gpspake

Thanks Tareq. I’ll read up on that.

November 9, 2013 at 10:49 pm in reply to: Javascript confirmation on post submission. 9906
gpspake gpspake

Haha, that’s so obvious. That would work. Thanks.
Just a thought, though, would it be hard to pass data to the page from the form so if anyone tries to access it otherwise they would be redirected?

November 9, 2013 at 7:07 am in reply to: Plugin Conflict with 404 Redirected 9878
gpspake gpspake

Thanks for the quick response! I spoke too soon, there was actually a setting I had to change to get it working. We’ve read through a lot of the 404 documentation but liked this plugin because it automatically catches and logs 404s and sets up a redirect to the post the user was most likely trying to access. All is well.

Viewing 8 Topics - 1 through 8 (of 8 total)