I solved this with dirty way.. hope someone else can provide more efficient solution, my final working code for problem above:
$shortkode="[zendesk_request_form size="3" group="extra-field" subject="Quotation For -wkwkwk-"]";
$shortkode = do_shortcode( $shortkode );
add_action('woocommerce_single_product_summary', 'quotation_form', 61);
function quotation_form()
{
$produk = get_the_title();
global $shortkode;
$shortkode = str_replace("-wkwkwk-", $produk, $shortkode);
echo $shortkode;
}
So i move out do_shorcode outside function, then declare it as global variable.
The problem is about my $produk variable will not working if declare it outside WordPress page, so I’m using str_replace to replacing pre product title
Related Posts:
- Adding short codes from a page’s content on header and hiding the same from page’s content
- Order Woocommerce Products by Latest Reviewed
- Pagination for a page created by the shortcode “Product”
- Print shortcode in defined area
- Adding a template part as part of a shortcode
- When are Shortcode Attributes Available in Template
- Getting Shortcode Attributes befor content is displayed by the template
- my form does not insert any data in the database
- Use atributes of shortcode in get template part
- How to fix transparency in product sliders / featured products on home page?
- Shortcode or Template Page
- tinymce custom button
- Woocommerce products shortcode specific order
- Woocommerce Filter Main Loop by Tag [closed]
- Using shortcodes that wrap around code
- How to not show shortcode contents if cart is empty?
- woocommerce Product shortcode create [closed]
- Enclose article’s body with default shortcode
- WP Customer Reviews call short code on another page [closed]
- Create a shortcode to display the “the_content ()” in my post [closed]
- wp:shortcode works in block theme template file but not PHP include file
- Making a Shortcode [NEXT] and [PREVIOUS] to place into specific posts for post navigation
- How to display the site name in a WordPress page, or post
- Native “playlist” shortcode random playing… How?
- Stop strip_shortcodes() stripping content inside shortcodes
- How do i link gallery thumbnails to different url’s using the wp native gallery?
- How to save a shortcode in a Gutenberg custom block?
- Is shortcode_unautop() broken?
- Some doubts about gallery shortcode in WordPress
- Dynamically create shortcodes using add_shortcode and a callback
- do_shortcode() doesn’t work if shortcode contained in variable, works if shortcode passed as string
- How can I make a shortcode from this code?
- Meta tags in shortcode
- Adding PHP/HTML code inside page from custom template
- Video shortcode – autoplay all videos
- passing parameters to do action from shortcode to wp_footer
- How to get_template_part using AJAX?
- How to extract the variables out from “add_shortcode” function?
- MathJax inside shortcode
- How to add class or id to shortcode HTML elements?
- Change WordPress Shortcode added in to post
- Changing the title tag from a shortcode
- WordPress wpautop/shortcode generating invalid markup
- Shortcodes attributes defaults
- Get Required Assets (JS, CSS etc) for post using REST API
- shortcode to display woocommerce cart total
- Remove ‘p’ tags around shortcodes and ‘img’
- WordPress Short code with additional parameter
- How to protect parts of my code from TinyMCE modification when switching from text to visual mode?
- Creating a short code with php inside
- Shortcode output appearing at the top of the page only [duplicate]
- problem with shortcodes nesting
- Is it possible to modify the header with a content shortcode?
- PHP/WordPress — How do I check if Shortcode returns content?
- Convert my php code into shortcode
- Add shortcode with open close function
- Shortcode outputting at top of content
- Will a shortcode placed inside a paragraph tag still be valid?
- Why can’t I display attachment_image_src with Custom Size?
- Shortcode Strategy
- Enclosing Shortcode is acting like self-closing
- Shortcode into the same shortcode
- How do I define and register a shortcode function in a namespaced functions.php file?
- Change user meta value with shortcode
- Execute shortcodes in PHP
- Adding author option to [products] woocommerce shortcode
- WordPress User ID as Shortcode
- Custom Shortcode + Querying and Ordering Posts using multiple Advanced Custom checkboxes
- Shortcode call not working in WP Template
- Dynamic number within shortcode
- How can i strip shortcode from HTML title tag?
- how to display a template.php in a shortcode
- Need help with creating a simple shortcode
- Returning HTML to Shortcode Block
- WP REST API remove the WordPress shortcodes from the JSON wp/v2/posts content->rendered
- i want to show a modal when user lands on home page very first time
- Hide download option video shortcode
- WordPress Shorcode Display hierarchical taxonomy [child, parent]
- Shortcode not working in Jetpack Top Posts & Pages widget
- Gutenberg running code only available in front end within shortcode
- Insert HTML in content property and render it using shortcodes
- Redirect per shortcode if user is logged in
- Logout user if click on a custom page link
- Shortcode Attribute not defined
- Add Shortcode to ::before class
- Second attribute of shortcode is not changing why?
- Load next post by ID on a single page
- Plugin Shortcode value in post
- Create dynamic content from one WP page to multiple other pages
- Shortcodes: override a shortcode / change shortcode on the fly
- Separating Custom Template logic
- Remove width and height attributes from [gallery] output
- Help with Shortcode Functionality
- Shortcode Site include in a other
- Why is my ajax live search not working when i use a shortcode to call it?
- How do write this type shortcode? [closed]
- WordPress functions.php shortcode is not working [closed]
- My first WordPress shortcode just returning []
- WordPress shortcode select option not working [closed]
- 3 shortcodes 2 won’t render [closed]