Skip Navigation

[Resolved] Custom placeholder

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.

This topic contains 9 replies, has 2 voices.

Last updated by Dido 8 months ago.

Assigned support staff: Minesh.

Author
Posts
#1909823
vraag.fw.png

Hi,

I followed your instructions on a custom placeholder, but it doesn't work.
See my uploads.

image:
My code in the form
My code in the mailformat
My email
My function

What goes wrong?

#1910137

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

That is strange, it looks all OK as per your screenshot.

To know why its not working, I will require access details and please tell me on what page you have added the form.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

\I have set the next reply to private which means only you and I have access to it.

#1910537

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please share bit more information.

Where you added the form, to what page? where you added the Toolset Form hook?

#1910667

Hi, this form is on every Artikel (CPT)
For instance:
hidden link

I rebuilded the module "messaging system" what Toolset provide.
You can find it under Modules.

#1910729

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I checked with the test site you shared but with your test site the form does not get submitted and when I submit the form it shows 404 page not found error, there must be some permission issue on the test site.

Can you please try the following:

Within your form body, update the generic field as given under:

[cred_generic_field field='artikel' type='hidden']
{
"default":"[wpv-post-id]"
}
[/cred_generic_field]

Then, Try to use the following code to your theme's functions.php file or "Custom Code" section offered by Toolset:

add_filter('cred_subject_notification_codes', 'custom_generic_field_notification', 9, 1);
add_filter('cred_body_notification_codes', 'custom_generic_field_notification', 9, 1);
function custom_generic_field_notification( $defaultPlaceHolders ) {
 
	$link = '<a href="'.get_permalink($_REQUEST['artikel']).'">'.get_the_title($_REQUEST['artikel']).'</a>';
    $newPlaceHolders = array( 
        '%%ARTIKEL_NAAM%%' => $link
    );
  
    return array_merge($defaultPlaceHolders, $newPlaceHolders );
}

I hope this will help you to display the parent post link.

#1910899

Hi Minesh,

unfortuatelly, I get an critical error after reloading.
is there a mistake in the function?

#1911231

O, sorry.
I notice that you added the code already in the admin custom code.

Very strange that we get an error after submitting.
it was working yesterday. I will test your code first on my other websites.

#1911243

Hi Minesh,

I have discoverd the problem.
I get the title of the post, with [wpv-post-title]

But I want to have a link [wpv-post-link]

When I use that shortcode, It is not displayd in the email.

I would like to have the postlink show up in the email.

If you want to test, you can do this on
hidden link and
hidden link

because that posts are mine.

#1911489

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please check now.

I've adjusted the code as given under at "Custom Code" section offered by Toolset:

add_filter('cred_subject_notification_codes', 'custom_generic_field_notification', 9, 1);
add_filter('cred_body_notification_codes', 'custom_generic_field_notification', 9, 1);
 function custom_generic_field_notification( $defaultPlaceHolders ) {
    
   $link = '<a href="'.get_permalink($_REQUEST['parent_post_id']).'">'.get_the_title($_REQUEST['parent_post_id']).'</a>';
    $newPlaceHolders = array( 
        '%%PRODUCT_NAME%%' => $link
    );
  
    return array_merge($defaultPlaceHolders, $newPlaceHolders );
}

I see the post title displayed with link with the email. See this screenshot: hidden link

Can you please confirm it works at your end as well.

#1911673

I am so happy with your support! My issue is resolved now. Thank you!