Skip Navigation

[Closed] A shortcode field or a way to add 3rd party shortcode into custom field group?

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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 7 replies, has 2 voices.

Last updated by Minesh 9 months ago.

Assisted by: Minesh.

Author
Posts
#2622847

Tell us what you are trying to do? I want to add a countdown timer in a shortcode form field or wysiwyg field without having to traverse copy and past from a plug-in shortcode pool. Add a 3rd party shortcode into the post type field that parses the wysiwyg output into the field content template.

Is there any documentation that you are following? No. Nothing approaches this.

Is there a similar example that we can see? No

What is the link to your site? N/A

#2622883

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

I'm not sure yet what exactly the requirement you have but based on the description you shared - do you want to add custom shortcode to the WYUSWYG field in backend and when that field is displayed on frontend you want that the WYSIWYG field should display the output with rendered output of your custom shortcode?

#2624197

Yes. I want third party shortcode to render out from a wysiwyg CRED field into the frontend view or content template.

#2625037

Minesh
Supporter

Languages: English (English )

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

So - I've tested by adding the WYSIWYG custom field to post type and then created the post form for the same post type.

The following custom shortcode I've added:

function func_show_different_thank_you_message() { 

 $msg = '';
 $val=1;
 if($val == 1) {
   $msg = "Thank you for selecting the option  1";
 }else if($val == 2) {
   $msg = "Thank you for selecting the option  2";
 }
  
return $msg;
}
add_shortcode('show_thankyou_msg', 'func_show_different_thank_you_message');

And when I submit the form to the WYSIWYG field I've added the following content before submitting the form:

this is the test text content and the shortcode content is as follows: [show_thankyou_msg]

As you can see I've added the custom shortcode and it should replace the shortcode output with text "Thank you for selecting the option 1".

When I added the WYSIWYG custom field on content template:

[types field='venue-desc'][/types]

The out put I can see is as given under:

this is the test text content and the shortcode content is as follows: Thank you for selecting the option 1

So I can see the shortcode is rendered on frontend.

#2626481

I don't quite understand that example. My application would have me adding a Countdown shortcode into the WYSIWYG field in the frontend CRED form. The output of that shortcode would then render out into the Content Template for that Type.

The idea is to have a user complete a form with a submission time limit. In the editor field they would add a date in that field, but on the render it would generate a countdown timer for that post. Should I focus more on changing from a WYSIWYG field to a Date field, and write some code the render the visual timer somehow? Hope this makes sense.

#2626547

Minesh
Supporter

Languages: English (English )

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

Where editor is going to configure the expiration date?

Toolset offers countdown block where you can display the countdown timer:
- https://toolset.com/block-item/countdown/

But it should be date field and if user editor is going to set that countdown date in another post/page then we can configure it here.

There are two things. There is post expiration feature offered by Toolset. Please refer to the following doc to understand how its working.
- https://toolset.com/course-lesson/setting-up-automatic-post-expiration/#enabling-automatic-expiration-of-posts

You can setup a custom post expiration date and after that date the the post will be archived with the status you will set.

If you can share problem URL and admin access details and to what form you are gong to add field and what shortcode that will help me to understand your current structure and then I will be able to guide you in the right dirction.

*** 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.

#2627867

I need to read the supplied docs, then test this block's logic first. I didn't know that this was available from Toolset. I don't use Gutenberg at all. I use Toolset and Visual Composer at the moment, but will be transitioning the theme over to Elementor. I don't want to expend more time and talent to create another WordPress instance with Toolset and other necessary plugins to test this. I'm pushing the deadline. I will perform a full backup if necessary before engaging Admin access.

Also, each post in this Type has its on expiration date. That date must also be established by the original poster from the front-end form. This is looking more like a back-end configuration only. And, I looks lie two steps 1) Countdown block in the form, 2) Post expiration settings for the post Type and not the front-end post itself.

Q. Does the Countdown block work with front-end Toolset forms? I need users to be able to use this to complete the form field with a date that renders visually in the View or Content Template.

*Mark the next reply private if I still need assistance afterward.*

#2628043

Minesh
Supporter

Languages: English (English )

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

If you want to set the post expiration date selected by user, you will have to use custom date field that will hold the post expiration date and I believe later you can use this date field with countdown block but I dont think if you able to use it. That is why its important for me to review your current structure and where you want to add the form and where you want to display the count down block. I doubt about adding count down block for form but lets do it step by step.

You can use the "cred_save_data" hook to update the custom post expiration time. Please check the following related ticket that might help you:
- https://toolset.com/forums/topic/post-expiry-date-in-form-saves-a-different-date-in-the-post/#post-2114161
- https://toolset.com/forums/topic/post-expiration-date-in-form-doesnt-work-anymore/

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

The topic ‘[Closed] A shortcode field or a way to add 3rd party shortcode into custom field group?’ is closed to new replies.