elementor / elementor/elementor

Shortcodes do not get applied for custom widget when used in template

Open
#10,753 0 comments 0 reactions 0 assignees View on GitHub
mod/q*
Dominant language
PHP
Stars
7.1k
Forks
1.6k
Avg merge
1d 5h
Merged PRs (30d)
193

Description

## Prerequisites

- [x] I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
- [x] The issue still exists against the latest stable version of Elementor.

## Description

Our WP Recipe Maker plugin has a custom elementor widget that returns a shortcode like this in the render function:
`echo '[wprm-recipe id="123"]';`

When that widget is used in a regular post, `do_shortcode` gets applied automatically and the recipe is rendered in the front-end. When that widget is used in a template it outputs the literal shortcode text, since `do_shortcode` doesn't seem to get applied there.

Is this difference in behaviour between regular posts and templates intentional?

## Steps to reproduce

As replicated by Elementor support:
https://www.loom.com/share/47b1c19f967e4d66a67671543da31ecf

## Isolating the problem
- [x] This bug happens with only Elementor plugin active (and Elementor Pro).
- [x] This bug happens with a default WordPress theme active.
- [x] I can reproduce this bug consistently using the steps above.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.