Skip Navigation

[Résolu] short code [wpv-noautop]…[/wpv-noautop] not working in backend

Ce fil est résolu. Voici une description du problème et la solution proposée.

Problem:
When I use the Raw ShortCode of Views, this does not preserve the "raw" output of things in the backend, when I switch from text to visual editor.

Solution:
This is expected. ShortCodes do nothing in the backend.
They work in the front end and need to be inserted in the backend.

This support ticket is created Il y a 7 années et 3 mois. There's a good chance that you are reading advice that it now obsolete.

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.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Marqué : 

Ce sujet contient 9 réponses, a 2 voix.

Dernière mise à jour par Beda Il y a 7 années et 1 mois.

Assisté par: Beda.

Auteur
Publications
#561296

This seems to be related to this WP bug https://core.trac.wordpress.org/ticket/40960

Even when I encapsulate the html code with the shortcode, I am getting & replaced by &.amp.; when I return again to edit (take out the "."s obviously)

I am using WordPress 4.8.1

#561476

Can you explain what you are doing, and what you want to see, but see instead?

1. You cannot parse raw HTML in WordPress, unless you wrap it in code tags
2. HTML will be disformed if not used in the Text Edit mode.

Hence, if I understand your issue right, it's expected, but please let me know the exact steps you take and what you want to see, so I can understand better.

Thank you!

#563950

Hi,

This is not an issue isolated to my experience. It is a report of what looks to me to be an incompatibility due to a bug in WordPress 4.8.1. that is, it is not currently possible to force widget content to be html even when using toolset [wpv-noautop]

Perhaps the issue reported to wordpress core in ticket 40960 will be fixed in next release.

I am marking this issue as resolved because it is just a notification for you.

#563952
2017-08-27_14-31-05.jpg

Here is an example of the code I am using. As you can see, after I save the text widget and then return, the raw code is converted. In this case all &s are changed.

see attached screenshot to see how the code was changed after I saved and returned to widget editor.

My entered code was:

 [wpv-noautop]
<div class="myBox"><a href="https://toolset.com/?aid=22628&;affiliate_key=JRz77NSpDkP0&dr=clients-newsletter" target="_blank" rel="noopener">
<iframe src="<em><u>lien caché</u></em>" width="520" height="293" frameborder="5px" allowfullscreen=""></iframe></a></div>
<a href="https://toolset.com/?aid=22628&affiliate_key=JRz77NSpDkP0&dr=clients-newsletter" target="_blank" rel="noopener">Do You Want to Learn More?</a>
[/wpv-noautop]   
#564670

I understand it right, that this happens only on Widgets?

Either way, the autop ShortCode is NOT intended to do things on the backend.
It does things on the Front End if any.

Hence, in the Editor this shortcode will not do anything at all.

And that is as far I see the issue you experience, and that cannot be solved by wrapping the content in any ShortCode.

As far I see this, it is not a Toolset Bug.

#566078

I have resolved my issue by using the Enhanced Text Plugin. WordPress has not resolved the bug in 4.8.1 as they reported in https://core.trac.wordpress.org/ticket/40960

If the shortcode does nothing in the backend, it should not be shown in the widget text editor.

See lien caché

The only issue related to Toolset is that the raw shortcode button should be removed from the text widget if it does nothing.

#566642

Well, there is not a single ShortCode in WordPress that does something in the backend.
ShortCodes work in the FrontEnd.

So does that "Raw" ShortCode, our "No-Autop" Wrapper.
It is elaborated in detail here:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-noautop

It removes automatic paragraphing, in the Front End, as in the backend, no ShortCode really can do something.

#566742

You are missing the point: If it does not do anything, you should not put the shortcode in the text widget UI! Perhaps you can put in a change request with your developers to remove it in an upcoming release. The screencast link I provided shows where the toolset shortcode is accessed in the text widget UI (raw button).

You can close the ticket, because I am using a plugin as a work around to the specific issue I reported, which is support of raw code in a text widget when using WP 4.8.1. In prior versions of WP, I used another plugin that is now deprecated. I had thought I did not need a plugin because your shortcode was offered as solution to encapsulate raw code within the text widget.

#566743

...

#580134

The Raw ShortCode needs to be inserted in the backend, as any other ShortCode in the WordPress ecosystem.

Then, on the front end it does what it is programmed to do.
In the example of the Raw ShortCode, it will avoid the auto paragraphing of WordPress.
In the Front end, this effect will be seen as example as this:
- put this in a text editor:

line one
line two

Now, WordPress will usually try to autoparagraph this and make it appear with line breaks.
The raw shortcode avoids this.
We have also the opposite ShortCode.

Both are elaborated here:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-autop
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-noautop