soflyy / oxygen-bugs-and-features

Bug Reports & Feature Requests for Oxygen
https://oxygenbuilder.com/
314 stars 29 forks source link

Shortcodes not correctly rendered (shortcode inside shortcode) - Toolset Views, Types #1180

Open tottello opened 4 years ago

tottello commented 4 years ago

Shortcode is not rendered correctly.

I have View shortcode made in Toolset Views.

[wpv-view name="name-of-view" ids="[types field='additional-custom-field' output='raw'][/types]"]

I display view based on ID from post custom field.

Unfortunetly [types ...][/types] is ignored.

This works fine in classic WP Editor.

WP 5.4.1 Oxygen 3.3 Toolset Views 3.2.1 Toolset Types 3.3.10

tottello commented 4 years ago

The workaround is to use shortcode in widget Text - than it works as expected.

KittenCodes commented 4 years ago

@tottello Does it work correctly if you use a Code Block element with the WordPress do_shortcode() function?

tottello commented 4 years ago

It doesn't work like this:

echo do_shortcode('[wpv-view name="name-of-view" ids="[types field='additional-custom-field' output='raw'][/types]"]');

because of quotation marks, but it does work like this:

$variable_custom_field = do_shortcode('[types field="additional-custom-field" output="raw"][/types]');
echo do_shortcode('[wpv-view name="name-of-view" ids="'.variable_custom_field.'"]');
wpsumo commented 4 years ago

Having a similar problem with just shortcode element and do_shortcode in a code block. works on all English languages but not on non-english. Have nothing to do with oxygen not being multilingual ready and supported. It fetches a page ID and it does not render the shortcode if the language isn't English. Not limited to default language or anything