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
2answers
193 views

Correct syntax for database inserts from plugin?

I'm testing a script to create a database insert. Is this the correct syntax for the insert or do I need to obtain a reference to global $wpdb and use that? <?php /* Plugin Name: Test Database ...
1
vote
4answers
580 views

Default category got deleted. How to get it back as ID=1?

I have a plugin that expects there to be a default "uncategorized" category with ID=1. I've inadvertantly deleted the uncategorized category. Is it possible to recreate the category as ID=1? When I ...
-1
votes
1answer
161 views

plugin backend help

this code is working perfect for me, but just want to know, how can i bring this after my post, currently all my tweets are coming before the post, how can i make it before the post?? function ...
0
votes
1answer
148 views

Plugin could not be activated because it triggered a fatal error, unexpected '['

I'm attempting to dynamically create a text widget, add it to a named sidebar widget that my theme has already created ($sidebar_id = 'home-header-widget'), then populate the text widget with some ...
1
vote
4answers
572 views

How to add an option for “nofollow” to the Link editor's existing "Link Relationship(XFN) options list?

How difficult would it be to add an option for "nofollow" to the Link editor's existing "Link Relationship(XFN) options list? Alternately, or better yet, in addition, add an item to the "Bulk ...
0
votes
1answer
596 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
vote
3answers
1k views

How to link to images in my plugin regardless of the plugin folder's name

What is the correct method to refer to images from within your plugin code, so that no matter what the folder is named, they resolve correctly? I had an issue where a user downloaded my plugin twice, ...
7
votes
3answers
1k views

Is the new WordPress 3.1 admin bar pluggable and how can I extend it?

How can I extend the functions of the WordPress 3.1 admin bar in my plugins? I am looking for specific hooks and filters to use in adding links or other features to the admin bar. A good example ...
0
votes
2answers
274 views

Remove Default Blogroll Links via Plugin script

I have a plugin that I use on all my new sites to set up site defaults (deletes the "hello world" post, the "about" page, the "Mr WordPress" comment, etc...) I'd like to add a routine that removes ...
13
votes
4answers
6k views

Post meta vs separate database tables

When developing plugins that requires data storage, what's the pros and cons of using one method or another ? The explanation given in the codex is not detailed: Before jumping in with a whole ...
3
votes
2answers
863 views

Overwriting Core Wordpress Functions with Plugins

Is there a way to overwrite a core function is the Wordpress core using a plugin? I don't need to inject code, I need to replace the function entirely with a re-written version. The specific function ...
0
votes
2answers
371 views

Check if variable is set in filter

