BB-Code-like mechanism by which strings enclosed in square brackets can serve as shorthand for longer and more complicated strings. These strings are processed by callback handlers, usually on page load, which replace the bracket enclosed string with the output from the callback handler.

learn more… | top users | synonyms (2)

1
vote
1answer
318 views

How the widget can be run by shortcode

I have my own widget, that uses WP_Widget class, and executes its code inside function in this class. Is there any ways to run this widget using shortcode inside post? This is how my widget ...
0
votes
1answer
811 views

Pass data back to TinyMCE from Thickbox

I've added a shortcode button in the TinyMCE editor in the page/post pages that opens up a Thickbox form. The button is working; it opens up the thickbox form like it should. However my stumbling ...
3
votes
1answer
956 views

TinyMCE popup windows using WP functions

In my editor I would like to use a TinyMCE generated popup to insert in the textarea some complex shortcodes. I use the TinyMCE API to show the popup (bottom of this question). The popup is a PHP file ...
0
votes
1answer
520 views

AJAX function not working [closed]

One person on the site wrote a function, but I do not know why it works. This function displays a random quote. The functions implemented the ability to download new quotes via AJAX (link New Quote), ...
1
vote
3answers
742 views

shortcode_atts - one URL variable not working

I have devved a small plugin based on a shortcode. Here's a stripped down version of the code for the shortcode itself: function lishortcode($liatts) { extract(shortcode_atts(array( "li" ...
2
votes
1answer
213 views

other shortcodes in Contact form 7 MAILS [closed]

How to use other shortcodes inside Contact form 7- forms? indeed explains how to use other shortcodes inside Contact Form 7 forms. But that doesn't make them usable in the mails that Contact Form 7 ...
1
vote
3answers
2k views

Getting attribute value from shortcode

I have this shortcode [learn_more caption="something here:"] [/learn_more] I want to extract the caption value and remove other stuff. "something here:" This is the code that I have, but it ...
0
votes
2answers
165 views

Using locate-template & shortcodes doesn't appear to work

For organisation, I'm trying to split up the functions.php file into separate files. In particular the functions for shortcodes in a separate file, with the shortcodes being defined in functions.php. ...
0
votes
3answers
169 views

Using shortcodes in PHP

I'm trying to use shortcode in my page, I'm starting with a simple test. In functions.php: function HelloWorldShortcode() { return '<p>Hello World!</p>'; } ...
1
vote
3answers
193 views

Shortcode outputs at the top of the_content

The shortcode produced by this function - a list of all sites in a multisite - outputs above the content in the loop, no matter where it is placed in the editor. I've looked at the other related ...
33
votes
5answers
7k views

Where to put my code: plugin or functions.php?

Is there an easy to understand scheme to decide what kind of code belongs to a plugin or the theme’s functions.php? There are many cases and many debates about that topic, mostly because there are ...
5
votes
2answers
847 views

Use AJAX in shortcode

