Get value from html

WordPress Resolved
September 23, 2020 10:14:48
Peter
Topics: 2
Messages: 6
Hello,

Your plugin works very well for me, I think it's the best solution on the market.

But I have one problem: the shortcode [e2pdf-content key="locked"]Dummy text[/e2pdf-content] doesn't work for me nor [post_content]. The problem is that I don't have custom meta field for the price and I need to put in PDF somehow.

Ideally I would like to take value straight from html markup as this value is fetched from google sheets. Can it be done with js or php? Or maybe you can recommend other solution for this.

Thank you!
September 23, 2020 12:28:45
E2Pdf
Topics: 7
Messages: 3617
Support
Hi, thank you.

Can you please confirm: [post_content] currently contains 'price' value? Is it correct?

----------------------------------------------

If you need to output "price" value from [post_content] in separate field/object you can try to complete task with preg_match_all filter, as in this example, however it will be need to identify it somehow to match: https://e2pdf.com/support/desk/how-to-show-image-gallery.

----------------------------------------------

If it's not in separate field/object than it looks like it will be need to add custom shortcode with current way: https://codeshare.io/aYQY9Q. It must be added to functions.php

After adding shortcode and filter which will allow using it inside E2Pdf Template, you can add to template:

[e2pdf_custom_price][post_content][/e2pdf_custom_price]

$content inside function will contain rendered [post_content] shortcode, so you will need to extract needed value with PHP from it and assign to $value.

----------------------------------------------

Let us know please if it will be any issues or misunderstanding in completing the task. Thank you.

We remain at your service.

We would really appreciate your feedback at WordPress.org!
September 23, 2020 13:05:25
Peter
Topics: 2
Messages: 6
Hello, thank you for a quick answer! I appreciate it.

I'm sorry I think I misled you. I have a custom post type with custom meta field "cena". In this price meta field I use a shortcode to fetch data from google sheets.

For now it works only if I put google sheet shortcode directly to E2pdf Template, but when I use [meta key="cena"] instead it outputs my google sheets shortcode, not the actual content.

Is it possible to skip [post_content] and output rendered information from a shortcode? Or take this value directly from html?

Thank you!
September 23, 2020 13:34:31
E2Pdf
Topics: 7
Messages: 3617
Support
Current behavior connected with security restriction and E2Pdf restrict firing shortcodes 2nd time. So you need just to fire shortcode that is located under [meta key="cena"] field?

If so, see please this updated function: https://codeshare.io/ad39RR

Inside E2Pdf Template it must be used:

[e2pdf_custom_price][meta key="cena"][/e2pdf_custom_price]

We remain at your service.

We would really appreciate your feedback at WordPress.org!
September 23, 2020 18:54:36
Peter
Topics: 2
Messages: 6
Thank you so much for your help!

I wish I needed more than one template so I could buy your plugin and use your support.
Least I can do is write a review for you.
September 24, 2020 08:17:25
E2Pdf
Topics: 7
Messages: 3617
Support
Thank you!

We would really appreciate your feedback at WordPress.org!
Get News and Updates
Our monthly newsletter keeps you in the loop, so you'll always be up to date with the latest news and updates about E2Pdf.
* You can update your email subscription preferences here.
All trademarks, service marks, trade names, product names, and logos appearing on this website are the property of their respective owners. The use of trademarks such as Formidable Forms®, Forminator Forms®, Gravity Forms®, JetFormBuilder®, WordPress®, WooCommerce®, WPForms® and others is solely for identification purposes (nominative use) and does not imply any affiliation, sponsorship, or endorsement by the respective trademark holders.
© 2017 - 2026, https://e2pdf.com

We use cookies to collect and analyse information on site performance and usage, to provide social media features and to enhance and customise content and advertisements. By clicking "Accept Selected", you consent to use of selected cookies according to our Cookie Policy.