Forum Replies Created

Viewing 11 Topics - 1 through 11 (of 11 total)
Author Posts
August 30, 2013 at 12:04 am in reply to: Repeatable fields get messed up each time a post is updated 7642
cob-web cob-web

All right then. I’m also using WPML, which doesn’t seem to be 100% compatible with your plug-in. I’ll keep an eye on that.
Thanks.

August 29, 2013 at 9:52 pm in reply to: Repeatable fields get messed up each time a post is updated 7637
cob-web cob-web

Thanks Tareq!
One more question to this: is it also normal, that from time to time a new row of fields appears? I mean, I press “update” and suddenly there is an empty row of repeatable fields. I have to press the “-” to delete it. Have you experienced this?

August 29, 2013 at 2:09 am in reply to: Repeatable fields get messed up each time a post is updated 7601
cob-web cob-web

I just found out, that each time a post is updated the repeatable fields get saved for new! It means each time the meta_id of it increases! Is this normal? Is it the way it works? It’s at 17632 now and growing…. This actually kind of explains the problem with the reordering: when I create a group of ordered fields, each time I update the post, they get reordered and saved for new.
Is it a “normal” behaviour? 😉
Thanks in advance.

August 28, 2013 at 10:57 pm in reply to: Repeatable fields get messed up each time a post is updated 7592
cob-web cob-web

I think I’ve found a solution for the frontend:


<?php $myid = $post->ID; 
                        $data = $wpdb->get_results("
                        SELECT * FROM $wpdb->postmeta WHERE post_id = $myid
                        AND meta_key NOT LIKE '\_%'
                        AND meta_key  IN('additional_credits')
                        ORDER by meta_id ASC
                    ");

                    if( !empty( $data ) ) {
                    foreach( $data as $result_object ) {
      
				$values = explode( '| ', $result_object->meta_value);
        $role_additional = "{$values[0]}";
        $url_additional = "{$values[2]}";
		if ($role_additional == '')
{ ?>
<?php } else { 
if ($url_additional  == '') // link to url when available
{ echo "{$values[0]}: {$values[1]} <br />"; } else { 
echo "{$values[0]}: <a target=\"blank\" href=\"$url_additional\">{$values[1]}</a><br />"; 
 	} 
  }
}}
?>	

But I still worry about the backend, as my client doesn’t like the idea of “random changing” 😉
Any idea on that would be very appreciated!

August 9, 2013 at 3:03 pm in reply to: Section break, html and default form in the back end 6776
cob-web cob-web

I found a very simple solution 🙂
If the _wpuf_form_id is empty, the form ID will get set to the default ID, otherwise nothing gets changed…

function wpufe_auto_set_formid( $post_id, $post ) {
 	$form_id = get_post_meta( $post_id, '_wpuf_form_id', true );
       if ( $post->post_type == 'my_post_type' ) {
   	if ($form_id == "") 
   {
   	$form_id = 201;
        update_post_meta( $post_id, '_wpuf_form_id', $form_id );
   	} else{   }
}
}
add_action( 'wp_insert_post', 'wpufe_auto_set_formid', 10, 2 );
August 2, 2013 at 2:17 pm in reply to: Section break, html and default form in the back end 6594
cob-web cob-web

@Tareq
I was playing with the function as you suggested.
Unfortunately it won’t allow me to change the form once a new post is created! Every time I save or update a post, the function sets the form ID back to the “default form”.
I changed the $priority number of the action to 1 and to 15 but it doesn’t seem to change this behavior.
Actually the function should run just once when I create a new post.
Do you have any hint on this?

July 30, 2013 at 9:57 pm in reply to: Section break, html and default form in the back end 6485
cob-web cob-web

To explain: for different reasons I use another form in the back end than in the front end… So when I create a new post in the back end, it should use the “default form”, when a user creates a new post, he should be able to use the “frond end from”.

July 30, 2013 at 8:41 pm in reply to: Section break, html and default form in the back end 6480
cob-web cob-web

This sounds like exactly what I need! 🙂

function wpufe_auto_set_formid( $post_id, $post ) {
    $form_id = 143;
     
    if ( $post->post_type == 'post' ) {
        update_post_meta( $post_id, '_wpuf_form_id', $form_id );
    }
}
 
add_action( 'wp_insert_post', 'wpufe_auto_set_formid', 10, 2 );

But won’t it clash, when the user will create a new post at the front end with another form?

July 30, 2013 at 7:00 pm in reply to: Section break, html and default form in the back end 6469
cob-web cob-web

Thanks Tareq,
regarding 2. – isn’t there any hook to set it? It would be a huge improvement for the work flow…

July 26, 2013 at 11:50 pm in reply to: Custom Taxonomy (non hierarchical) e.g tags 6355
cob-web cob-web

Thanks Tareq for your super fast answer!

July 26, 2013 at 11:02 pm in reply to: Custom Taxonomy (non hierarchical) e.g tags 6352
cob-web cob-web

Hey Tareg,
it also works for me, BUT: when I fill in the custom taxonomy tags in the WP backend, I get suggestions of already existing tags. For example I’m using a custom taxonomy “filmmaker”. If I type the first letters “St”, it shows me the tags, that already exist e.g. “Steven Spielberg”. However this doesn’t seem to be working in the front end form. Is there a way to make this work? That’d be fantastic! 🙂

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