I have the following code to the shortcode to display a random quote. Question: how to make a button display a new random quote? I mean, that would hit the button and show you a new quote (without ...
-1
votes
2answers
237 views

Get URL from shortcode tag

I am running a wordpress site and I need the correct regex syntax to get a URL from some shortcode that is returned inside the_content(). When I use the_content(), it will return something like ...
1
vote
1answer
210 views

Check if post has gallery images/media

Is there a Wordpress conditional that I can use to check for gallery images/media in a post? I do not want to check if the [gallery] shortcode exist in a post. Attached is a screenshot of what I ...
2
votes
1answer
537 views

WP_enqueue_script inside shortcode?

I've got shortcode that needs to include JS library only once and only there where it's used. function shortcode_function($atts, $content = null) { $class = shortcode_atts( array('something' ...
14
votes
2answers
23k views

How to add a shortcode button to the TinyMCE editor?

How to make any plugin icon in wordpress post? The code I want to insert in plugin code and will appear in post bar [wp-admin/post.php]. Like this image: Output: If I click the icon it ...
0
votes
1answer
477 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
77 views

Iteratively add sub shortcodes to php array

I have this shortcode structure: [component] [type1]some content[/type1] [type2]some more content[/type2] ... [typeN]some other content[/typeN] [/component] I would like to have the ...
2
votes
1answer
283 views

wpautop() when shortcode attributes are on new lines break args array

I have a custom shortcode tag with a few attributes, and I would like to be able to display its attributes on new lines - to make it more readable to content editors: [component attr1 ="value1" ...
0
votes
2answers
372 views

include shortcode values in Thickbox form

I have a shortcode that is built using a Thickbox form with various inputs that return the values. This works fine. However, I would like the existing values (if present) to re-populate the form if ...
1
vote
3answers
842 views

Caption shortcodes not including caption as attribute

I recently installed the bonpress theme and am having trouble with the captions showing correctly. The more I try to understand how captions are supposed to work in Wordpress, the more I suspect ...
0
votes
1answer
52 views

Create pages for authors

I have a pretty good question here. I would like to create a hidden page on my wordpress blog for each user as they are registered. I already have most of the code of what needs to be put on the page ...
0
votes
2answers
260 views

How to pass custom field value to shortcode?

I want to call custom field in single.php template to complete a short code and thus show a menu. I places the below code but it is not working <?php echo do_shortcode("[custommenu menu=<?php ...
2
votes
1answer
2k views

Frontend editing, Frontend user dashboard

I am creating a website so that users can submit their articles from the front end. I have quite a few things set up: The ability to submit custom post types from the front end Blocked from the ...
2
votes
3answers
548 views

get attributes/part of the gallery shortcode

I'm trying to grab all image id's that are associated with the [gallery] shortcode that are listed as exclude. For example: if my post has [gallery exclude="1,2,3"] I'd like to get a variable that ...
0
votes
2answers
690 views

Does Wordpress support a shortcode calling itself from within a shortcode call?

I've built a super-crazy Wordpress framework that has a million and one shortcodes, one of those is a columns shortcode which supports a count parameter that allows you to define a column and the ...
1
vote
1answer
1k views

echo do_shortcode is not working on theme's template

I don't know whats causing the problem but the echo do_shortcode is not working on my theme's template, but its working on my plugin's template and the shortcode is working on my posts and pages. ...
2
votes
1answer
281 views

How navigation works in custom loop within shortcode?

I am using a shortcode to display a custom query. The shortcode is use in page. Everything is fine, only the navigation that I can't get it working correctly. Here is the function that I use to ...
0
votes
2answers
2k views

Stripping shortcode from custom excerpt function

I'm using the following function to create a custom excerpt for my homepage and categories pages so I can do it by character count and have a custom "read more". However, I have captions shortcode ...
2
votes
1answer
132 views

Short code for Venues

I am using the Event Organiser plug in and I am trying to setup the "venues." In the post my client and I would like a little more information on the venue to appear, I found the short code for the ...
1
vote
1answer
240 views

How to format shortcode's HTML in external file

I need to add a shortcode in my theme and I would like to put the HTML code not in the function which creates the shortcode but in a template file in my theme directory. Now I have function ...
1
vote
1answer
300 views

Adding option to Gallery shortcode

just starting out in WP dev, and I'm looking for any guidance I can get. What I'd like to do is use a hook or filter to add my own option to the core WP gallery shortcode. I would want it to work just ...
0
votes
2answers
854 views

passing parameters to do action from shortcode to wp_footer

Driving me nuts. I have a shortcode which works -fine- but for one detail. I won't post the entire thing, but it pulls the content of a post (works fine) then should echo a portion of it to a new DIV ...
1
vote
1answer
96 views

Enumerating shortcode attributes in JavaScript

I'm working on a plugin which uses a shortcode to call a JQuery function, and it requires three aspects to work: The JQuery code + its own code, to be included on the pages it will be used on The ...
1
vote
2answers
523 views

do_shortcode() doesn't work if shortcode contained in variable, works if shortcode passed as string

I'm developing a plugin, wherein one of the features is to switch out forms on a specific page by changing the shortcode within a custom field. within my plugin file: function getShort() { ...
0
votes
1answer
306 views

shortcodes output before content [duplicate]

Possible Duplicate: problem with short code Shortcodes are broken. For those of you playing at home, heres an easy step by step to replicate my problem. 1) Open a fresh Wordpress ...
0
votes
1answer
620 views

Shortcode for Twitter Bootstrap Collapse

Im trying to create shortcodes for Twitter Bootstrap Collapse. This is what Im trying to achieve: [collapse-group] [collapse accordion="#accordionOne" title="my heading1"]some text[/collapse] ...
2
votes
1answer
449 views

Prevent add_shortcode from escaping a tag

In my plugin, I'm rendering a shortcode with some inline JavaScript. Wordpress seems to hate the closing CDATA tag (]]>), as it escapes it. I'm using CDATA blocks so as to render well-formed XHTML, ...
1
vote
1answer
108 views

Single post content custom order

In my post I have a shortcode for [video] than text content. Single post page displays first entry-meta, than title, than content [video] + text. What I need is to add some condition in single.php so ...
0
votes
1answer
1k views

Shortcode output always showing at top of page

my shortcode output won't appear where I put it, but rather at the top of the content (top of the post/page content). And here is my code function service_shortcode_index() { global $content; ...
4
votes
2answers
2k views

TED talks shortcode not working

I am trying to embed a Ted talk video using the shortcode: [ted id=myid] But it's not working. It shows the text instead of the video. Is there any configuration I need to check to make it work?
2
votes
1answer
171 views

How to create tabled index of posts in a certain category

I have a tech blog, what I want to do is to create an index page for articles in a certain category. For example, I want all the articles under the category "WordPress BasiX" to be arranged in an ...
-1
votes
1answer
448 views

Create plugin/function to catch XML-data via Shortcode

I need to display data from an XML-file inside Wordpress posts, and I want to use shortcodes to do it. I have this XML-file witch I need to get the data from; ...
0
votes
1answer
955 views

Using do_shortcode with variables?

Struggling to get the format right for the PHP in this do_shortcode embed using variables from Advanced Custom Fields plugin. I think I've tried every variation on ., ', and ". After reading every ...
-1
votes
1answer
546 views

Applying if (get_post_meta) to new shortcode

It's my first time here so here goes :) I've created a custom image field which allows me to upload new images, or have images added via a form from the frontend. I want these to display. I'm ...
0
votes
1answer
316 views

Testing for a shortcode using a function. 404 page throwing PHP Notice

I'm using the following function (can't remember where I found it, but I think it was written by pippin so thanks to him) to test for a shortcode. function has_shortcode($shortcode = '') { ...
1
vote
2answers
337 views

How to split <p> text text text </p> into array

I like to output and style in a shortcode, but the content that is get is the content of a page, so it's style like that <p>2012-12-12</p> <p>2012-6-23</p> ...
0
votes
1answer
139 views

Shortcode for tables which can include comma and linebreaks

Is it possible to make a shortcode for table which can include commas and linebreaks for its content? I've been trying to output something like this with shortcode: But it seems difficult. I tried ...
0
votes
1answer
2k views

Add custom attributes to a post

My blog is mainly composed of posts describing hiking. Actually, since I just moved from a Wordpress.com blog to a self-hosted Wordpress blog, every hike is inserted in a simple post. However, every ...
3
votes
1answer
2k views

Using wp_editor in shortcode

I am building a plugin for frontend submission. I am using shortcodes API to display the form for content submission, but I am having troubles. The problem is, wp_editor echoe's data, and shortcode ...