0
votes
0answers
30 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
41 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
61 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
63 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
39 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
193 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
48 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
69 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
13 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
39 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
44 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
92 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
215 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
78 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
70 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
53 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
0answers
66 views

Most elegant way to create html for shortcodes?

Shortcodes seems to be very nice way to introduce complex features to the content blocks, but I don't like to generate html inside shortcode function. Instead I would like to create template file for ...
0
votes
0answers
53 views

How can I determine if functionality is provided by a plugin or a custom shortcode on another wordpress site?

Recently, I purchased a theme from AIT-Themes.com, a company dedicated to Wordpress theme development. I purchased the Directory theme, and here is a page from that theme I'd like to be considered: ...
0
votes
1answer
231 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
166 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
72 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
147 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
156 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
60 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
745 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
174 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
679 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
131 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 ...
0
votes
3answers
1k 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
226 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, ...
5
votes
1answer
253 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
417 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 ...
27
votes
4answers
4k 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 ...
13
votes
2answers
17k 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
51 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
246 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
87 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
215 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
685 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
825 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
83 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 ...
0
votes
1answer
175 views

Content in WP Editor displayed below CPT shortcode [duplicate]

Possible Duplicate: Shortcode always displaying at the top of the page I've developed a couple plugins which grab CPT items through a shortcode (via WP_Query). The problem I'm having is ...
1
vote
2answers
532 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 ...
0
votes
1answer
74 views

Loop output for custom plugin [solution found]

I am trying to update my plugins to be more user-friendly. One of the things i want to achieve is that i want my plugins output (e.g. for description-fields) to use the full functionality of all ...