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)

0
votes
1answer
20 views

Return array of values in php

So, following is used in a shortcode: [my_shortcode dfd_name="Steve"] if(strstr($key, 'dfd')) { $metaquery[] = array( 'key' => $key, 'value' => $val, ...
0
votes
1answer
22 views

Shortcode leads to white screen

I have this code to show news in block. but when include this code in functions.php to call it in shortcode. It show me white page and not show me any error. So where is my error? For some reason, ...
0
votes
0answers
13 views

How to prevent shortcode preview from breaking in tinymce editor?

I am creating visual preview for shortcodes (just like captions). I have don't most of the parts but my preview html is getting broke by the editor when post is saved. I have investigate it further ...
0
votes
0answers
23 views

return array when using shortcode

I create my own custom table and and retrieve data and save in to the array variable $take. now when i display this using print_r($take) it will show my all records. but i try a lot to return this ...
1
vote
1answer
19 views

Get new Wordpress slug from old wordpress slug

I have implemented a shortcode called post which contains an attribute src which has link of an of page [post src="http://www.listenmoneymatters.com/the-betterment-experiment/"] Currently, this ...
1
vote
2answers
22 views

Unable to the get the gallery inserted between shortcodes

I am customizing this theme . I am using get_the_gallery() function to get the gallery from the custom post . I am able to do so, but when the gallery is inserted between the shortcodes... For eg: ...
0
votes
0answers
10 views

Prevent WP from wrapping html in caption shortcode after 'image_send_editor' filter is applied

In my functions.php I have cooked up some functions to filter the attachment output code, when an attachment is sent to the editor. function filter_image_send_to_editor($html, $id, $caption, ...
0
votes
1answer
16 views

How to add conent (text) to Add New pages form of admin in WordPress

I am new to WordPress. I have created a Shortcode. Now I want to add description of Shortcode to Pages->Add New Page so the user can easily use the Shortcode which I have created. I want that text ...
0
votes
0answers
18 views

How to wp_redirect on 'init' hook on condition of current post id?

I have made a shortcode, because we can't redirect page within shortcode using wp_redirect so I used 'init' hook to check the $_POST/GET parameter and make system redirect. But I'm stuck in a ...
0
votes
1answer
36 views

change plugin shortcode function [on hold]

i use a plugin that containing this code and i want to change the css and js and template.php location to be located in my template directory instead of plugin without editing the plugin files public ...
0
votes
2answers
14 views

do_action(), iFrame Gets Displayed Despite Password Protection [on hold]

I'm using Advanced Custom Fields and Content Protector plugins in trying to protect an iframe for eventbrite ticket registration that gets displayed through Event Calendar plugin. I believe I'm ...
0
votes
1answer
27 views

$content not null in shortcode, even though it is self closing

I have a very simple setup like this: add_shortcode( 'code', function( $atts, $content = null ) { echo gettype($content); exit; } and contrary to the documentation, even if this tag is self ...
0
votes
1answer
58 views

Multiple loops on page only show taxonomy name of first loop

I have a page with a custom post type called 'books', with taxonomy 'booktypes'. The books are ordered/divided in a loop per taxonomy-item, and added via shortcode to the page editor like this: ...
0
votes
2answers
35 views

Add JavaScript in footer if shortcode used in page [duplicate]

I want to add javascript to page footer if the shortcode is used into the page content. add_shortcode('show-popup', 'show_aip_popup'); function show_aip_popup($args){ // HTML Comes here for ...
0
votes
0answers
12 views

How to use ACF fields inside bootstrap shortcode within template

I'm using ACF fields to setup a custom page template for my Custom Post Type. i am using the Sparkling bootstrap theme. Here is the code I am trying to use in my single-dest.php: <?php echo ...
-2
votes
1answer
20 views

Shortcode Output Always Before Content [duplicate]

I have the following. When I call it, in the page, the content within the page will always be AFTER the plugin rather than before. Please can some help? <?php function ...
0
votes
0answers
29 views

How do you load a stylesheet for just the page that contains a shortcode?

I am working on developing a pluginI've been really struggling with this task, mostly because I've seen so many different ways to do almost what I want, but not exactly what I want. So I've tried ...
0
votes
1answer
38 views

Embedding Instagram via shortcode doesn't work as advertised in official docs

I am coding up a simple Wordpress theme and I would like to embed Instagram images via shortcode as described on Wordpress.com and Instagram.com. (Both links point to the very pages that demonstrate ...
0
votes
1answer
34 views

Enabling shortcodes for custom fields

So, in this post it is explained how to supposedly enable shortcodes for custom fields in Wordpress. (Shortcodes are not enabled for custom fields by default.) What I dont understand is where to ...
0
votes
1answer
10 views

$wpdb returns duplicate posts

I have created a shortcode which shows the posts which were created after the user last logged in. The shortcode is working perfectly fine, but I am not sure why but I am getting 7 duplicate posts. So ...
0
votes
1answer
27 views

Shortcode output appearing at the top of the page only [duplicate]

I've found a few solutions to this but I am echoing some html and I have not been able to put those solutions (to return intead of echo, for example) to use. This is my function: function ...
0
votes
0answers
12 views

How modify gallery shortcode output for admin side

I've been modifying the gallery shortcode output, with remove_shortcode and add_shortcode function. Which works great for the front-end side. But in the admin side, when I edit some pages, the ...
0
votes
1answer
52 views

Shortcode display outside the div

I have created a shortcode that retrives and displays a form.The content of the attribute in HTML. function check_my_login( $atts) { return '<form action="" name="" method="post" ...
0
votes
1answer
26 views

Change shortcode output (filter?)

I'm new to filters and actions and I'm starting to see how useful they are. However I do need a bit of help with the following problem. I'd like to remove the html code from this <?php if ( ...
-1
votes
1answer
43 views

php code to shortcode [duplicate]

So, this is the php code that I have: <?php global $royal_profile;?> <div class="profile-img" data-key="profilepicture"> <?php echo get_avatar( get_current_user_id(), 64 ); ...
1
vote
1answer
63 views

How to use get_media_embedded_in_content function

I am trying to figure out how to use this new WordPress function. get_media_embedded_in_content (string $content); The documentation says, "a string that might contain media data" but that is too ...
-1
votes
2answers
36 views

I've broken the short code for Contact Form 7!

Well I should qualify that title. The shortcode is fine in itself, and no doubt nothing to do with the guys at CF7 causing this issue. I am sure it's me, but it just isn't working after I've added ...
1
vote
1answer
52 views

Set first oembed in post to a global variable or function

I have a function that gets the first oembed in the post. I got the code from this related post. add_filter('embed_oembed_html', 'my_function',10,4); function my_function( $cache, $url, $attr, ...
0
votes
1answer
7 views

Contact form field in wordpress menu

I am trying to insert a simple 1 field contact 7 form into my menu. I have this code working for just text, but if I try to insert the shortcode for the form, I get an error. What am I doing wrong? ...
0
votes
0answers
27 views

Add a product custom field's value to custom tab

I would like to add some custom tabs to the product screen. The values of these custom tabs would be the values of the custom fields assigned to the product. I'm using the following plugin to add ...
1
vote
1answer
45 views

Get shortcode attribute outside of Wordpress

Is there a clean way to get a shortcode's attribute value outside of Wordpress's default behaviour? I am working on a single script outside a Wordpress installation, where I only do ...
0
votes
0answers
15 views

Why can't I type [ ] opening and closing brackets on the Visual tab?

Trying to type [ brings the text area to full screen. Trying to type ] does nothing. It really inhibits my shortcode usage. On the Text tab it works fine, so it's only in TinyMCE. I use an european ...
0
votes
1answer
22 views

wordpress Shortocode running twice?

I developed a plugin for my citrus payment gateway.I created a shortcode to manage it. It was running absolutely fine some days ago.Now I don't know who changed what, now that shortcode is running ...
0
votes
0answers
44 views

Cannot send session cache limiter - Headers Already Sent

Error Messages is as follows : Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at ...
-1
votes
1answer
18 views

Php inside the shortcode is getting commented

<?php echo do_shortcode('[learn_more caption="ancila"] <p> <?php echo get_post_meta($postid,principal_1,true)"; wp_reset_query(); ?> </p> ...
0
votes
1answer
34 views

Next Post links not working in custom post type shortcode

I'm trying to paginate some custom posts types, and the previous link works, but not the next link. I tried several ways but I'm not able to find the correct one... if anyone could help :) This is ...
0
votes
1answer
36 views

template_redirect to accompany with a shortcode

In one of my plugin's shortcode I'm handing user login / registration on the fly with a post submission. So the whole thing is happening within the shortcode like: <?php function this_shortcode() ...
0
votes
0answers
43 views

Short codes not working - not rendering

I have a brand new (few weeks old) Wordpress blog for my lake house. I downloaded a nice theme (Bentuestu) suitable for rental properties and then tried to use the short codes from that theme on the ...
0
votes
1answer
29 views

Iterate through each menu item into a shortcode

Since i cant easily use short-codes in the menu, is there a simple way to iterate through all a menus label through a short-code? For example say i created a few custom link menus with labels of ...
0
votes
0answers
26 views

add_filter post_gallery and do_shortcode

I'm attempting to swap out short codes on the fly but having an issue that I'm hoping someone can help with. Basically I've added a "Gallery Type" option to the wp.media library and am using the ...
0
votes
0answers
12 views

Shortcode and return value? [duplicate]

I have made a shortcode that works fine except that it's always displayed on top of everything. If I for example add som text or images it will be displayed under the shortcode on page where it's ...
0
votes
1answer
10 views

Is there a function to search for a wildcard value when calling a shortcode?

I'm using a plugin to generate a form and rather than inserting the form on to the page using the content editor I'm adding it directly to my template. The problem is that on my local version the id ...
0
votes
0answers
16 views

image map in a widget

I have an image that is inserted in a widget via shortcode. You can see on the bottom-right of footer that the image is actually an image map. My problem is that I have no idea how to hook the map ...
1
vote
1answer
20 views

do_shortcode with custom field

Ok I suck at PHP, so I'll explain this in "English" first then proceed to code. I've got a custom field in my WP DB called ecpt_imdb - this is the numeric value of a movie from the imdB. For example: ...
0
votes
1answer
36 views

How to make shortcode which returns HTML?

I need to make a shortcode button to TinyMCE editor which, in the moment i click it fills up the content part with HTML. When i click on button i need something like: <div> ... </div> ...
0
votes
0answers
32 views

Serializing URL via wp add_shortcode to auto select from option list onload

first time in the wordpress stackexchange community! Great that there is such a thing... Scope: Use of the add_shortcode method to use url string to automatically select options in a scraped table on ...
0
votes
1answer
32 views

Shortcode in a blog post, footer and related products stop working

I have a problem, I develop a shortcode, and it works fine just that when I put it in a blog post, footer and related products stop working. I show you my code I hope you can help me. <?php ...
0
votes
1answer
19 views

How do I use “while” and “end while” inside of the echo do_shortcode with ACF Repeater?

I feel like I’m so close, but just need someone to help assist me with getting this working. I’m using a repeater field with Advanced Custom Fields and am using the echo shortcode, but only need part ...
0
votes
1answer
32 views

Where are theme codes located for WordPress?

New to WordPress. Searched this site and google for an answer to this question; can't even find a mention of what theme codes are. I'm being told by a plugin to alternatively add a line of code to my ...
0
votes
3answers
76 views

php string inside shortcode does not work

I want to automatically get products from woocommerce for a chosen brand, inside a brand's listing on a other part of the site using Sabai Directory. this <?php ...