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)

3
votes
1answer
811 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 ...
2
votes
1answer
98 views

Extending the Audio Shortcode

At the moment, the audio shortcode only allows four attributes, src, loop, autoplay and preload. When you upload an audio file however, it comes with pretty useful meta data such as the album art, ...
1
vote
1answer
19 views

Is it important to sanitize inputs in a shortcode that will be used in site that only I will post to?

Is there any security risk in not sanitizing shortcodes in a wordpress site if I am the only one who has access to the admin panel?
1
vote
1answer
9 views

Forcing max-width for image captions

I've implemented a filter to my image captions based on this question I asked a few days ago. How can I slip into the caption the css style of max-width as well? I think it can be done with ...
1
vote
1answer
48 views

How to get shortcode working from custom meta field

I've created a simple text custom meta field for pages. I can successfully enter plain text which prints on the frontend of the site with no problem. I want to add shortcodes also. If I add a ...
1
vote
1answer
56 views

Adding javascript actions to words in post content

I would like to have my blog run some JavaScript code when certain particular words are clicked on. One approach would be to include "onClick" handlers in HTML elements within the posts and disable ...
1
vote
1answer
51 views

How to Reference/Echo Variable from Another PHP Function

I have successfully set up a PHP function for my blog posts to create a shortcode to automatically display/style an iFrame tag for a YouTube video, as well as pull in the duration and view count ...
1
vote
1answer
108 views

Can I wrap an unordered list inside a shortcode?

So, I created an events page for my client that holds lots of details about events. We found no particular event plugins to be helpful for their purpose, so I built a a custom template using advanced ...
1
vote
1answer
88 views

esc_attr not working in shortcode

I have a shortcode that outputs a block of html. One element in the block is an anchor tag with an image caption in the title attribute. Some of the captions I am using have double quotes in them, so ...
1
vote
1answer
186 views

Remove specific shortcode from get_the_content()

