WordPress Plugins allow easy modification, customization, and enhancement to a WordPress blog. Instead of changing the core programming of WordPress, you can add functionality with WordPress Plugins.

learn more… | top users | synonyms (1)

0
votes
1answer
126 views

How to add more than 1 user role to sub-menu pages

I create a plugin with 6 submenu pages. I need 4 of them to be accessible by administrator and a custom user role i created say 'coach' user. Then the 2 of them to be accessible by administrator and ...
0
votes
3answers
162 views

How to make method from plugin available in theme?

Let's say this was in my plugin: class pluginslug_foo { public function bar() { //stuff } } and I wanted to make the method bar available for use outside of the plugin, for ...
0
votes
2answers
551 views

How can I track active users of my plugin? and why doesn't WordPress.Org offer this?

It seems every major app platform from Android to iOS has great stats for developers. However, if you publish a plugin via WordPress.org you are not allowed to include any 3rd Party tracking code (for ...
0
votes
2answers
3k views

Set first image (external) as featured image / thumbnail

I've read through a lot of code snippets now and it seems like wether I'm to stupid or there is no solution for this. I have a setup where some information for a product is loaded via amazon API if I ...
0
votes
2answers
826 views

How to add pages to custom menus on the fly [duplicate]

Possible Duplicate: Can I add pages to my custom menu via script? My theme has a custom menu called "Custom Header Menu" and i've got a plugin that sets up site defaults and creates my ...
0
votes
3answers
394 views

Adding admin menus to wordpress

I am trying to add a menu box to Pages > Pages or Pages > Add New, basically whenever they access a page, be it to edit an existing page or add a new one, I would like to add a menu box under ...
0
votes
2answers
603 views

Possible to preset a widget's contents via a plugin script?

This plugin is a simple demo test to see if I can dynamically populate a pre-existing widget area with text. In this case, my theme has created the widget area "home-header-widget" and I'm trying to ...
0
votes
1answer
615 views

How to preset a sidebar widget with default content via script?

I'd like to add some code to my plugin populate a specific sidebar (if it exists) with a text widget containing preset content. Assuming that the sidebar I'm trying to preset is referenced by ID as ...
-1
votes
2answers
67 views

Fixing plugin for wpdb::prepare

A previous developer created a plugin for a website I manage and everything seems to work okay, except I'm getting the error "Missing argument 2 for wpdb::prepare()". I understand that the arguments ...
5
votes
2answers
1k views

How to provide translations for a WordPress TinyMCE plugin?

I know that I can get my translations into JavaScript doing: $MyTranslations = array( 'translation1' => __("Some String 1", "MyTranslations"), 'translation2' => __("Some ...
4
votes
3answers
355 views

Trouble with Transient API when W3TC is activated [closed]

I'm using W3 Total Cache 0.9.2.11 on Wordpress 3.5.2. I've got a problem with transient API and w3tc's object cache setting. When I activate 'object cache' with memcached (other settings are ...
4
votes
4answers
2k views

Where to put third party PHP library?

I'm developing a couple of open-source plugins and a theme (all part of a "suite") that all use the same third party PHP library. I'm wondering what is the best way to include it in Wordpress. Here ...
3
votes
1answer
603 views

PHPUnit testing WordPress Plugin

Using answers on this site and from other resources, I have started writing my next plugin using PHPUnit tests and the WordPress test environment. Distilling down what I have in my plugin's ...
3
votes
2answers
526 views

Re use authenticated HTTP connection or cUrl handle

We have a bespoke Wordpress plugin, which adds a meta box to the edit post page. The plugin accesses data from a semi-private HTTP REST API. The connection is authenticated (DIGEST) and accessed ...
3
votes
1answer
593 views

Error with Custom Admin Screen in iframe Thickbox

I have a plugin that adds a new admin screen in an iframe. I created a PHP file in my plugin, and I put a link with a class of Thickbox to that. Everything works just fine, but it produces a PHP error ...
3
votes
1answer
445 views

WordPress adding <br> tags into plugin content

We've written a plugin that shows reviews upon usage of a shortcode. On some sites, Wordpress is adding <br> tags throughout the shortcode content, and others it does not. The shortcode works ...
3
votes
2answers
3k views

Add a jQuery function to admin pages

I need to add a bit of document ready jQuery to post/page editors in admin. I'm hacking an old plugin that adds a text box to the editor page and handles inserting that text in a template file, but ...
3
votes
1answer
436 views

Build path for a custom portfolio plugin

I'm finishing up a personal site that I've spent many weekends on. I've left one of the (potentially) most complicated parts to the end of production. I'm looking for some advice on how to proceed ...
3
votes
1answer
410 views

How Does Wordpress Uninclude/Deactivate A Plugin?

Wordpress uses the Observer Pattern for its plugin system and operates on the premise of checking if a plugin is activated, scanning the plugins directory and storing everything in an array in the ...
3
votes
3answers
8k views

Wordpress Vote Plugin - Vote Once and Track User

I've been looking through voting plugins and cannot seem to find one that works for me. I'm hoping you can help me out before I have to build my own as I'm tight on time. I have a page that will be ...
2
votes
3answers
2k views

Where, When, & How to Properly Flush Rewrite Rules Within the Scope of a Plugin?

I am having a bit of a strange issue with rewrite rules not flushing properly. I have tried using flush_rewrite_rules(); and flush_rewrite_rules(true);. I have also tried globalizing $wp_rewrite ...
2
votes
1answer
163 views

Custom admin column disappearing when using Quick Edit [duplicate]

I have added a featured image column to my posts in the WP admin. This all works fine except when using the Quick Edit feature. Upon update, the column disappears, or rather isn't returned by the ajax ...
2
votes
1answer
34 views

Make the plugin directory recognize new version numbers

I updated readme.txt Stable Tag and tagged versions 0.2, 0.3 and latest 0.3.1 in SVN. After checkin, the new version is recognized only partly: On the dev-tab it links to the latest version (0.3.1) ...
2
votes
3answers
953 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 ...
2
votes
1answer
381 views

Save HTML formatted data to post meta using add_post_meta()

Array ( [post] => Array ( [jw_objective] => Exposure to e<b>nd to end development</b> of various applications; right from requirement analysis to system ...
2
votes
2answers
183 views

Multisite, sharing content by URL

I have a network of two sites, A.example.com and B.example.com. I'd like it so that if I create a page on A with a permalink of /Widgets I can access it on B using the same relative permalink but ...
2
votes
1answer
494 views

How to use the settings API to set multidimensional arrays

I'm writing a course information plugin. Most course info is related to to a post (a custom post type of 'course'), so I have put the majority of info in the postmeta table. But some info isn't ...
2
votes
1answer
228 views

Scheduled event does not run at midnight

I have an event scheduled to fetch feeds from different sources at midnight. I believe for some reason it is not being triggered. I use Core Control plugin for testing. When I 'Run Now' through it, ...
2
votes
1answer
533 views

When to check if a function exists

I've just started developing a WP plugin, and i've been reading some code from other plugins as a way to get started. I've seen a couple of plugins that wrap all or some of their functions in the ...
2
votes
1answer
801 views

How to duplicate custom menu settings to export to another site

I'm trying to write a routine that will pull items from the wp_options table in order to transport them to another site. The problem I have is that if the source site has custom menus, I'd like to ...
2
votes
3answers
716 views

How to: get main plugin/theme file?

There're the functions get_theme_data(); & get_plugin_data(); - which both use get_file_data(); that needs a specific file as $input. I got a set of classes that may be used by a plugin or a ...
1
vote
0answers
20 views

Modify how gallery.js builds the shortcode [gallery …] in tinyMCE?

The post editor helpfully removes default arguments like columns="3" from the [gallery] shortcode. How do you tell it to remove a custom attribute that has a default value? The answer at Enhance ...
1
vote
1answer
329 views

Wordpress metabox file upload in custom post [duplicate]

I'm relatively new to wordpres development and am stuck at this issue. I have created a custom post type which shows up in the admin menu. I need a metabox in it with a file upload field. The metabox ...
1
vote
1answer
179 views

Saving Plugin settings to the database

I'm not a complete novice with php or wordpress but am wanting to approach this problem the most efficient way so believe asking here will help. I've got a plugin that randomly generates a quote - ...
1
vote
1answer
250 views

Hello dolly type plugin that allows people to add their own

I am making a plugin that shows a random joke on a custom 404 page via shortcode and it is basically near enough the same as the default hello dolly plugin, where the jokes are hardcoded into the ...
1
vote
1answer
78 views

Common functionality between my own plugins

I read that when creating new post types, creating a settings page, and creating a new taxonomy, you should create a plugin. So I have done that. But I have functionality, which could be generalized, ...
1
vote
2answers
38 views

Calling apply_filters on non-documented hooks

I have been trying to learn how to write plugins and I thought the best way would be to look at other plugins. I was taking a look at this one and the first lines /** * Plugin Name: Media Library ...
1
vote
1answer
59 views

Create a Page via plugin

My problem is to show a list of products read from db tables. I know how to read them and I am able to produce the table, but only using a shortcode embedded in a page that I've created via WP. I ...
1
vote
2answers
286 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' => '', ), ...
1
vote
6answers
178 views

Pages 404 in wordpress

First of all, I am very new to wordpress and know almost nothing about it. When I create the page foo using in wp-admin, I get the message that the page is created. When I click on view page, it ...
1
vote
1answer
34 views

How to use is_multisite() in a must-use-plugin?

I want this code to be executed in a plugin in the mu-plugins folder. When executing in functions.php everything works fine, but when I try it as a plugin in mu-plugins this creates a blank page. if ...
1
vote
1answer
2k views

How to Use Checkbox in Custom Option Page Using The Setting API

Can you please let me know how I can add a checkbox to Setting API in creating Custom Options Page? I am using the following code to add a txt box which is working perfectly but I am totally confused ...
1
vote
1answer
256 views

When is it too late to call the action wp_enqueue_scripts?

I'm creating a plugin that always enqueues a script in the footer. I also have a function that if called would enqueue an additional script that depends on the other one. Here is the basic format of ...
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
1answer
129 views

Why are two functions over-riding each other?

I have function in my plugin that is: add_filter('comment_text', 'commentimage_comment_text'); function commentimage_comment_text($comment = '') { $options = get_option('commentimage'); $id = ...
1
vote
2answers
838 views

How do I only load js on the post-new.php and post.php pages in admin?

I have some script that is loading in the admin. I only need it to load on the new post and edit posts screens. What is the best way to do this?
1
vote
1answer
149 views

Using ob_get_content to get_search_form puts into infinite loop

I am trying to change the look of my searchform. It basically needs to have two text fields. I want this to be in form of a plugin, which anyone can activate. SO obviously I do not have any control ...
1
vote
2answers
1k views

Headers already sent error with CSV export plugin

I have built a Wordpress plugin that allows the user to export all pages, with their levels and urls, to a csv file. The problem I have is that I keep getting error messages when trying to export ...
1
vote
1answer
509 views

Check spam in custom form - akismet

I have a plugin that has input form, I have decided to check submitted data with akismet. I do have API key, WP comments are filtered correctly... here is, what I found: ...
1
vote
2answers
476 views

How to check if current static page is frontpage from admin plugin

I set static page as front page. I need to know if user currently on homepage in my custom plugin. Functions is_home() and is_front_page() doesn't works, since homepage is static page. I can get an ...