Questions tagged [plugin-development]

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.

Filter by
Sorted by
Tagged with
0
votes
2answers
2k 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
358 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
309 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
9k 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
1k 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 = wp_remote_retrieve_body(wp_remote_get('http://localhost/mysite/...
4
votes
1answer
645 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
3k 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 ...
1
vote
3answers
2k 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 ...
5
votes
2answers
6k 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?
67
votes
2answers
110k views

How can I add an image upload field directly to a custom write panel?

I've added a new page under "Pages" in the wordpress admin, and added several custom fields. I'd also like to be able to add an upload image field to the page editor - is there some way to do this via ...
3
votes
2answers
485 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 ...
2
votes
2answers
4k 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 ...
6
votes
3answers
4k 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
565 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
243 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
142 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
715 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 ...
8
votes
3answers
411 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
301 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 ...
4
votes
5answers
3k 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
4k 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
944 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
248 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
680 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
1k 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 ...
1
vote
2answers
307 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
779 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'); ...
3
votes
2answers
4k 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 ...
59
votes
1answer
20k 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, ...
2
votes
6answers
11k 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 ...
6
votes
1answer
3k 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 ...
5
votes
1answer
1k 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
1k 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 ...
5
votes
1answer
1k views

Modifying the way WP sets cookies

I'm trying to create a custom plugin that will change the way that wordpress names its cookings. Specifically, I want to write my own version of wp_user_settings(). I know I probably shouldn't hack ...
0
votes
2answers
6k views

Adding CSS to custom post type admin page causes error

I have this bit of code in my Meteor Slides plugin that loads a stylesheet on the admin pages of just the slides custom post type: add_action('admin_head', 'meteorslides_admin_css'); function ...
1
vote
1answer
98 views

Including a JS source with an admin page

The administration part for my plugin is divided into several pages and for some pages I would like to enqueue a JS source which would add jQuery functionality to various elements. Right now this is ...
1
vote
3answers
3k views

anything like add_meta_box for categories?

I want to add few custom fields to categories. So I am looking for something like add_meta_box but for categories. Is there any WP function like that for categories?
0
votes
1answer
237 views

how to add custom fields into new & update post page?

I want to add new whole section of custom fields in admin UI of new post page edit post page Could somebody suggest any nice code example?
5
votes
2answers
449 views

How would I create a plugin for my shortcodes?

All tutorials I have found say to add your shortcodes to functions.php in your theme. I would like to break that away from my theme and put that in a plugin so I can share these shortcodes between my ...
1
vote
2answers
296 views

Plugin for Android Marketplace downloads?

Is anyone aware of any way to show statistics on your WP blog to show android market place downloads? For example, I create an application and host it on the android market place, it gets downloaded/...
2
votes
1answer
3k views

Admin-ajax.php appending a status code to ajax response

I'm writing a plugin that uses Ajax (jQuery with form plugin) via a form submission and the php function returns a JSON response. add_action( 'wp_ajax_bubbly-upload', 'bubbly_upload_submit' ); ...
17
votes
4answers
1k views

Who are the most trusted plugin developers? [closed]

Note: Please vote on the question, and any answers you find useful by clicking on the UP arrow on the left hand side of the question or answer. There are so many plugins out there. Whose plugins can ...
1
vote
2answers
570 views

"Plugin could not be activated because it triggered a fatal error."

The code below is contained in a plugin file. It just seeks to execute an update query against the wp database. However, its generating a fatal error. Fatal error: Cannot redeclare ce3_cleanup() Do ...
0
votes
1answer
2k views

How to add a widget to the post editing view?

I would like to add some features (via authoring a plugin) to the post editor in wordpress. Is there a way to add a widget to the post editor view? Alternatively is there an existing plugin someone ...
0
votes
2answers
4k views

How to get shortcode to work inside a foreach loop called within a shortcode?

My plugin, WP Coda Slider, uses a shortcode to get_posts and add them to the slider. If one of the posts contains shortcode the shortcode in that post will not work. $my_wpcodaslider = new ...
5
votes
2answers
379 views

Best practice for including plugins as part of a theme?

I'm working on a theme that includes some functionality I've developed as separate plugins (as I'm hoping to release them independently). I'd like to include these plugins as part of the theme core ...
2
votes
1answer
700 views

My new WordPress plugin version is not showing up in the plugin directory. It's been 4 days what could the problem be?

Hi to all I made a wordpress plugin amtythumb post. All previous versions are reflected at worpress SVN within some hours. But this time 5.5 version of my plugin is not being reflected on wordpress ...
6
votes
8answers
7k views

WordPress Plugin Development In MVC Architecture, How?

I think, the wordpress plug-in architecture is not MVC. So I want to use/do the MVC architecture in WordPress plug-in development (like cakephp, codeIgniter ). How can I use them in plguin development....
0
votes
2answers
397 views

Widget instance options not showing correctly

i have a setup like function form($instance) { $defaults = array( 'title' => 'Recent Products', 'number_products' => 3 ); $instance = wp_parse_args($instance, $...
2
votes
1answer
5k views

How to check if certain plugin exists and in expected version

I've created plugin that goes to wordpress plugin repositories. Now, I need to create another plugin (sub plugin or child plugin you may call) that require this certain plugin to be already installed ...