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
865 views

Serialize data for wp options

I am creating my first ever plugin, its purpose is to show a notice when some conditions are met, I created the function in jQuery and initially I had to manually edit the file everytime I wanted to ...
0
votes
1answer
394 views

How to get error object returned by wp_create_user

I'm creating a registration widget for my wp site and it works as expected, however if the user already exists I need a way of retrieving that information. I'm using ajax to make the call here is my ...
1
vote
1answer
158 views

Best approach to fetch data from wp options to js file or php file

I am creating my first ever plugin, as I am not a programmer, I have been following tutorials and reading the codex, etc. My plugin consist in showing a notice to users when certain conditions are ...
1
vote
1answer
97 views

How a deprecated function can crash WordPress site while upgrading

It is said that deprecated functions used in plugins & themes can crash a wordress website while upgrading to newer version, I want to see an example of deprecated function that can cause a crash. ...
4
votes
1answer
259 views

How to get vim to autocomplete WordPress API functions?

I guess built-in omnicomplete is a start, but perhaps we're talking some neocomplcache plugin module or something themsuch? Googling "vim wordpress autocomplete" doesn't really give much.
0
votes
1answer
85 views

How to use existing hook in twentytwelve to all theme of wordpress?

I Recently tried to read the tutorial for wp_footer and also twentytwelve_credits for creating a sample wordpress plugins. wp_footer hook to display the footer beneath the page area. ...
3
votes
1answer
179 views

WordPress Capabilities: edit_user vs edit_users

The official documentation only mentions edit_users, but in the source I found many places are using edit_user, what is the difference? Are there any conventions for singular and plural capabilities? ...
0
votes
1answer
52 views

Load stylesheet in edit category page?

I have a plugin that I want to add a stylesheet to each "edit category" page because I added additional custom fields into those pages. Is there a simple way of doing this or do I have to use the URL ...
0
votes
2answers
1k views

Check if email address exists front end with AJAX in a plugin

I am pulling my hair out trying to figure this out. I have followed the wordpress codex here for AJAX: http://codex.wordpress.org/AJAX_in_Plugins All I keep returning is 0, I never get a 1. Any idea ...
1
vote
1answer
258 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 ...
2
votes
1answer
194 views

calling jquery function on plugin page