Thanks to your suggestions, I enabled wp_debug and discovered flaws with my plugin. I have a filter for sorting posts by votes. I use it when the sort URL parameter is on. add_filter( 'posts_where', ...
2
votes
4answers
2k views

Use WordPress file upload in my plugin - on frontend and on backend?

Is there a way to use wp multifile upload system in my plugin?
1
vote
1answer
643 views

Converting theme widgets to plugins?

i need a help, i have a theme, where in i have a twitter widget, i just want to separate it, and keep it in different file, as if it is a plugin, here are is the complete code, what i have to do? ...
1
vote
3answers
971 views

Creating a theme option page?

I have a template page in Wordpress that I want the Admin to be able to change the text on that page. I'd love to learn how to make a plugin (I know how to make a plugin so that it shows up in WP, ...
5
votes
4answers
2k views

How to create and link to administration page for a plugin?

OK Full Code: <?php //check to see whether the user is an admin or not. if (is_admin()) { function wpsc_display_products_seo(){ global $wpdb; $productList = $wpdb->get_results("SELECT * FROM ...
2
votes
2answers
3k views

wp_enqueue_style built in styles

I'm writing (rewriting) my plugin to use wp_enqueue_script('jquery'); wp_enqueue_script('jquery-ui-dialog'); Which is great! But to use the dialog I need to load a jquery style sheet with ...
2
votes
1answer
668 views

Creating a modal dialog without jQuery

I am writing a plugin that depends on modal dialogs for screen space. Right now I am using jQuery to create the dialogs, but I want a way that integrates better into the admin theme. Obviously WP ...
0
votes
2answers
797 views

Will a plugin able to know is_user_logged_in?

I am currently building a plugin and it doesn't know when a user is logged in. global $current_user; echo $current_user->ID; It works when embedded on a template but not on a plugin? I have a ...
1
vote
2answers
226 views

How can I call “preview post” from wp_remote_get with authentication?

I've got a plugin that needs to interogate the post preview (the contents of the rendered page that's presented when the user clicks "Preview Post". To attempt to obtain this input stream into a code ...
0
votes
1answer
247 views

Plugin could not be activated because it triggered a fatal error?

Warning: Invalid argument supplied for foreach() in /.../ipn_res.php on line 28 Warning: Invalid argument supplied for foreach() in /.../ipn_cls.php on line 30 From line 28 is a foreach loop: ...
0
votes
2answers
3k views

How to query custom db table?

I am creating my first ever plugin for a membership site. I have a custom table named subscription with a subscr_user_id column whose values are taken from $current_user->ID. So when a current user ...
1
vote
1answer
471 views

What URL do you pass to wp_remote_get to load the body of the current post's preview?

In the code below, I'm attempting to get a reference to the body content of the current post's fully rendered preview... $response = ...
4
votes
1answer
590 views

Custom attachments uploader code. Almost there!

The code below resides in my theme's functions.php and creates a custom upload icon on top of the WordPress content editor, alongside the default upload icon. Images uploaded via this icon get a ...
0
votes
1answer
1k views

How to exclude “uncategorized” from custom categories widget?

The code below if from my WP plugin which gives a filtered listing of categories excluding the "uncategorized" category from display. However, when the user chooses "Show Hierarchy" from the widget ...
0
votes
3answers
607 views

can I prevent WP users (even admin) from deleting custom categories?

I am writing a plugin where I have custom taxonomy (category). I want to prevent any user from deleting some of custom categories. Is there any way how to do so. Let's say that category with ...
3
votes
2answers
1k views

Is There A Hook To Process The Content Of The Text Widget?

Is there any filter which can be used in a plugin to process the content of the text widget before it is rendered?
3
votes
2answers
432 views

Error getting correct blog_id on MU from functions.php

I have script in my functions.php that seeks to locate the media directory of the site in which the theme is installed. This is pretty simple unless the site is an MU site. In that case, the media ...
1
vote
2answers
1k views

Conditional add_filter?

I need to apply an add_filter from my functions.php but only if the user has opened media-upload.php from my custom function. Is it possible to send a variable when opening media-upload.php that I ...
3
votes
3answers
1k views

Creating two database tables via plugin

I'm working on a voting plugin for my site and I want to create 2 tables: one that stores votes and another that stores voter ips. In Codex it suggests to use an if statement to see if the table has ...
0
votes
2answers
280 views

Encoding Method for URLs?

Is there a method or API that WordPress uses to encode the URLs similar to how it generates part of the URL when using the title in the URL? I am writing a plugin that generates URLs and would like to ...
0
votes
1answer
215 views

Problems with wierd characters and my plugin

There are special characters that can cause problems in word press, like the infamous microsoft word smart quotes. However, there are many that are captured and dealt with. My collegue and I have ...
2
votes
2answers
137 views

Unified Approach for Placing Option Pages

Currently, it is up to any plugin's author as to where to put a link to the plugin's option page. I have seen at least the following "solutions": Plugin list Dashboard menu Plugins menu Appearance ...
2
votes
1answer
445 views

How to handle the Plugin Version on Update using Tortoise SVN and the worpdress.org Plugin Repository?

Recently I tried to update my plugin to WP server. The update to trunk folder went fine, but when I created a folder with a new version under tags folder and tried to upload it, only the immediate ...
7
votes
3answers
255 views

Getting a peer review for my new plugin?

What is the best way to get an experienced WordPress developer take a look at my plugin and give constructive criticisms? I have written code to solve some of my questions on this site, and I think ...
2
votes
1answer
264 views

wordpress 3.0 json issue

im using the media finder plugin which works fine in 2.9 wordpress, but since the 3.0 wordpress, the json sans eval library which the plugin uses works no more. not sure what was involved in the ...
2
votes
6answers
937 views

Why do I get this “plugin does not have a valid header” error?

I recently committed version 2 of my new plugin to the Plugin Directory, but now when you install the plugin for the first time, you get this error on activation: "The plugin does not have a valid ...
2
votes
1answer
2k views

Best Practices for Creating and Handling Forms with Plugins?

I'm writing a plugin that creates and handles a simple form. This has been my approach sofar, but it's turned out to have some major flaws: 1) On plugin activation, create a blank page for the form ...
2
votes
2answers
712 views

