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
2answers
12 views

How do I apply style to each category of a list?

I need to create a simple plugin to show a list of categories inside the body of the post and, as I am new to coding, I searched for the basics and started to make little changes; it looks like this, ...
0
votes
0answers
3 views

How to post source code on WordPress.com?

I want to post some code in my blog. In the HTML editor, I write something like this: [code language="java"] System.out.println("some text"); [/code] But when I update the post, I get this: ...
0
votes
0answers
6 views

Adding a query string to product links

I need to add a query string to the end of the links generated by a [products] shortcode from WooCommerce. Each product appears with three links. The image, the title and the add-to-cart button. I ...
2
votes
2answers
91 views

Search & Remove Specific Shortcode From All Posts

Question Is there a way to remove a specific shortcode, say [print_me] from all the posts where it appears in one shot. And I don't mean mask it or filter it so it doesn't show up while it stays in ...
0
votes
2answers
42 views

Why 'do_shortcode' doesn't work in a REST request?

Why do_shortcode doesn't work in a REST call ? In the example below, do_shortcode exists, but the shortcode isn't interpreted. Route declaration /* Adding a route with callback is ...
0
votes
1answer
35 views

Add custom shortcodes to the Welcome Mail

I need to add a custom shortcode to the welcome email of my website. I'm not expert; what I need is in plugabble.php file? I tried a lot of plugins for edit email template but nothing seems work. ...
0
votes
2answers
573 views

Custom registration form in shortcode getting internal server error 500

I created a custom registration form which works fine when used as a custom page template. I needed it as a shortcode so I created a shortcode using the function below /* Custom shortcode */ function ...
0
votes
0answers
26 views

Make shortcode work in all posts displayed by loop, not just the first one

I have a post archive displaying post and author meta at roadtripsharing.com/road_trip I added a do_shortcode(); in the loop, specifically related to the "New Message" button which opens a dialogue ...
0
votes
1answer
10 views

How to enable shortcodes in text retrieved from get_theme_mod

Is there a way to enable shortcodes in text saved in the customizer and retrieved using get_theme_mod? I'm guessing there's a filter in a similar manner to enabling shortcodes in widgets.
2
votes
1answer
661 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 ...
0
votes
2answers
520 views

Image and shortcode not showing in excerpt

I've paid to someone to create a theme for me. Everything works fine, expect the excerpt on category posts. It only shows an excerpt of the post ( not image ) and when I add a shortcode in the ...
0
votes
2answers
465 views

Passing variable as add_shortcode argument

I'm trying to pass a variable into the add_shortcode function to be used as the shortcode name but it does not seem to be working. Is there a way that I can pass a variable similar to this? foreach ...
0
votes
2answers
25 views

Push Shortcode parameter to template

I'm trying to push a shortcode parameter value to a template file but for some reason I can't get the array value that I'm targeting into a single variable. Here is my code and the shortcode I'm ...
0
votes
1answer
432 views

How to insert HTML/CSS/JS into my iframe plugin?

I currently have an iframe plugin that displays on a WordPress page by shortcode. Currently I have been displaying websites in my iframes "src" but I recently came across an issue to display my very ...
0
votes
2answers
419 views

Shortcode to find and replace URL

I'm trying to create a shortcode that will search within some specified text for a link and replace it with one that I specify. For example: [scode]Click on <a href="www.X.com">this ...
1
vote
3answers
4k views

Wordpress removing <p> tags?

I'd already come across a case where Wordpress added <p> tags. However now I'm dealing with the opposite situation. When I add [] shortcodes inside <p> tags WordPress automatically removes ...
0
votes
2answers
31 views

Is it possible to define variables in a wordpress shortcode, and then call the shortcode using a specific variable?

This is my first go at making my own shortcode. What I am trying to do I have 11 different outputs for star ratings I want to be able to use in posts. I want to wrap it all into one shortcode, and ...
0
votes
1answer
38 views

Pull in excerpt with shortcode

I am working with a plugin that provides a shortcode with only a couple of parameters. I'm using [list-shows] shortcode. I would like to also pull in an excerpt of the content. I was able to add in ...
2
votes
2answers
556 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
votes
0answers
28 views

Visual Composer - How do I modify a shortcode after page load?

I have a grid shortcode built in Visual Composer (on a page by page basis) that I'm trying to modify after the page loads. I'm running a few regex statements to make sure it only matches what we need, ...
0
votes
1answer
5k views

Display custom post type with shortcode

I have made a custom post type for my WordPress Theme and a page where the custom post types are displayed. But does anyone know how to make a shortcode that displays posts of a custom post type?
0
votes
1answer
21 views

Is it possible to get a shortcode generated by a plugin, then, using a function, create a new post using that shortcode?

I am planning to purchase a plugin that allows users to create polls and then embed them via shortcode into posts. It looks like a great plugin all around; however, the functionality I would like is ...
0
votes
1answer
32 views

Load next post by ID on a single page

I hope this topic is not duplicated. I see some similar topics but non of them can solve my problem, so I decided to put a new one. Here's the case. I have a single.php post with the defualt ...
1
vote
2answers
751 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
797 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 ...
0
votes
2answers
18 views

How to handle multiple nested shortcodes with different tags?

