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.
6,654
questions
0
votes
3
answers
373
views
How can I show posts for a single category?
Is it possible to show posts for a single category? I tried browsing to the URL http://mysite.com/category/foo which does show all of the posts with category foo, but the posts lose their formatting ...
3
votes
2
answers
474
views
Need a function for changing saved post_date or post_date_gmt to relative time in wordpress
I am working on a plugin and want to change the default post date to something like 'posted one min ago' OR 'posted 1 hour ago', OR 'posted on month ago'.
1
vote
2
answers
70
views
Plugin Repo: Why do some plugins get version charts while others don't?
I've noticed that some plugins have the version charts displayed on the Stats page while some others do not. What's necessary for the chart to show in the stats page? Also, how does WordPress.org know ...
5
votes
2
answers
4k
views
Advice on naming files for a plugin
Based on some advice I read[1], I have meticulously named all my plugin php files with my adopted plugin prefix, being 'wpsm-' in this case. All my class files have the additional 'class' qualifier, ...
0
votes
1
answer
1k
views
using admin functions on frontend
I'm updating my plugin to rely on internal functions of WordPress. I'm about to use wp_generate_attachment_metadata, but this function seems to be only available in the admin section.
Is there an ...
1
vote
3
answers
745
views
Only allow plugin to be activated on root site of multisite
I'm developing the wordpress file monitor plus plugin.
Its purpose is to scan for altered files and it works fine for a single installation of WP. But when you look at multi-site it's not something ...
1
vote
1
answer
302
views
How to find the origin of a file upload from within wp_handle_upload?
I have a plugin that hooks into "wp_handle_upload" filter. Within that scope I'd like to be able to identify where the upload came from, meaning I want to treat it differently if it was uploaded from ...
1
vote
1
answer
437
views
How do I alter the comment form 'allowed tags' text in a plugin?
I'm using the PHP Markdown plugin, and I'd like to modify it so that it adds some text to the bottom of the comment form indicating that Markdown is supported in comments.
I've been modifying my ...
5
votes
3
answers
22k
views
Mapping multiple URLs to same page
I just came across this page with almost similar requirements as mine
Multiple endpoints to same page
i have to achieve same functionality but i also want to pass some parameters to the page where ...
0
votes
1
answer
70
views
Widget internal hooks and functions
I am working on my 1st plugin, of some ideas to re-do the interface to how widget's are manage d and organized. Anyhow.
I am struggling to get this information, either that or understand it.
Create ...
0
votes
1
answer
2k
views
Adding a jQuery modal dialog to the admin area
I am writing a plugin for a customer and I need to use lightbox/thickbox/fancybox/etc in my admin piece. No matter what jquery plugin I use, and I'm using wp_enqueue_style and wp_enqueue_script, ...
1
vote
1
answer
260
views
How to localize admin.php only once
I am creating a set of plugins that all use AJAX. Now localizing the admin.php in all the plugins seems to be a bit of an overkill. Is there a way to localize the script only once.\
Now I do not know ...
0
votes
1
answer
328
views
using wp_cache in plugin
I have a results set being returned from the database. How can I use wp_cache to speed this up?
function bb_attachments_cache() {
global $wp, $bp, $wpdb, $posts, $bb_attachments, $...
2
votes
5
answers
1k
views
How to debug WordPress correctly?
I'm using a few plugins and UpThemes framework on my new website and if I turn on Wp Debug I can see that there are a few errors related to Deprecated functions (but website is working). What I would ...
3
votes
2
answers
325
views
Change Wordpress.org hosted plugin readme.txt
is it possible to change the readme.txt of a plugin that is hosted at http://wordpress.org/extend/plugins/plugin-name without tagging a new version?
I would like wordpress.org to show the new readme....
1
vote
1
answer
115
views
How to write a plugin to add users to a mail list
I run a multi-site blog with about 300 sites.
I have an idea that I want to write a plugin that in order to add all administrators of blogs to a MailMan mail-list. I just want administrators though, ...
0
votes
1
answer
143
views
Javascript Function Called Too Early in PHP Script
I'm working on a Google Maps plugin.
My problem is that the function that initializes the map, csf_map_maker_js(), is getting called too early-- before the div is defined (at least that's what I ...
0
votes
1
answer
54
views
How to check via conditional tags for a single plugin page?
I am developing a plugin. To embed the stylesheet I used wp_enqueue_style(). I want the CSS file to be only implemented at the plugin's page. I have already seen solutions with conditional tags, but ...
1
vote
1
answer
602
views
Mixing Regular Javascript With jQuery in a Plugin
Sorry for a simple question.
I'm learning about plugins. I've got some javascript that I want to put in a jQuery file in my plugin.
(I've got jQuery and the scripts enqueued, and working fine).
...
0
votes
1
answer
3k
views
Change the display of Settings API (do_settings_sections)
I am working on a plugin which uses Wordpress Settings API. I notice that the functions do_settings_sections (and do_settings_fields) display the fields using TABLE. How do I change its formatting? (I ...
2
votes
1
answer
5k
views
Set cookie then immediantly refresh the page
I wrote a small WordPress plugin (mobileesp-for-wordpress) that will redirect mobile users to the mobile site. It's based on mobileesp.
The plugin itself works fine the problem is I added an option to ...
1
vote
1
answer
462
views
How to Debug: My Plugin Interferes With My Theme
I'm learning how to write a plugin. My plugin is a google map that places markers based on the selected criteria. It works fine. The problem is that it interferes with one part of the theme I'm using. ...
2
votes
1
answer
2k
views
Changing bloginfo description from a plugin
How can I change the site's bloginfo description in runtime from a plugin?
I tried these, but none of them work:
add_filter('description', 'ab_arq_generate');
add_filter('blogdescription', '...
0
votes
1
answer
189
views
Why does this fail: Disabling plugins enqueue_script() in functions.php
I'm trying to use the method presented here:
Restricting a Plugin to Only Load its CSS and JS on Selected Pages?
In the plugin 'syntax-highlighter-compress' I've got the following code:
function ...
0
votes
1
answer
134
views
Sharing changes to a post (preview changes) with another user
We would like to be able to share changes to an existing post with other wp users without saving the changes (making them live). A nounce currently makes it impossible to share a previewed post.
Is ...
2
votes
1
answer
1k
views
Plugin Uninstall and Deactivate via Options Menu
I'm creating my first plugin (modifying an existing one for what I need) and although it's working fine i am trying to create a simple options menu to allow either deactivation of the plugin, or ...
30
votes
5
answers
87k
views
How to add a javascript snippet to the footer that requires jQuery
I know I can add a script file to the footer of wordpress that requires jquery using this code:
<?php
function my_scripts_method() {
// register your script location, dependencies and version
...
0
votes
1
answer
1k
views
How to delete all the options in an option group
I have created a few options with with the register_setting function:
<?php register_setting( $option_group, $option_name, $sanitize_callback ); ?>
Is there a way to clear the whole content of ...
0
votes
1
answer
94
views
Pause plugin option page until all data manipulation is complete
I have an option on my plugin page where I load content into all the posts in the blog. Now this takes some time, esp when there are a log of posts.
Now the way is it set up now, when you press ...
0
votes
1
answer
6k
views
How to display TinyMCE HTML view?
I'm displaying TinyMCE in my plugin's settings using wp_tiny_mce():
<?php wp_tiny_mce( false , array("editor_selector" => "a_nice_textarea"));?>
<textarea class="a_nice_textarea" id="...
1
vote
1
answer
156
views
How do I include background images in my stylesheets in a plugin?
I'm trying to specify a background image in a style in a plugin I'm making. I was just outputing tags from the php, but realized I should probably be using enqueue_style... But how do I put a line of ...
1
vote
1
answer
118
views
maintaing consistent layout wordpress dashboard
I am developing a functionality in WordPress so that once user updated any information admin can approve/reject the information only after which it should get published in the front users,in specific ...
0
votes
1
answer
156
views
Wordpress plugin advice: suggestions for writing a plugin the correct way
I will write my first Wordpress plugin for the local animal shelter. The plugin will make a list of the animals in a category page(or a custom loop if that is a better way to do it) and make a little ...
0
votes
1
answer
2k
views
Wordpress database error: [Query was empty] - using $wpdb->prepare()
I have edited my question, I'm now getting the error about checking my MySQL settings. I changed the $sql_dvalues variable to an array with the values instead of comma spaced values and now it is ...
3
votes
2
answers
91
views
How can I limit functionality in one version of a plugin?
I am busy writing a plugin with a free version and a paid, Pro version. For our initial release of both versions, I want to keep things as simple as possible, so I would rather defer using a strategy ...
1
vote
1
answer
270
views
Widget translation on my plugin
I am adding i18n to the widget on List Category Posts. I've correctly created the pot file, and po and mo files for Spanish and English. All of the Strings are being displayed with _e() on the form ...
1
vote
2
answers
477
views
Applying OO patterns and principles to plugin development
I'm busy writing my first plugin, using PHP 5.3.5. I come from a C# environment, and I must say I'm more than happy with the level of support for good, solid OOP techniques in PHP. However, I'm a ...
0
votes
1
answer
69
views
my basic php code producing unexpected results
I am writing a code snippet to display attachments to a post but for each user, he should only be able to see his own attachments and not those of other users
$current_user=wp_get_current_user();
...
5
votes
1
answer
15k
views
Email verification for new users
I would like to implement a plugin that requires new users to reply to an email, to verify their email address, on registration. I am already doing extensive codex research, but I am very new and ...
1
vote
1
answer
104
views
What function can I use consistently to escape possible HTML for editing and display?
I'm very new to WP, and from following books and online examples, I have several different 'esacping' functions in my first plugin. I would like to know if there is one function, or a minimal set of ...
1
vote
2
answers
5k
views
admin_notices not displaying in plugin
I know I'm probably doing something dumb here but I just can't get this to run. I'm trying to set up a little API for my plugin and to create a class to display admin notices a little easier. Here's ...
3
votes
1
answer
103
views
why don't I get error messages in admin when developing?
I am curious as to why my screen goes completely blank when an error is present in my code. This only happens to me when it is an admin function.
No warnings, no syntax error messages, nothing. Just ...
0
votes
1
answer
1k
views
WordPress front end AJAX. Return 0 :?
I have create the appropriate code to handle AJAX request on WordPress but I get 0 as responce from the server.
My plugin code is here:
class my_plugin
{
function my_plugin()
{
...
2
votes
1
answer
3k
views
Do I have to override the wp_mail() pluggable function with writing a plugin?
If I want to override wp_password_change_notification, do I have to write a plugin to do this? It seems to have no effect in functions.php of my theme.
The only thing I need to do is change the ...
1
vote
1
answer
797
views
custom permalink's rewrite rule for page id
I am using WP 3.2.1.
I try to do permalink like: /en/1/some-string. Structure is: %lang%/%pageID%/%some random string%
So I add a rewrite rule:
function nw_lang_addRewrite($aRules) {
$_aRules["...
1
vote
1
answer
255
views
Master menu item for multiple plugins?
I guess this question is more or less about aesthetics and organization rather than functionality, but I'm curious nonetheless...
I know I can add a custom menu item in the dashboard for my plugin ...
9
votes
4
answers
17k
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 ...
1
vote
2
answers
2k
views
Comments do not respect display_name setting, how to make plugin to overcome this
When I post something on Wordpress, it's posted with my display name. However if I change my display name, posts posted by me will be updated with the new author. Comments will stay with the old name....
0
votes
1
answer
4k
views
Hook for page Request?
I want to run a function that looks at the current url params of the page that is requested and sets a cookie based on those params.
So, I guess I'm looking for:
The Wordpress Hook that allows me to ...
2
votes
1
answer
485
views
how to activate plugin network-wide, and save setting across sites
I am developing a plugin, which will be used on single site, as well as multi-site.
How to make plugin active network-wide, code required.
Also, how to save settings network-wide?