I have a variable like this: $post_content = get_the_content(); Here i want to remove some specific shortcode from the $post_content variable e.g i want to remove only this [video height="300" ...
1
vote
1answer
52 views

Shortcode for latest -not expired- posts

I've made a short code (part of a plugin) to display the posts which aren't expired. For saving the expiration date, i made already a meta key called newsbox-date. Handy for micro-news, short ...
1
vote
1answer
320 views

Shortcode are not working in Option tree textarea

I am using option tree. In textarea, i place shortcode [layerslider id="1"] its not working, i also found same post replied by plugin author allow shortcodes in textarea in option tree applied ...
1
vote
1answer
1k views

Audio and video shortcodes not working properly

I'm having some trouble with Wordpress's built-in shortcodes for audio and video. When I embed a video, it basically gives me a black box and has a link to download the file at the top; when I embed ...
1
vote
1answer
245 views

Stray closing paragraph tag when using shortcodes

I'm using a basic shortcode to wrap some text in an expandable div. What appears to be happening is that the wpautop is inserting a stray closing paragraph tag at the beginning and a stray opening ...
1
vote
1answer
454 views

Shortcode in AJAX popup

I am trying to use a shortcode from Ultimate Facebook plugin to display a FB connect button in an AJAX popup and can't seem to get it work properly. I searched and used the solution given by djb in ...
1
vote
1answer
52 views

Plugin Handle URL With Custom Theme

I need to develop a plugin in which a special page needs to be created. This page will have a completely separate design from the rest of the website, and will be located at a specific URL. I realize ...
1
vote
1answer
136 views

Gallery shortcode numerical sorting

When I try to sort a Gallery created through the [gallery] shortcode by numerical titles I get them sorted in alphabetical order. That means that they are sorted like so: 1, 3, 34, 4, 56, 6, etc. ...
1
vote
1answer
371 views

wp_specialchars and wp_specialchars_decode in a shortcode plugin

I have written my first plugin, a shortcode plugin. I have read about wp_specialchars and wp_specialchars_decode but I'm not sure how to use them. The plugin read a shortcode allowing some parameters ...
1
vote
1answer
139 views

Processing shortcodes in groups (separated by line breaks)?

The Project I'm working on a plugin to resize and embed rows of images using shortcodes that will be converted into <img> tags. In most cases there will be multiple images per row, and the ...
1
vote
1answer
239 views

Raw output (preventing wpautop)

Using WordPress 3.5. I'm trying to put a <form> into a Page of a WP-based site. Unfortunately, WP is "helpfully" screwing up the formatting of the form by inserting <br> and <p> ...
1
vote
1answer
104 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 ...
1
vote
1answer
591 views

Pagination in a Shortcode. Get_next_posts_link not working but get_previous_posts_link works fine right next to it

I'm trying to output a custom post type archive using a shortcode. Everything works fine except for the get_next_posts_link part. The weird part is that it's right next to a get_previous_posts_link ...
0
votes
1answer
15 views

Video Shortcode Only Returning a Link

I am trying to dynamically load a video in the media library using the built in MediaElement player. To do this, I am using the do_shortcode() function to run the [video] shortcode and build up the ...
0
votes
1answer
19 views

Correct way to pass information between seperate shortcode functions

I contain all my short-codes in (the equivalent of) functions.php. I want to have one short-code function share information in an object, and another able to access that object. The shortcodes may or ...
0
votes
1answer
31 views

the_content() shows shortcode instead of parsing it

I'm loading a given post data via Ajax. The problem is that a plugin's shortcode is not parsed. The plugin is "Ninja Forms". It outputs [ninja_forms_display_form id=5] Instead of rendering the ...
0
votes
1answer
37 views

How to create a shortcode for embedding pdf in iframe?

General information I am creating a site with WordPress. For the content I want that the PDF files can be embedded inside an iframe. So I first created a WordPress function to hook in ...
0
votes
1answer
20 views

Multiple level shortcodes

I am working on a plugin and stopped in a situation, I hopesomeone can help me with a solution. I want to have a shortcode structure like : [shortcode_1] [shortcode_2] [shortcode_3] ...
0
votes
1answer
22 views

Class variables in shortcodes

Don't know what I'm doing wrong but, I have the following code: class the_shortcode { //Define Class Variables private $var; public function __construct() { ...
0
votes
1answer
19 views

Visual Composer integration

I've installed Visual Composer on my own template. The thing is that is not rendering all it's shortcodes. <?php $post = get_post( $post->ID ); echo $post->post_content; ?> Is that ...
0
votes
1answer
22 views

How wp maps urls into files

I am trying to understand how wordpress works. I have found this line of code in my theme: <?php echo get_permalink(get_option('Theme_search_page_id')) ?> If I get the that option from mysql ...
0
votes
1answer
24 views

Display title of child pages in shortcode

I'm having a hard time figuring out how to display the title of the childpages as the id of a div. Assuming that 'news' & 'othernews' are siblings of the parent page home (39) I want something ...
0
votes
0answers
777 views

Get page content and execute shortcodes on a page

I would like to get show multiple page's content on one page with shortcodes. If I use return $html; the shortcodes not working, if I use return do_shortcode($html); the shortcode working, but the ...
0
votes
0answers
306 views

Progress bar - JS + CSS

I'm trying to implement a progress bar to wordpress. Exactly this one : http://workshop.rs/2012/12/animated-progress-bar-in-4-lines-of-jquery/ php shortcodes function progress_bar( $atts, $content ...
0
votes
0answers
188 views

Plugin or shortcode for ISBN number?

I have a Woocommerce site with a catalogue of books. Each book has an ISBN (or EAN) number entered in a custom field. I need to do two things with the ISBN, and I don't want to have to manually ...
0
votes
0answers
230 views

Creating tabs shortcode

<div id="tab-side-container"> <ul> <li><a href="#side-tab1">Tab 1</a></li> <li><a href="#side-tab2">The Second Tab</a></li> ...
0
votes
0answers
218 views

Get ID of the page where shortcode is included

I have a page with a shortcode that uses get_the_ID(). The shortcode displays custom fields from the current page. When I include that page within another page, get_the_ID() returns the ID of the ...
0
votes
0answers
63 views

Use shortcode as parameter for another shortcode

I'd like to use a shortcode as a parameter to pass to another shortcode: [google_map address="[content field='address']"] However, this outputs a blank map plus this string: "] I've looked in both ...
0
votes
0answers
57 views

Display certain category in a page

Is there any way to display certain category name in a page via shortcode? Edit: I have plugin which displays posts in pages by shortcode [display-post id=id of post]. I would like to have similar ...
0
votes
0answers
55 views

using enqueue_script in a shortcode isn't working

I'm new to wordpress and I'm trying to get this to work by following the wordpress codex but I feel like I must be missing something obvious. I have a child theme based off of a parent one, and I ...
0
votes
0answers
64 views

Code auto escaping is not working when using short codes

I'm using this ages old, but still well working, plugin (source code here) to auto escape html inside <code>. All is well and good until I tried to use short codes to form the ...
0
votes
0answers
25 views

Shortcode for sectors

We've been given a WordPress site that has the following shortcode in the body of the page. [show_case_studies post_type="case-study" posts_per_page="15" order="ASC" orderby="menu_order" ...
0
votes
0answers
344 views

Shortcode not working in custom post types

I have created a shortcode and placed it in my functions.php and registered it with: add_shortcode('featured-attribution', 'gteh_author_shortcode'); It works fine on posts and pages. I created a ...
0
votes
0answers
137 views

Passing a location-dependent array via wp_localize_script within a shortcode

I have created a shortcode that is intended to be inserted into custom field of a music custom post type. The shortcode is coverted into an audio playlist using the jplayer jquery plugin (and it's ...
0
votes
0answers
177 views

Str_replace using shortcode with multiple changes

I am using a feed importer plugin which gives the option to use a short code in case I need to change data (in this case data for a custom field) on import, using for example: ...
0
votes
0answers
27 views

php within a shortcode within php

I've been trying for ages to get this work, but to no avail! Any help would be greatly appreciated. <?php echo do_shortcode("[thumb]'".bp_profile_field_data('field=3')"'[/thumb]"); ?> ...
0
votes
0answers
66 views

Custom field for default gallery

How I can add custom field in default WordPress gallery? in visual editor and in shortcode.
0
votes
0answers
53 views

Can't seem to get [shortcode]s to work

function register_shortcodes(){ add_shortcode( 'my_shortcode', 'my_shortcode' ); } add_action( 'init', 'register_shortcodes'); function my_shortcode( $atts ) { return "--my_shortcode--"; ...
0
votes
0answers
44 views

Run function from parent on child site

I'm running a Multisite WordPress installation and have a couple of child sites. I'm trying to run a script from the main page on one of the child sites. It can be a shortcode [pro_display_zone ...
0
votes
0answers
186 views

Creating a costing calculator plugin. How can the user create the calculations without coding?

I am relatively new to php & wordpress development. I am trying to create a plugin that allows the user to create an unlimited number of costing calculators. Users will be able to add fields ...
0
votes
0answers
58 views

How can I join the two key with the two value of a custom field?

I am using wp add custom field with images and text multiple time .. how can join to have the key and value in the same div ? <div id="Caption-custom" class=""> <?php $text = ...