0
votes
1answer
28 views

Is it possible to include the add_filter() function within a shortcode function

I am trying to pass content to the 'google_dfp_ad_slot' filter. Can this be done within a shortcode funcion? /** * Shortcode function to dynamically add google dfp ads to inline content and ...
0
votes
1answer
57 views

Adding body class when post contains a specific shortcode

Simple shortcode function : function my_shortcode_function($atts,$content=null){ // Do something return $content; } add_shortcode('my_shortcode','my_shortcode_function'); I wonder how to add ...
0
votes
0answers
48 views

apply_filters to content but ignore shortcodes

I want to prepare my content added via wp editor so it displays nicely, so I use apply_filters like so: $ld = apply_filters('the_content', $ld); That works fine for the page, but in the backend ...
0
votes
1answer
17 views

Activate short codes for all post queries?

I need to use shortcodes on widgets and various plugins. For widgets I simply used: add_filter('widget_title', 'do_shortcode'); add_filter('widget_text', 'do_shortcode'); However I cannot figure ...
1
vote
2answers
90 views

How to filter backend post list showing only posts having a shortcode

I need to filter the Posts and Pages tables in the Admin panel by certain shortcodes. In my plugin, I have added a column for shortcodes to the Posts and Pages views that works like the "Categories" ...
0
votes
2answers
49 views

Problem with shortcodes in external file

I have simple post with a shortcode: [xx]http://harrix.org/1.txt[xx] And an external file which has the content containing a WordPress shortcode: [strong] g[/strong] I try add my own tag to load ...
0
votes
1answer
26 views

How to remove shortcode(s) from WYSIWYG Page editor for Non Admins

Title says it all. We have a front end form on our site where users submit content via front end (also they are logged in while doing this) Because these short codes add them self to the content box ...
1
vote
1answer
140 views

Super simple shortcode not working

Have been looking at various tutorials and answers here and elsewhere and just can't get this to work. Just trying to display a simple output from a shortcode as below, but it is just outputting the ...
0
votes
1answer
44 views

Modify a plugin function output from another plugin

I'm writing a plugin for a wordpress site using a page template using WP Types plugin. My plugin adds a shortcode tag. Shortcode tags inside 'the_content' get processed without problem. But this ...
0
votes
0answers
20 views

How can I update the role of a newly added user when displaying the registration form with a shortcode?

Basically I have a shortcode that includes a registration form(among other things). The custom form itself is also included on wp-login.php and user-new.php if the default role is set to ...
1
vote
4answers
455 views

Filter specific shortcode output?

Is there a hook in WordPress that I can use to filter the output of a specific shortcode? Something like this: add_filter('shortcode_output', 'my_filter_function', 2); function my_filter_function ( ...
0
votes
1answer
433 views

Strip shortcode from excerpt [duplicate]

I have this challenge, that i've found out that i'm not the only one in the WEB with the same issue, nevertheless, there are no solutions yet. I'm trying to remove shortcodes from my custom post ...
0
votes
2answers
416 views

how to remove filter from wordpress shortcode output

Twitter URL plugin add the filter to the_content. This filter messing up the output of my plugin shortcode output. So I wish to remove this filter only for my shortcode output. ...
0
votes
2answers
85 views

Shortcode / plugin with custom (flexible) output

Following scenario: I'm building a theme framework which I want to reuse in various themes of mine. In this framework there is a collection of many shortcodes. For exemplary illustration of my ...
0
votes
1answer
48 views

Filter everything from content except output of a shortcode

Is it possible to filter the output of either the content or excerpt so that I only get the the shortcode output and so that if a user enters more than the shortcode the rest of the content for that ...
0
votes
1answer
106 views

Filter Shortcodes when using get_page

I'm using the following line to show content from one page on another. This line outputs the content's raw text of a shortcode: <?php $id=3934; $post = get_page($id); $content = ...
1
vote
1answer
283 views

How to use shortcode attribute in separate function

I'm working on a WordPress site and have installed a slider plugin that registers a slider on the backend (or multiple sliders) and then displays it on the front end with a couple of simple php ...
0
votes
1answer
91 views

Parse a shortcode differently based on on what it's nested in

Suppose we have two different sets of nested shortcodes, like this: Apple version [wrapper snack="apple"] Today I had a [flavor] snack... [/wrapper] Desired output: My snack was quite HEALTHY ...
0
votes
3answers
94 views

Need to return shortcode text instead of the output

Is there a way I can return the shortcode text instead of the output. My code function is hooked into 'the_content' and I know if my function contain shortcode it will automatically generate the ...
2
votes
1answer
250 views

Gallery Settings Change available Columns

Is there a filter hook which changes the number of available columns in gallery settings screen. I'm talking about the : <label class="setting"> <span><?php _e('Columns'); ...
0
votes
2answers
268 views

Can I the caption shortcode to set caption to a data attribute, and with the image's alignment intact?

I want to output an image caption in this kind of format: <img class="alignleft size-medium wp-image-316" alt="Image Title" data-caption="Here lies the image caption" ...
0
votes
3answers
274 views

How can I return shortcode output to the top of the content?

I have a shortcode called update which is used as follows [update title='' date=''] this is some update, etc. etc. 2 paragraphs or more [/update] This outputs some html that wrap the title, date ...
0
votes
2answers
208 views

How can I display wp_link_pages before a shortcode, if it is used, or display after content?

I have the following shortcode in my content [src]<a href="#">Some Link</a>, <a href="#">Some Other Link</a>[/src] My post structure looks like this: <?php echo ...
4
votes
2answers
2k views

add_filter and changing output captions of image gallery

I'd like to change only one output of native WP Gallery (in media.php) On Smashing Magazine (link) author advises to change whole gallery_shortcode function. But I wondered if is possible to change ...
0
votes
1answer
411 views

add_filter to the_content after apply_filters

I have a shortcode that outputs null (""). What I'm trying to accomplish is to output a default message if the shortcode outputs null. I don't want to extend my shortcode because there may be ...
0
votes
1answer
111 views

manipulate a plugins shortcode

I want to add some javascript directly below content, added by another plugin's shortcode. We are using the NextGen Gallery plugin and there are many articles containing the [nggallery] shortcode. I ...
0
votes
1answer
261 views

Filters on the_content with plugins, pages and shortcode

I am using a plugin to add tweet, likes... This plugin add filters to the_content() to display this social buttons on a blog page (list of posts). I coded a shortcode which does a custom SQL query ...
0
votes
3answers
1k views

Make a Shortcode load after Post/Page Content?

I created a shortcode for time.ly's "all in one event calendar app" that makes a paginated list of upcoming events with out all the java script and user options. I posted about it here. (Its still a ...
0
votes
1answer
39 views

Something is filtering my shortcodes… Can't figure out what

Something seems to be filtering out my shortcodes. I'm not sure what or where, and I've looked just about everywhere trying to find it. Is there anything I can do to find out what filters are being ...
2
votes
2answers
363 views

What characters are allowed as a shortcode tag and how should they be sanitized?

I am working on a plugin where the user can define shortcode tags himself. What would you suggest to allow in there? My thought is only allow ascii characters. So how do I sanitize? strip_tags and ...
2
votes
2answers
2k views

Shortcode from a widget is wrapped in unwanted <p> element

I'm using Black Studio TinyMCE Widget as a rich text editor widget. In a sidebar I inserted the TinyMCE widget with a [testimonial] shortcode and some content after it. For example: [testimonial] ...
1
vote
1answer
234 views

Is there any inherent difference between add_filter() and add_shortcode() for modifying [caption]?

The context is the [caption] shortcode found in media.php which contains img_caption_shortcode img_caption_shortcode also includes these lines: $output = apply_filters('img_caption_shortcode', '', ...
0
votes
1answer
102 views

filter title from shortcode

Just wondering how to filter to change the current page title from a shortcode, Since shortocodes are rendering after $post. any idea to archieve something like : ...
6
votes
2answers
284 views

current_shortcode() - detect currently used shortcode

In a plugin class I want to provide simple fields for public data: email, phone number, Twitter etc. The list can be extended. See the plugin Public Contact Data on GitHub for details. To keep the ...
3
votes
4answers
632 views

Run shortcode before filters

My users post snippets code in comments. I created a shortcode for this : function post_codigo($atts,$content=""){ return '<code>'.$content.'</code>'; } ...
1
vote
0answers
117 views

include a post unrendered into a post, then render the whole thing [closed]

With a few extra lines in my functions.php I've created a shortcode that lets me include the content of a post: function include_content( $atts ) { $id = (int) $atts['id']; if ( ! $post = ...
0
votes
3answers
1k views

Ajax, filters and shortcodes

could you figure out why I'm unable to get shortcode filters applied in ajax inclusion of posts? Let me explain better: I've managed to include a post from within another post, through ...
5
votes
3answers
1k views

Is there a way to add another row to the tinyMCE kitchen sink toggle?

The tinyMCE "kitchen sink" toggle button shows/hides a row of buttons. I have successfully added my row of shortcode buttons to the tinyMCE editor, but I was wondering if there was a way to make my ...
0
votes
1answer
780 views

How to display a shortcode caption somewhere other than the_content

I want to disable shortcode captions for posts in one of my themes, and display the content elsewhere, such as in a sidebar. The images aren't uploaded to wordpress, but they're linked-to using the ...