Skip Navigation

[Resolved] Send author data to next page

This support ticket is created 3 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 5 replies, has 2 voices.

Last updated by avansisI-2 3 years, 8 months ago.

Assisted by: Shane.

Author
Posts
#2059445

We come from: https://toolset.com/forums/topic/send-page-title-to-next-page/

Hello, i have an issue with that topic.
It was working correctly now but when i clic on contact button of page it doesn't work.

I think that custom code snippet is not working.
thats the code:

<?php
/**
* New custom code snippet (replace this with snippet description).
*/

toolset_snippet_security_check() or die( 'Direct access is not allowed' );

// Put the code of your snippet below this comment.
function cust_get_author_meta($atts) {

if(isset($_GET['parent_empresa_id'])){
$post_id = $_GET['parent_empresa_id'];
$post = get_post($post_id);

$all_data = get_userdata($post->post_author);
if(isset($atts['type']) and $atts['type']=='id'){
return $all_data->data->ID;
}else{
return $all_data->data->user_email;
}
}

}
add_shortcode( 'cust_get_author_meta', 'cust_get_author_meta' );

add_action( 'cred_save_data_2382', 'func_set_first_message_id_field', 10, 2 );
function func_set_first_message_id_field( $post_id, $form_data ) {
update_post_meta( $post_id, 'wpcf-first-message-id', $post_id );
}

I dont understand why suddenly stop working and second page (ie hidden link) dont show first page info.

Can you help me Minesh?

Thank you

#2060475

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi ,

Can you provide me with admin access to the site so that I can have a look at what is happening here?

I've enabled the private fields for your next response.

Thanks,
Shane

#2061613

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Field.PNG

Hello,

The code is actually working fine. When I looked at the hidden email field that you've added it to I can see that the value is being set correctly. See Screenshot

So i'm not seeing any issues with the form.

Thanks,
Shane

#2061693
Captura de pantalla 2021-05-19 a las 17.49.56.png

Hi Shane,

yes, code its okay but two weeks ago, when user arrives at this page: hidden link user can be the name of the page and company logo.

I think that Contacta con [cust_get_post_title] and [types field="logotipo-de-empresa" item="[wpv-search-term param='contact_id']"] shortcodes are not working correctly.

Template is: hidden link

Do you know what is happening?

Thank you Shane.

#2061931

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Avansis,

If you recall in our thread below.
https://toolset.com/forums/topic/send-page-title-to-next-page/#post-1972637

That we had created the code for the url parameter contact_id . Seeing that the contact_id parameter is missing from the URL then nothing will be displayed for this.

If you want the shortcodes to continue working you will need to go and edit the shortcodes to use "parent_empresa_id" instead of "contact_id"

This should resolve the issue.

Thanks,
Shane

#2062731

Thank you Shane, you are right.

I add a second param at the end of code:

*****/?parent_empresa_id=[wpv-post-id]&contact_id=[wpv-post-id]

My issue is resolved now.

Thank you Shane!