I have noticed that when in a Group or User Gallery > Edit Details Screen where you can Upload or Change a Gallery Cover, the Description field does not save WordPress shortcodes entered. I am needing to use a shortcode from a membership plugin to show only part of the description to members. When I save the description field including that shortcode or any other type WordPress shortcode in the description field, the shortcode is removed and the only thing that remains is what was entered within the brackets.
Example from WP Codex:
[caption id="attachment_6" align="alignright" width="300"] The Great Wave[/caption]
On save, the description field shows:
The Great Wave
Sorry, I didn’t mean for the images to get inserted here in my example.. and it’s not letting me edit my post right now to remove them.
The example I used is from this page:
When we save the Description field, the only thing that appears in the description field is the text in between open and closing shortcode brackets. The shortcode itself doesn’t save – it removes the [shortcode info within open and close brackets] and only leaves what is in between the open and closing brackets and so can not do what any given shortcode should.
PLAIN TEXT EXAMPLE:
[shortcode info here] here is text inside a shortcode [/shortcode info here]
here is text inside a shortcode
I looked into it. The shortcode is saving to the database. The problem is with the output.
There are two issues here.
1. In the Edit textarea, shortcodes are getting escaped by a call to esc_textarea( It is not the shortcode but the generated value by the shotcode).
To change this behavior, we will need to modify the way mpp_get_gallery works and will need to allow it fetching data without calling filters on the_content. Please give me a day and I will update the plugin.
I am sorry, I could not work on it. Please allow me to work on it tomorrow(it’s already 4:25AM here).
It needs a few major changes. We escaped the data that’s why we are loosing the shortcode in the content(in display). I will have to look at other way to make sure the data is escaped(for security reasons to avoid any XSS attack) but the shortcodes are not lost.
Just wanted to give you an update. I have been working on it and I am facing a few issues specially related to the use of shortcode. As soon as the theme compat templates are used, our shortcode goes empty. I am looking further and will update you again.
Just wanted to give you another update.
1.The bug seems to be with BuddyPress. Have been trying to debug it and it seems it lies with the way BuddyPress provides theme compatibility. Try posting the shortcode to activity and see if it works or not?
2. I am trying to find a reason for this and will update again and open a ticket on BuddyPress track. If you want me to allow html content in the description, please do let me know, I can easily allow that. It is controlled by MediaPress.
You must be logged in to reply to this topic.