0
votes
0answers
13 views

template redirect is not working from within a shortcode

I am new to WordPress. I want to show a custom template of a plugin using a shortcode. This template has my own login form with my own header and footer. I am using the following code: add_filter( ...
0
votes
1answer
26 views

Input with spaces in Shortcode attributes overwritten by defaults

question seems to be similar to the one asked here but the answer went down a different path. Pretty much if a user enters a shortcode attribute with a space it will get overwritten by the default ...
0
votes
1answer
16 views

Children Shortcodes?

I started creating WordPress plugins a few weeks ago, and I would like to know if it's possible to somehow "embed" shortcodes in some others. Basically what I want to do is create a table or a list, ...
1
vote
1answer
31 views

How to create a custom shortcode based on the layout?

Hi I am developing a custom post type plugins. Which has shortcode support. Already i have created a shortcode which is going to use for default layout design. Again i have to create a onemore ...
0
votes
0answers
44 views

How to structure WordPress plugin to display data from API

I am creating a plugin that connects to a remote API that has car listings and displays the data that's returned in that call. The plugin essentially does not need to interact with the WordPress ...
0
votes
0answers
31 views

User added CSS to alter shortcode

I am creating my first plugin and so far it has gone well. It is very simple thing that calls the css file up and allows users to add shortcodes which will then create different colored backgrounds ...
0
votes
1answer
50 views

Wrapping shortcodes in another shortcode

I'd like to wrap existing shortcodes in post content inside a new shortcode that I'm adding to my plugin. The existing content looks like this: Some text - could be <span>HTML</span> or ...
1
vote
3answers
120 views

Checking if an attribute exists in a shortcode

I've written a small plugin that spits out html for a button. It works great, except for one thing: If the user doesn't specify an image, the image appears broken. Is there a way for me to check and ...
1
vote
1answer
72 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 ...
0
votes
1answer
45 views

Why function hooked using object are executing at all time?

I tried to use class and object in plugin. I made a simple function with a shortcode but it is executing the function without pasting the shortcode to any page/post. class example{ function ...
2
votes
0answers
272 views

Custom media upload content for inserting custom post shortcode

I’m working on a plugin that creates custom post type “portfolio” along with shortcode to insert in any page or post. The shortcode is: [portfolio option1=“1” option2=“0” option3=“1” ] And it works ...
0
votes
1answer
61 views

Shortcode registered from a plugin not recognized

I'm coding a really simple plugin to add some slideshows to my theme. I also want to register a shortcode to invoke them from my pages. So far I have this: class Slideshow { public function ...
0
votes
0answers
93 views

WP sql query to extend Groups shortcode to return list of users AND usermeta

This is a question related to an answer posted here The above solution outputs a list of a specified Group members' display names. I need to extend it to show 2 user fields and 1 usermeta field. So ...
0
votes
1answer
18 views

Including template in shortcodes

I am creating plugin that display a quotation From. public function qt_shortcodez() { $QT_Options = get_option("qt_settings"); $Form = '<table> ...
0
votes
0answers
46 views

Wordpress - Shortcode or Merge tags

I want to use shortcode feature. The only issue is that, I am having multiple parameters. The code I have till now is : add_shortcode('lorem', array(&$this, 'lorem_function'), 10, 1); ...
0
votes
1answer
52 views

Modify a plugin function output from another plugin

I'm writing a plugin for a wordpress site using a page template using WP Types plugin. My plugin adds a shortcode tag. Shortcode tags inside 'the_content' get processed without problem. But this ...
0
votes
1answer
128 views

Form submission to another page returning 404 error [duplicate]

I'm modifying a form plugin, and trying to have it submit to another page chosen by the user. Right now the page it submits to is page_id=6. If I navigate to this page myself, it prints Array(). When ...
1
vote
2answers
283 views

enqueue script only if it is not already enqueue

I want to include a script in a shortcode output, so I am trying this: function my_shortcode( $atts, $content = null ) { extract(shortcode_atts(array( 'title' => '', ), ...
0
votes
0answers
6 views

Shortcode executing order wrongly [duplicate]

Is there any order an short code should execute? When i inserted it at the end, it is shown at the beginning of the post
0
votes
1answer
99 views

Passing values between enclosing and enclosed shortcodes

Is there a way to pass data between the enclosing and enclosed shortcodes? For example, I would like to do something like: [boxes per_row=4] [box]foo[/box] [box]bar[/box] [box]baz[/box] ...
0
votes
0answers
77 views

How to detect shortcode usage, submit a form from widget to that page?

I've created a plugin and now want to create a widget containing a form that will submit to the page where my plugin shortcode is embedded from any wordpress page on the front end. I assume that ...
0
votes
1answer
59 views

Identifying a Page Containing Shortcode at `init`

I am writing a plugin and I am having some difficulty with when to trigger specific functions of the plugin code. /* // Plugin information goes here */ // ***** Area A $GLOBALS['example_class'] = ...
0
votes
1answer
304 views

What is the difference between Null vs Empty (Zero Length) string?

In a shortcode context, is there any difference here? array( 'slideshow' => '', ), and array( 'slideshow' => NULL, ), Is there a best practice for that?
0
votes
1answer
186 views

Cannot echo a JS variable to a jQuery plugin coming from wp_localize_script

Short version: I'm able to get a PHP variable into a JS file using wp_localize_script. On JS file i'm able to echo the variable using console.log, but I cannot get it echo into the jQuery plugin's ...
0
votes
1answer
77 views

How to show custom taxonomy child posts through shortcode in WordPress

My question: I have custom taxonomy in WP named Videos and childs of this taxonomy named music-videos and game-videos. In my WP theme this is shortcode which shows ALL video posts from main taxonomy ...
0
votes
1answer
2k views

Auto Gallery from folder contents

I need to be able if this is possible, (i am a newbie at this so please take that into consideration) I want to create a Wordpress shortcode that will add an automated gallery of the contents in a ...
1
vote
1answer
166 views

Are shortcodes case-sensitive?

If I write a plugin and register a shortcode using this code: add_shortcode('footag', 'footag_func'); and a user uses this in their post: [FOOTAG] Is it supposed to work?
1
vote
2answers
38 views

Secure Pages Best Practice

I am in process of writing a plugin that has front-end shortcodes that display a user's information/data. If the user is not logged in, I need to redirect to a front-end login page/form. What would ...
0
votes
1answer
173 views

Front-End Form Submission in Shortcode

The plugin I am working on contains shortcodes with forms on them. Upon form submission (POST), I do some database work, and then planned on redirecting to another page after the db work is complete. ...
1
vote
1answer
38 views

Allow users of my plugin to define their own shortcode rather than use mine?

I'm creating my first plugin. So far everything is great, but my shortcode is something like this [BIMS] and that acronym might not be easy to remember, or appeal to everyone. I'd like to include an ...
0
votes
2answers
61 views

How to handle shortcodes through plugin

I learned that I can only put in the code for handling my shortcode through the theme's functions.php But I was thinking of making it a plugin rather than a theme. How can I achieve that?
2
votes
3answers
949 views

Shortcode adding p and br tags

I apologize as I realize this has been asked before and I believe the issue is with wpautop function adding closing p or br tags but every solution I've found has not worked so I'm at a loss for ...
0
votes
1answer
185 views

Multi-part form and wp_redirect()

For starters, it's a plugin (with a shortcode) or at least I would prefer it to be. I've got two issues both related to wp_direct. If form 1 validates I want to redirect to form 2, and continue the ...
0
votes
1answer
876 views

Shortcodes, output buffering, and WordPress functions

I have a couple of long forms which I want to output as shortcodes. Shortcode API indicates that If the shortcode produces a lot of HTML then ob_start can be used to capture output and convert ...
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
3answers
2k views

Multiple Parameters for a Shortcode

I am working on building some shortcodes for my blog. I can set a single parameter for my shortcode, but not sure how to set different parameter. For example, I can use [myshortcode myvalue] to ...
-1
votes
1answer
31 views

Developing a wordpress.com shortcode [closed]

I am looking to develop a shortcode that all wordpress.com users can use. Should I proceed with developing a plugin? I know users on wordpress.org can use the plugin but I am confused on how to make ...
0
votes
1answer
253 views

Wrap text around shortcode

I use a shortcode handler in my plugin. The shortcode can have different (optional) parameters. And it should be possible to use for example 2 shortcodes on a static WordPress page with text before, ...
6
votes
1answer
272 views

Optimize shortcode callbacks

I created a plugin to add some shortcodes in my WordPress site. But I'm a PHP newbie, so I believe it may have some errors or ways to optimize it. It's working fine, and apparently there are no ...
0
votes
2answers
514 views

add short code not working

I am new to wordpress, I am creating a plugin and for the short code, I am using the short code api. But when I insert this shortcode in my page, it displayes as it is, it does not display the ...
28
votes
4answers
6k 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 ...
14
votes
2answers
19k 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
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 ...
1
vote
1answer
269 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 ...
1
vote
1answer
91 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 ...
0
votes
1answer
218 views

Create Widget or Enable Shortcodes in Sidebar

I'm well aware that WordPress by default does not process shortcodes in the sidebar. My question is why. I'm building a very small plugin that exports some content when the shortcode is present. This ...
-2
votes
2answers
762 views

Shortcode attribute “title” doesn't appear in $atts array

In a post, I have this text: [bhours shortcode="test" title="test"] But the "title" attribute appears to be ignored. Here's a var_dump of the $atts attribute array array(1) { ["shortcode"]=> ...
1
vote
1answer
1k views

add_shortcode() not working inside of function

I have a custom post type bhour, with a field bh_shortcode. When a post of this type is saved, I'd like it to add a shortcode based on the post's value of bh_shortcode. If the value of bh_shortcode ...
1
vote
2answers
1k views

PHP error with shortcode handler from a class

Currently i am using the following generic flow for adding the shortcode for a plugin. class MyPlugin { private $myvar; function baztag_func() { print $this->myvar; ...
3
votes
2answers
87 views

How do I make specific plugin functionality apply to different sites in a network?

I have a site specific plugin that I've written for the main site in my multisite network. Now I realize that the shortcodes that are in the plugin are also useful on the sub-sites, however the ...