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)

2
votes
1answer
201 views

Applying filters to the_content() to separate content if any `add_shortcode()` is found?

I don't even know if this possible, with array_map or str_replace, but the idea is the follow: This function gets the content and before is sent out, clean_custom_content, there is where i cant ...
2
votes
1answer
483 views

Wordpress core responsive video not working with shortcode

I cannot get the video from Wordpress core to behave responsively. I'm using the following CSS: .videocontent { width: 100%; height: 100%; max-width: 1024px; margin: 0 auto; } .wp-video-...
2
votes
1answer
1k views

Get multiple shortcode attribute values

I'm trying to get several values from a shortcode. I tried several things without success. The shortcode looks like this: [myshortcode metakey="<field_key:key1, title:Title 1><field_key:...
2
votes
1answer
3k views

Convert shortcode into html form

I want to convert this shortcode. [list-style="one"] a b c d [/list-style] To ouput like this one (html form) <ul class="one"> <li>a</li> <li>b</li> ...
2
votes
1answer
831 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 ...
2
votes
1answer
252 views

Numbering Image List in Gallery

While adding images in a post with the gallery shortcode, I want to display an image number as title of the image e.g if there are 3 images in a gallery and displayed as a list, above each image there ...
2
votes
1answer
389 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" ...
2
votes
1answer
3k 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 back-...
2
votes
2answers
2k 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
2k 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 ...
2
votes
1answer
2k views

Tinymce list of shortcodes button

does someone know about tutorial or how to do button with list of shortcodes in tinymce? For example like in this video http://www.youtube.com/watch?v=DmzUuwW9AU4 (This function in the video is exatly ...
2
votes
2answers
655 views

Conditionally loading Facebook PHP SDK in shortcode

Since 3.3 we can enqueue scripts conditionally right in our shortcode functions, but when I tried to do this with some PHP class (uses session_start() in the __construct() function) as you can guess ...
2
votes
1answer
102 views

Add page title as a javacript variable to specific posts

I'm very new to WordPress and I'm sorry if this question may sound ridiculous. I need a way to add the post title into it's content, only in specific posts, and not always at the same place in the ...
2
votes
0answers
23 views

Remove and restore one shortcode

I would temporarily remove a shortcode, make something and restore it... it's possible? // override default wordpress "the_content" hook remove_filter('the_content', 'do_shortcode', 11); add_filter('...
2
votes
0answers
16 views

Can I strip HTML tags in the “Compare Revisions” screen?

I am building a CMS for content editors that have zero tech savvy. They currently use a system called NewsCred that allows them to compare revisions much like how WordPress does when you visit /wp-...
2
votes
1answer
33 views

Is it possible to add a repeater field to TinyMCE's option window?

I am trying to create an accordion shortcode builder for WordPress using TinyMCE's editor.addCommand / windowManager.open function. I'd like to be able to add a repeatable region within the popup ...
2
votes
0answers
250 views

How to have different captions for same image, for galleries?

Seems like I can't have the same image in different galleries with different captions. Is it possible to make that working in any way? Like if we could change the shortcut code that Wordpress is ...
2
votes
2answers
582 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 ...
2
votes
2answers
281 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, ...
2
votes
4answers
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 ...
2
votes
1answer
2k views

How do i get (unique) page name?

Like from the page of http://localhost/wordpress/about_us/ how do i get only the "about_us" ? Thanks
2
votes
0answers
444 views

Wp_localize_script from Shortcode [closed]

I've been trying for hours and tried several answers from here and Google but still no luck.. need help. I am making a shortcode (slider) and trying to execute a javascript file (for the slider's ...
2
votes
1answer
681 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 ...
2
votes
1answer
613 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'); ?><...
2
votes
3answers
1k views

change wordpress gallery shortcode to slider