Script to get a list of all images that are detached?

In my functions.php, I have a need to list all images in the uploads folder which are not currently attached to a post in the WP database. It appears that every time an image is uploaded to the WP ...
1
vote
2answers
224 views

How to determine, from plugin script, if active theme has <h1>The Post Title</h1>

My plugin needs to know if the currently active theme places the post title in H1 heading tags? I'm looking for suggestions on approaches to create script that could discern this. UPDATE: The plugin ...
0
votes
1answer
517 views

Get cat parameter from admin-ajax

I have a plugin that restricts the categories users can view/edit in the admin. All works fine in WordPress 3.0.1, but as I started testing 3.1 I noticed that the category filter, which is AJAX, ...
2
votes
1answer
263 views

Updating my plugin without releasing a new version

Is it possible to change a file in wordpress.org repository (using SVN) without incrementing the plugin minor version? Normally, when I change something in my plugin and want to update it in the ...
0
votes
2answers
208 views

How can I add a css rule to edit.php?

I'm using add_filter('manage_posts_columns') in my plugin.php to add a column to the Edit Posts listing which is driven by edit.php. How can I attach a css style to the edit.php? I want to be able to ...
0
votes
2answers
280 views

Why does preg_replace_callback never fire in this function?

In the function below, the save_content function runs, but the doReplace does not (echo "This is the doReplace" never shows. Any ideas why? add_action('content_save_pre', 'save_content'); ...
2
votes
2answers
3k views

How to filter $post->post_content prior to save

I have a function inside my plugin that attaches to save_post, and inside that function, I'm seeking to filter the post_content prior to it being saved. However, the content never actually gets ...
26
votes
1answer
7k views

A tool to analyze rewrite rules? [closed]

Is there a good tool to analyze my rewrite rules? I always get confused with the regexes and the parameter replacements. I have created something myself and will post it here so others can use it, ...
1
vote
4answers
2k views

The plugin generated 80 characters of unexpected output!

I'm getting this message each time I activate my plugin: The plugin generated 80 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with ...
4
votes
1answer
2k views

How can I add columns to the post edit listing to show my custom post data?

When you click on "Posts" or "Pages", you get a paged listing of your posts or pages with the following columns: Title | Author | Categories | Tags | Date I have a plugin which gives an SEO score ...
3
votes
1answer
784 views

Prevent notice and warnings in error_reporting?

When turning opn WP_DEBUG and WP_DEBUG_DISPLAY, I get tons of warnings and notices. I have tried to remove the warnings by doing a @ini_set('error_reporting', 1) to only show E_ERROR, but I still get ...
2
votes
3answers
413 views

Commit changes to WordPress Plugin SVN with TortoiseSVN

I'm trying to upload my plugin for the first time to the WordPress SVN. I've been granted access from the WordPress team. I am able to download the directory. Then I try to place my plugin files ...