I am trying to call the following script on a plugin admin page: <?php function add_match_attendance_scripts() { $output = '<script type="text/javascript"> jQuery(function () { ...
0
votes
0answers
69 views

Is it possible to make Wordpress as a RESTful app?

I'm planning to create a Wordpress plugin that accepts data via cURL and sends a JSON reply. The plugin will save the data in the database upon receive so there has to be some authentication and will ...
0
votes
1answer
92 views

Change Admin menu placement using hooks

I have been working in a wordpress multisite installation. Where I am using upPrev plugin that has an option page under Appearance ->> upPrev Now what I need is to move this menu under Settings ->> ...
0
votes
1answer
44 views

how to get the top 10 popular blogs

Our wordpress sites have many many users, each of them have an blog account, they can write posts,comments and so on. Now I want to find out the top 10 popular blogs, according to or order by ...
0
votes
2answers
166 views

Conditional check to see if a bootstrap.css is included in a theme

I am creating a shortcode plugin for Bootstrap framework that will go along with my theme. However since this would be released to the plugin, if a users's theme already has Bootstrap.css included, is ...
3
votes
1answer
585 views

Where the Nickname is being used in WordPress

I see most of the place is using the "Display name", so why I need to set a Nickname? Where it is being used?
1
vote
0answers
435 views

How can I save a multiple select array with the settings API for a plug-in options page?

I'm thinking this may be more of a problem with my PHP rather than my use of the settings API, but I can't seem to get Wordpress to save an array of data for a multi-select box. The multi-select box ...
0
votes
1answer
224 views

Prevent multiple counts by same user - WP PostViews plugin

I am using WP Post Views plugin to display the post number of views. To do so, I use: <?php if(function_exists('the_views')) { the_views(); } ?> The problem is: The plugin increments the ...
0
votes
1answer
51 views

How does wordpress distinguish a plugin's main php file from other php files? [duplicate]

If my plugin has multiple php files in its plugin folder, how does WordPress know which is the main php file ?
1
vote
2answers
28 views

Is it possible to add an action to the currently running action?

My question is very simple but I haven't found this answer yet. Here's an example: class MyClass { public function __construct(){ add_action('init', array($this, 'init')); ...
-1
votes
3answers
1k views

change add to cart button link [closed]

I'm new to WordPress and the WooCommerce plugin. I'm creating a plugin to change the add to cart button link if it hits a desired stock quantity. For example if stock qty is above 50, I would like to ...
1
vote
1answer
238 views

Remove rewrite rules generated by plugin during deactivation‎

I have a simple plugin like the following add_action('generate_rewrite_rules', function ($wp_rewrite) { $wp_rewrite->rules = xxx + $wp_rewrite->rules; }); if (is_admin()) { ...
-2
votes
2answers
41 views

remove () from category number [closed]

I have found this code here. $args = array( 'hide_empty' => FALSE, 'title_li'=> __( '' ), 'show_count'=> 1, 'echo' ...
0
votes
0answers
477 views

How to give a download link to a .csv file from the custom plugin?

I have made a custom plugin, which exports MYSQL table contents into a .csv file which gets saved in to wp uploads directory. Now, I am trying to give a download link for downloading directly a .csv ...
0
votes
1answer
72 views

What could cause a WP Option to get truncated?

I have a WP plugin, where all admin setting field values were suddenly changed to the letter 'a'. All settings are stored in one 'big' option in the table. Seemed like the serialization gone wrong. I ...
1
vote
1answer
232 views

Correct way to perform non-cacheable DB query

Consider the code function getNow() { global $wpdb; $now = $wpdb->get_var("SELECT NOW()"); $wpdb->flush(); return $now; } I am using the above method to avoid caching ...
0
votes
2answers
52 views

List all content by post type

I am writing a plugin in which I need to list post/page/attachment by each type. First I get all post type: $post_types = get_post_types (array('public'=>true)); Then I create a loop and query ...
0
votes
1answer
396 views

wp_localize_script is not adding a global variable for javascript

So I've read a few tutorials on ajax and the codex documentation on it and I think I understand now how it is supposed to work, however it appears that wp_localize_script is not doing anything at all. ...
0
votes
1answer
346 views

wpdb prepare insert table doesn't work

I followed the introduction to use prepare to insert some data to the table. The code is like this: $wpdb->query( $wpdb->prepare( "INSERT INTO ...
-1
votes
1answer
188 views

Can I use a form in a dashboard widget?

I'm building a plugin and would like to add a dashboard widget with a custom form. In this form, users should be able to edit a list of strings (add, edit and remove items). Is there a WordPress API ...
0
votes
1answer
52 views

select a single val though a table in wordpress

The table is like this: category_id category_name category_parent_name I would like to get category_id by using category_name. I searched online, and the code is like below: $ad_cat is the ...
0
votes
2answers
284 views

Ajax functions - no access to wp-admin.php only online

I'm having some trouble with my custom ajax function. I have this on my console log : "POST MYSITEURL/wp-admin/admin-ajax.php 302 Found". So my functions won't work... And I really don't understand ...
0
votes
4answers
4k views

what's the meaning of the field wp_capabilities in table wp_usermeta

I am new to wordpress, in table wp_usermeta I notice that we have a row meta_key meta_value wp_capabilities a:1:{s:13:"administrator";b:1;} First, what's the meaning of ...
0
votes
1answer
51 views

Wordpress Feed Creator Name Tag Full Name Instead Of First Name

I am parsing a Wordpress feed in my iOS application. I don't know much about Wordpress and its customisation. The feed shows the author name as below: <dc:creator>andy</dc:creator> ...
0
votes
2answers
120 views

how to invoke wordpress API from other existing PHP system

We have our own php system, now we want to have a blog function. Because wordpress are widely used, so we decided to use it. And now I want to invoke wordpress's function , for example wp_insert_user ...
0
votes
2answers
45 views

Best Way to Grab Post ID from Plugin

I'm currently using loop_end to hook my plugin and get the post id from a page. This works great, except that it's also displaying my plugin in the recent posts widget which I don't want. Is there a ...
0
votes
1answer
288 views

Adding querystring variable breaks admin URLs

I've set up some admin pages using add_sub_menu() and whenever I add an additional querystring variable beyond the "page=" portion of the URL, I get a "Cannot load 'page-slug'." message. When I ...
3
votes
1answer
152 views

Using wp_cron with custom time interval and the register activation hook

Scenario 1: fails Adding a cron task wp_schedule_event with a custom interval on plugin activation using register_activation_hook outside the class definition fails to work because the custom ...
0
votes
1answer
92 views

How to check during “pre_get_posts” if WP performing default query for specific custom template?

I want to modify default query for custom RSS template loaded by plugin that i'am writing right now. What is the best way to check - in function hooked to "pre_get_posts" - if default query for my ...
1
vote
1answer
105 views

what is the best practice for including 'wp-includes' classes

I have a class 'wp_php_flickr' which will use the wordpress core class 'WP_HTTP' in a plugin which i'm writing if( !class_exists( 'WP_Http' ) ) { require_once( ...
1
vote
1answer
74 views

Plugin that saves form data

My first plugin attempt with basic PHP skills and a bunch of WordPress experience... What I want: User fills out form - form action sends them off to a specialized gateway (got that part ok) Select ...
1
vote
1answer
61 views

Common abstract class for plugins

I have a few plugins and intend to move them to a very common base with an abstract class. The issue is that even if I apply solutions in order to avoid class duplications ( like EarnestoDev's answer ...
0
votes
1answer
345 views

Plugin AJAX Save to Custom Table

I am learning how to use AJAX in the admin for a new plugin I am writing. In the PHP I have the function: function ppmhnh_add_location(){ global $wpdb; $values = array(); ...
0
votes
1answer
184 views

Plugin to create Posts and Forums then choose category and parent forum

I need to create a plugin for a customer that will help him create posts and forums and place them in a category and choose if it's a parent or a child forum. Just created a GitHub Repo for my files ...
0
votes
1answer
232 views

count the number of views of a post excluding own views

I am using WP Post Views plugin to display the post number of views. To do so, I use: <?php if(function_exists('the_views')) { the_views(); } ?> This plugin gives 3 choises in its setting : ...
0
votes
1answer
34 views

How to get a notification when the plugin is installed?

I'm making a WordPress plugin to get a notification when the plugin is installed. I'm using is_plugin_active but I still do not understand...
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
2answers
777 views

Is get_option function cached?

In my plugin, I use the following code to retrieve an option from the database: $options = get_option('my_plugin_options'); If I use this 10 times in various functions of my plugin, does WordPress ...
0
votes
1answer
271 views

WP-Snap too slow (caused by WP_Query?)

I have a website with 10.000 posts... WP Snap alphabetizes the posts and puts it out with WP_Query, but it is slow as hell, which is very frustrating. My question would be: what can I do about it? ...
0
votes
1answer
63 views

search content of pages and list in wp-admin

I am developing a plugin, and I want to display a page that lists every page on the site that is using a specific shortcode defined by my plugin. I assume that I need to manually search wp_posts, but ...