Hi I wanted to change the default WordPress gallery short-code and make it a slider. remove_shortcode( 'gallery' ); function gallery_filter( $atts, $content = null ) { extract(shortcode_atts(...
2
votes
1answer
276 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 ...
2
votes
3answers
4k views

Custom form, shortcode, and submit handler

I have a frontend form with a bunch of input. My requirements force me to use a custom shortcode to create the form. I have already tested a page with that shortcode. Here's my : <form name="...
2
votes
1answer
200 views

Browser title script ignoring is_page /else conditional [closed]

I've used this code to stipulate different separators for different pages in my clients site: <title> <?php if(is_page('Portfolio')){ wp_title( 'of', true, 'right' ); echo ...
2
votes
3answers
4k views

Using Shortcodes in WP-Menus in WP 3.1 (via nav_menu_objects)?

I've found this new plugin http://wpsmith.net/wordpress/creating-multiple-custom-menus-in-wordpress-3-1 that is using a new 3.1 hook (wp_nav_menu_objects) to remove specific nav-menu-items from the ...
1
vote
3answers
152 views

What is a short code?

I am new to WordPress and I've seen this term passed around.
1
vote
2answers
2k views

Removing Shortcodes from Child Theme

I'm trying to remove the shortcodes from a child theme. In my functions.php file (for the child theme), I've put: function my_remove_shortcode(){ return ''; } add_shortcode('entry-twitter-link', '...
1
vote
3answers
1k views

stray <p> elements

I coded a wordpress shortcode for columns that basically inserts html via a shortcode. Problem is that wpautop adds stray p elements that renders the code invalid. To test put this into your ...
1
vote
1answer
330 views

shortcodes displaying outside of content area with echo statement, not what I wanted [duplicate]

Possible Duplicate: Shortcode always displaying at the top of the page I have my shortcode system set up fairly normally, like so: //[carouselle] function carouselle_func( $atts ){ return "...
1
vote
2answers
129 views

Change link in get_terms if there is only one post in the category

I created a shortcode that will list the categories in my custom taxonomy and will return a list of all the categories that have at least 1 post (not empty). The result is that when someone clicks on ...
1
vote
3answers
1k views

Shortcode doesn't work if I directly paste its function in a template file?

This is a shortcode to add a question form in the Question and Answer Forum plugin for Wordpress: [question_form width=\'x\' bordercolor=\'x\' style=\'x\']question form title[/question_form] This ...
1
vote
1answer
34 views

Custom Shortcode, functions PHP WP_Query loop

I have the following code in my functions.php file:- function featured_properties_func( $atts ) { $args = array( 'posts_per_page'=> -1, 'post_type' => 'properties', ...
1
vote
1answer
586 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 ...
1
vote
2answers
462 views

Generate Shortcodes by Taxonomy

Check this code: function slide_group() { register_taxonomy('Group', 'slides', array( 'hierarchical' => true /*visualizza come le categorie*/, 'label' => '...
1
vote
1answer
334 views

Gist shortcode is not working

I freshly installed a brand new Wordpress for testing purpose as I am intending to refresh my current website. One of the requirement I have is to be able to embed code from Gist. Following the ...
1
vote
2answers
878 views

wp_nonce_field displaying twice

I have wp_nonce_field in my code but it's creating two instances to the html code for some reason, one where I'd expect it and another at the start of the entry. Is this correct or am I doing ...
1
vote
3answers
2k views

How Can I Pass the Shortcode's $atts Variable to the Plugin's Javascript Function

I need to pass a plugin's $atts variable to a javascript function, but I'm not sure how to do it. The javascript function needs the shortcode's php latitude variable in order to build the map. My ...
1
vote
2answers
425 views

Inserting shortcode [stream /] into a Text widget

hi i'm trying to insert a short code into a Text widget but all its doing it showing the code and not processing it. <?php echo do_shortcode(' [stream embed=false share=false width=500 height=560 ...
1
vote
2answers
101 views

How can I get the [video] shortcode to allow query string parameters?

Using WordPress 4.4.2 (latest version as of writing this) I'm trying to use the [video] shortcode to show a video on my site. If I provide a url ending with the filename.mp4 it works fine: [video ...
1
vote
1answer
106 views

Why is my shortcode not working

Im making a custom shortcode for my wordpress site and im just running through the example from the shortcode api for wordpress: function myshortcode() { $atts = shortcode_atts( array( '...
1
vote
3answers
80 views

Shortcode output is screwed up when arrow symbol “<” is present in content

I have a very simple shortcode to print some text using pre tags function term_shortcode( $atts, $content = null ) { return "<pre>" . htmlentities($content) . "</pre>"; } ...
1
vote
1answer
41 views

Can't understand $atts in functions?

I'm not sure if I don't fully understand the basics of functions in php or maybe it is WP convention that I am not sure of. My question is why use an argument in a function when it is not going to be ...
1
vote
1answer
120 views

Making Quote Plugin more efficient

I've been working on this plugin the past couple of nights and have been jotting down idea's of how to improve it. My knowledge of php isn't the strongest and I'm learning as I go along most of the ...
1
vote
1answer
160 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 ...
1
vote
2answers
366 views

Displaying a random user with a shortcode

I'm trying to setup a shortcode to show a single random user each time the page is refreshed. I've been successful in displaying all users or a select user by the user ID. Here is my shortcode as it ...
1
vote
1answer
446 views

Are .MP3 files with capital letter extensions allowed in [audio] shortcode?

In WordPress 3.6, using the new [audio] shortcode, I can add a player for an .mp3 file like this: [audio src="http://example.com/audio_files/test.mp3"] However, if the .mp3 file has capital letters ...