Hi I'm fairly new to Shortcode programming and was wondering if it is possible to process the following nested shortcode with different shortcode tags: [review] [title]Sample Review[/title] ...
3
votes
2answers
2k views

Customizing gallery shortcode in 3.5

I'm trying to customize the gallery shortcode using the new gallery system in 3.5 and I'm having a bit of trouble and can't figure out where I'm going wrong. This is what I've got at the moment (in ...
0
votes
1answer
16 views

How to reuse php templates as shortcodes?

I want to have a structure like: wp-content |themes |myTheme |page.php |contact.php |break.php In a page from WordPress admin, I want to ...
0
votes
1answer
165 views

How to create a shortcode for custom page template

I have a custom page template and I want it to display on specific pages. The only way I know to do this is to create a shortcode for this custom page template, so that I can use the custom page ...
0
votes
2answers
32 views

Shortcode templates

I don't know if this is the correct way to approach this, but here it goes. I'm working on Visual Composer (but could be vanilla WP), and I'm trying to implement a shortcode which generates another ...
0
votes
1answer
14 views

How do I require a file in a shortcode?

I have a shortcode that is working and displaying the problem is that it jumps to the top of the page. If I have any text or other shortcodes above it in the page editor they will be displayed below ...
3
votes
1answer
1k 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 ...
7
votes
2answers
2k views

How do I escape a ']' in a short code?

How do I escape a right bracket in a short code? I'm working on a Google Map plugin that has encoded points. Sometimes the polygons have the ] in it, which makes WP think that it's the end of the ...
0
votes
1answer
689 views

WP_Editor Shortcode Issue

I have created a front-end editor using wp_editor that functions as it should. Upon testing I have noticed that it is stripping out any shortcodes that have been inserted in the content. I have ...
0
votes
2answers
515 views

HTML Inside of Shortcode Breaks Shortcode Output

Lots of Googling has still not yielded a solution. Here is the problem: I have created a custom Wordpress shortcode to use inside my Thesis theme. The goal of the shortcode is to allow users to wrap ...
0
votes
1answer
555 views

Wpautop stops working after get_the_excerpt

function pre_process_shortcode($content){ global $shortcode_tags, $shortcodes; // Backup current registered shortcodes and clear them all out ...
-1
votes
0answers
24 views

Losing my mind with [shortcodes], Divi Builder, and ACF (Advanced Custom Fields) [duplicate]

If that question title doesn't give you a headache, keep reading.... I have spent the past 12 hours trying to figure out how to keep the layout of the page just like it was with divi builder and ...
-2
votes
0answers
37 views

Is it possible to modify the the query of a plugin's shortcode externally(i.e without touching the plugin's sourecode)?

I'm using the Post Grid plugin which allows me to display my posts in a grid. This works perfectly however I want to create a custom template that displays the most recent post or a post with a ...
0
votes
1answer
33 views

latest posts shortcode with image

I am trying to make a shortcode that will take my latest 5 posts and render them on page. I get all the posts rendered correctly except for the image source, I receive it blank. Is it something I'm ...
1
vote
2answers
16 views

Create a widget to use shortcode?

I have a plugin (Social Warfare) that I love. But, there's no widget available. What is involved in creating a widget so that I can use the shortcode that seems to work fine on the pages and posts?
0
votes
1answer
27 views

How can I create another instance of my custom shortcode

I've created a custom shortcode which takes category slug and number of posts as parameters and creates a loop with WP_Query and outputs the posts from db. But I'm unable to use it more than one time ...
3
votes
2answers
572 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 ...
0
votes
1answer
505 views

Using Custom Post Meta Values in Shortcode

I'm trying to display meta content from a custom post type in a shortcode. I'd like to simply provide a post_id and be able to display all the meta content. [my_shortcode post_id=""] I'm new to PHP ...
0
votes
1answer
18 views

Woocommerce products shortcode specific order

Is there a way to get products in the order of the IDs in the shortcode parameter: e.g [products ids="53,68,1"] Display block with 3 product, where 53 on first place, 68 on second...? Now I get ...
11
votes
1answer
6k views

Solution to render Shortcodes in Admin Editor

I have asked this question about a year ago and I am hoping there is some type of simple solution which will allow me achieve my objective. So here it goes: I often utilize shortcodes within the ...
0
votes
0answers
30 views

Override plugin shortcode declared as a Class

There is a class which is a shortcode from commercial plugin for WordPress I need override method /** * Rendering the shortcode this class is responsible for. * * @return string ...
0
votes
1answer
1k views

Adding shortcode to the main menu

Is it possible to add shortcode to a main menu? I tried the following but no luck? add_filter('wp_nav_menu_items','add_nwadcart_widget_to_menu', 10, 2); function add_nwadcart_widget_to_menu( ...
0
votes
1answer
34 views

PHP/WordPress — How do I check if Shortcode returns content?

What I'm basically trying to do is check if a shortcode is returning any content, I'm using a plugin called Ninja forms and they have default content posting using their own shortcodes which look like ...
0
votes
1answer
711 views

Custom Fields - Boolean Display of True/False to Yes/No

I am importing fields from a Real Estate site. The Import of one Custom Field looks like this... Field Name after Import ---> assistedLiving Field Value ---> false to output the display in ...
1
vote
1answer
2k 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 ...