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)

1
vote
1answer
42 views

wordpress plugin is not activating from widget

I am just creating a plugin in wordpress. In this plugin I am trying to create a widget, In that widget it will show a title, input text and text area in the widget section and when the values will be ...
5
votes
1answer
230 views

How can I find plugins' slug?

I'm wondering how can I find plugins' slug (slug = internal name used by WordPress to do plugin updates and to determine which plugins are currently active)? It is usually plugin's folder name but if ...
0
votes
0answers
18 views

grouping my widgets wordpress

In the widgets page, there are two boxes "Available Widgets" and "Inactive Widgets". How can I add a new boxe with my custom name where I can group all my widgets.
-2
votes
1answer
91 views

get_option returning a different value from what's saved

add_action( 'admin_init', 'register_mysettings' ); function register_mysettings() { //register our settings register_setting( 'plugin_options', 'plugin_options', 'plugin_options_validate' ); ...
0
votes
3answers
164 views

If a function requires add_action('init') how can I run it only once on plugin activation?

I am using wp_insert_term() to insert a large number of taxonomy terms from a csv file. The contents of that csv file might change occasionally. According to the codex, wp_insert_term() needs to run ...
0
votes
0answers
35 views

Capabilities for custom post type visible in backend but not working

In my plugin I have created a custom post type and defined capabilities for both the subscriber and the administrator role. When I go into the backend and look at the capabilities that are in the ...
0
votes
1answer
45 views

CPT to installable Plugin

I have gotten pretty good at creating CPT's for clients sites, but now would like to take it a step further by making them plugins outside of the theme so when/if they decide to change themes it is ...
0
votes
0answers
80 views

Create attribute for woocommerce on plugin activation

I want to create attribute on plugin activation.By below code,i'm able to create attribute in database table prefix_woocommerce_attribute_taxonomies but these attributes are not showing (or listed ) ...
0
votes
0answers
59 views

How to get viewed posts during an user session?

I want to track user activity on my blog by store viewed post id's in $_SESSION. So I wrote a plugin but wp call it twice. I get allways current post id and the id of the next post. This problem is ...
-2
votes
1answer
55 views

Is the only way to add taxonomy terms via an admin panel?

Is it possible to register taxonomy terms programmatically from a plugin? I would like to add a custom taxonomy 'geographical area' and also prepopulate the taxonomy with a list of areas in the UK. ...
0
votes
1answer
79 views

Why does is_front_page and is_home always return true for posts in wordpress? [closed]

My front page is just a list of the posts separated by category. I'm working on a plugin that get the id of the post but needs to test if the user is currently on the front page: if(is_front_page()){ ...
0
votes
1answer
138 views

Any way to update_post_meta with html content? It gets stripped and becomes empty

So I am cloning some divs created from an array using jQuery. Here is an example. I have a drop down list that contains items to add to the meta box. The add button clones a hidden div based on the ...
0
votes
3answers
341 views

add action wp_head not working

I am trying to add some code to the head (namely a block of tracking script) via a plugin I am making. The plugin has an interface where the user enters some details which are then added to the ...
1
vote
1answer
56 views

$reverse_top_level works the opposite way according to Codex?

The Codex for wp_list_comments states $reverse_top_level (boolean) (optional) Setting this to true will display the most recent comment first then going back in order. For my it is actually the ...
3
votes
3answers
171 views

How to delete custom taxonomy terms in plugin's uninstall.php?

I am writing my plugin's uninstall.php file and would like it to delete any terms that were created in the plugin's custom taxonomy. In the plugin's uninstall.php file I am using this: // Delete all ...
3
votes
1answer
151 views

Add content to /wp-admin/plugin-install.php admin screens

I would like to add some external content to the plugin information displayed on the /wp-admin/plugin-install.php admin screens. /wp-admin/plugin-install.php calls the following: $wp_list_table = ...
0
votes
1answer
139 views

Using flickr api in custom wordpress plugin

I'm currently trying to add flickr api to my custom wordpress plugin... and am failing. :( I was trying to use this tutorial, Getting Started With Flickr API, to learn the basic code structure and ...
0
votes
2answers
85 views

Plugin function inside custom plugin

I am trying to use a plugin function ( wp-bannerize() ) inside my custom plugin. but when i write: if( function_exists('wp_bannerize') ){ echo "exist"; }else{ echo ...
0
votes
2answers
65 views

Uploaded attachment not set as featured image

The following code uploads an image which I want to associate with a custom post type. $upload_overrides = array( 'test_form' => FALSE ); if($file_errors['error'] == 0) { if($new_reseller_id = ...
0
votes
1answer
109 views

How to display custom taxonomy and terms using/creating plugin template

I am working on a plugin which requires a custom taxonomy and 3 terms (Personal, Group & Pets). I already have the taxonomy set up with terms and some sample posts. I've created a template for my ...
0
votes
1answer
35 views

How to get the number of pages when paginating comments?

I want to display threaded comments via ajax using pagination. If I use this code to display comments for page 1 how can I know if there is something more to be displayed on page 2? If there is ...
0
votes
1answer
264 views

Uploaded image not appearing in custom post type

I am writing a plugin which should allow users to create a custom post type called reseller and attach an image. The image is being uploaded to the uploads folder and appears in the media library with ...
2
votes
1answer
175 views

What should I use instead of WP_CONTENT_DIR and WP_PLUGIN_DIR?

The WordPress documentation for Determining Plugin and Content Directories states that: WordPress makes use of the following constants when determining the path to the content and plugin ...
0
votes
2answers
23 views

Wordpress Thumbnail add action if no thumbnail

I was learning how to make my own WordPress plugin, currently I'm confused on how if there is no thumbnail in the post then I use the default image as thumbnail. Code that I used: add_action( ...
0
votes
1answer
342 views

How does “Your comment is awaiting moderation” work?

The question here is if someone could help me to make the comment "Your comment is awaiting moderation" work correctly for custom page. It works ok for standard Wordpress page but not for my own page. ...
0
votes
1answer
520 views

Issue with pre_get_posts on custom post type archive pages

Overview I am creating a theme which has 2 custom post types (as custom plugins): Articles Reviews I have also created single-articles.php and archive-articles.php templates inside the plugin. ...
0
votes
0answers
59 views

Filter EVERY category link with my plugin

Im writing a plugin to let users customize the colors of their category links. But in order to make this work, Ive gotta figure out a way to target all category links regardless of theme. So clearly ...
0
votes
1answer
161 views

why does get_option( 'home' ) not work while using in plugin [closed]

I'm working on a wordpress plugin and am running into an inssue with get_option( 'home' ). What I'm trying to do: if the user (or admin) is not logged in then a login form will appear on a custom ...
0
votes
0answers
32 views

Display content by group using category title

I've set a number of groups in relation to category names, Now I'm trying to give user access page content by getting the category name and matching it to the user group? <?php $user_id = ...
0
votes
0answers
16 views

Create a »Nav Menu Link« for my plugin

is it possible to create a »Nav Menu Link« for my plugin? If I navigate to appearance > menus, I can drag pages or articles into the active menu, but how can I make that happen for my custom plugin? ...
0
votes
1answer
46 views

Injecting HTML on (arbitrary) admin pages

I would like to create a plugin that is able to inject some html on admin-pages, no matter if these are post, pages, settings or any option page for a plugin. So I am searching for a suitable hook, ...
0
votes
1answer
38 views

Adding Meta box to thrid-party plugin

I am about to write a custom plugin that is intended to »extend« a third party plugin, in this case it is: »EME Events made Easy«. I would like to add a Metabox to the »edit event« screen, from within ...
0
votes
0answers
99 views

Creating custom Insert Media page

I'm writing a plugin, that has the basically the same functionality as Insert Media page in "Add media" popup. The only difference mine has to use web service for browsing media. I already read about ...
0
votes
2answers
83 views

How to edit link for comment count

I have recently installed Disqus on my blog and have a problem with the link in the comment count. On the main page here all the comments counts for each post link to the appropriate URL for the ...
2
votes
2answers
141 views

flush_rewrite_rules() not working on plugin activation

I am experimenting with creating a simple plugin to create a custom post type named project but am having some trouble with the rewrite rules not been flushed on activation. I have the main plugin ...
2
votes
1answer
159 views

Comment `Reply` link doesn't work if comments are loaded from ajax

I am writing a plugin that displays custom home page that is in fact only one post with comments. The first time home page is displayed by the initial call by php. Then user can click a menu button to ...
0
votes
1answer
47 views

Identifying a Page Containing Shortcode at `init`

I am writing a plugin and I am having some difficulty with when to trigger specific functions of the plugin code. /* // Plugin information goes here */ // ***** Area A $GLOBALS['example_class'] = ...
2
votes
1answer
135 views

Using a front controller in a Wordpress plugin, any suggestions?

My idea was to use a front controller in our plugin. has anyone done that already? The responsibilities of the controller should be initiate router class; provide access to objects registry, which ...
0
votes
1answer
50 views

Create “new pages” within the admin section of plugin

Here is my situation, I'm trying to create my first plugin for Wordpress, but I'm having an issue of trying to change the display within the plugin admin page. Here is what I currently have: As ...
3
votes
2answers
1k views

Send user activation email when programmatically creating user

I wondered if someone here might be able to help. Basically, I've created a custom registration form that when validated, inserts a user to the user table. function _new_user($data) { // ...
1
vote
1answer
83 views

Can wp_list_comments output into variable?

Is there any way how to output wp_list_comments() into a variable? Something like $output = wp_list_comments(array('reverse_top_level' => false ), $comments); I am writing a plugin and it would ...
0
votes
3answers
156 views

wp_count_posts on all post types?

I have 5 different custom post types, Is there any way to count all the publish posts regardless of post_type through any inbuilt functions Like wp_count_posts(array('post','books','video')) any ...
1
vote
1answer
142 views

All Users > User List > Update User Meta Field Inline

I am asking user few questions at the time of registration with checkboxes like In Registration form [] I am blah blah [] I am blan blah [] I am blah blah Now user will come for approval in admin ...
0
votes
1answer
70 views

Render content after post title in wp-admin

I want a plugin to place custom content below the post title, and to the right of the permalink. However, I cannot find a specific action reference to hook into. The screenshot demonstrates the ...
0
votes
0answers
56 views

How to reconnect to the wordpress database after the connection has timed out

I am writing a plugin that uses the database a lot to store product details from the Amazon Product API and I'm getting a lot of MySQL Server has gone away errors. The server that I'm working on is ...
0
votes
0answers
18 views

Target edit post content with plugin

I am writing a plugin that adds an extra metabox onto the edit post dashboard page. In this metabox is a button which when clicked will scan the content of the post to check for certain words and ...
0
votes
2answers
210 views

Get plugin directory from a theme

Does anyone know a non-hacky way of getting the plugin directory path from within a theme's functions.php? I've used plugin_dir_path(FILE), but because its called in the theme's functions.php it ...
0
votes
0answers
29 views

Get fields of a widget

I have a widget that has fields, so how can I get these fields in my Metabox. I have tried with this variable $wp_registered_widgets, but I can't get the fields. Is there any solution for my ...
0
votes
0answers
67 views

How to configure comments evolved for wordpress for pages?

I have installed Comments Evolved for WordPress to enable comments in my sites. there are so many pages and posts in my sites. i have activate this plugin succesfully. this plugin works fine with ...
0
votes
1answer
44 views

Toolbar Hidden in a Virtual Page

I am trying to create a virtual page, but my admin toolbar is not showing up. This is how I am creating the virtual page: functions.php add_action('init', function() { ...