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)

2
votes
1answer
1k views

get_template_part from plugin

This is default get_template_part function inside WordPress: function get_template_part( $slug, $name = null ) { do_action( "get_template_part_{$slug}", $slug, $name ); $templates = array(); ...
3
votes
1answer
97 views

Finding WordPress sites using my plugins

I've now developed two WordPress plugins and would like to see some sites that use it. I'm looking for a way to find sites that use a WordPress plugin I built. However, the official guidelines, don't ...
2
votes
0answers
160 views

How to add custom button to new media upload interface [duplicate]

I am developing a plugin and i want to add my own button to the wordpress media upload interface (WP version 3.5). Right next to the standard 'insert into page' button, i want my button to be there, ...
1
vote
1answer
320 views

uninstall.php file in Plugin to clean DB

I am aware that WordPress provides Plugins a nice way to clean up the db if the Plugin is deleted by providing the uninstall.php hook. You just have to place the cleaning code and it works. But my ...
0
votes
2answers
81 views

How to embed a new string in url?

I am creating a custom tours and travel theme in which I have created custom post type Cities, Locations, Destinations and i am using custom permalink structure. /%category%/%postname%/ So now I want ...
0
votes
1answer
61 views

How to load plugin static data from cloudfront

I am moving my site's static content data to Amazon S3+ CloudFront and i am successful in doing this for most part of my site (no plugin used) except for the plugin section. For the plugin i am ...
0
votes
1answer
135 views

wp-load.php redeclares classes

I am trying to load WordPress options within a standalone PHP file. The file is located in /wp-content/plugins/plugin-name/file.php. I have used the following to open wp-load.php: if ...
1
vote
0answers
77 views

Unable to delete custom post types, confusion around capabilities

So I'm working on a plugin for creating a questions/answers system that's as simple and well-integrated as possible (not unlike this site) but am stuck at the creation of the custom post types. You ...
2
votes
1answer
223 views

Add Admin Menu Inside Construct or Init

I thought I was making headway in my WordPress Development education until I ran across the Boilerplate for WordPress plugins and it uses a class object. I'm fine with that and understand those ...
0
votes
2answers
170 views

Really simple query giving error in SQL syntax

I'm sure this is a simple oversight but I cannot seem to narrow it down: global $wpdb; $tablename = $wpdb->prefix . "icrm_folders"; $sql = $wpdb->prepare( "SELECT * FROM %s", $tablename ); ...
0
votes
1answer
292 views

Custom Function for SEO by Yoast plugin

We use a very customized version of WordPress for some of our index/root site pages where we use a custom meta box for custom permalinks. What we are looking for is a custom function that basically ...
0
votes
1answer
1k views

Shortcodes, output buffering, and WordPress functions

I have a couple of long forms which I want to output as shortcodes. Shortcode API indicates that If the shortcode produces a lot of HTML then ob_start can be used to capture output and convert ...
-1
votes
2answers
2k views

How to exclude the particular category from the woocommerce plugin?

add_action( 'pre_get_posts', 'custom_pre_get_posts_query' ); function custom_pre_get_posts_query( $q ) { if ( ! $q->is_main_query() ) return; if ( ! $q->is_post_type_archive() ) return; if ( ! ...
2
votes
1answer
88 views

Any ideas how to make unit test read the theme functions.php?

I have performed a unit testing for a plugin that works perfectly until the section where I need to activate the theme and check if the theme is supplying the right hooks data to the plugin. Inside ...
0
votes
1answer
1k views

Different registration form for different roles

I have customised the worpress registration page by adding new fields using the Cimy User Extra Fields plugin so my site is now fine for allowing users to register as contributors. I now want to ...
4
votes
2answers
276 views

How to read configuration file in wordpress or PHP

I am not sure how relevant this is,i am working with Java based web-application, so in some cases we need to define some properties which can be used in entire web application like Google API Key ...
1
vote
0answers
43 views

Ordering taxonomies by rank

I'm using a function (copied and modified a bit from this question ) which displays taxonomies in order by rank with » between parent and child and | between terms, but I get a mistake in the html ...
1
vote
1answer
329 views

Proper way to hook wp_get_attachment_url

I am trying to hook wp_get_attachment_url() with my custom implementation. I am trying to get my post images and any other static data from the Amazon S3 and I was wondering if I can configure the URL ...
1
vote
1answer
539 views

Plugin admin page meta_box toggle and order state not saving

I can't get the toggle state and open/close status of meta_boxes on my plugin admin page to be stored. The ajax response is always 0 I'm using meta boxes to hold sections of menu for a plugin. ...
1
vote
1answer
30 views

Archive - same title for the first two posts

I created an archive page called archive.php Here I include header / footer and this code: <?php if (have_posts()) : while (have_posts()) : ?> <h1 class="entry-title"><a ...
2
votes
1answer
137 views

How to save the values of checkbox to the register setting?

<?php function default_menu() { <form action="options.php" method="post"> <?php settings_fields( 'sample_check' );?> <input type="checkbox" name="sample" value="nofollow"/> ...
2
votes
1answer
59 views

Unit Testing a Plugin functionality with cron

I'm currently on the process of unit testing a plugin using the Wordpress unit testing framework. In one of the functions to be tested,it will send mails to users in a periodic time interval so it ...
2
votes
1answer
54 views

nonces in custom oop plugin

How to use the check_admin_referer method with oop? If I use as it follows the function can not be called: class MyClass{ function __construct(){ if( isset($_POST['my_nonce_field']) ...
5
votes
3answers
2k views

Query Posts by Custom Field 'Price'

I'd like to display all posts within a given price range. For example: When a user inputs 100 and 1000 (in two separate form fields) - my site will display all posts that have a custom field called ...
0
votes
2answers
335 views

Yet another wp_insert_post infinite loop. What is wrong?

I am writing a plugin that enables subscribed users to submit posts of a custom type, and I am trying to implement this feature via shortcodes. Now the problem is that instead of inserting one post, ...
-1
votes
1answer
82 views

How to remove a class [closed]

Is it possible to remove classes from a plugin and add theme into to theme? I need to modify Woocommerce WP_Checkout class but I want to move it to my theme folder so if woocommerce will be updated ...
0
votes
1answer
145 views

Data Validation, dynamically generated fields (select for example)

Working to secure my plugin, I'm not sure what (if anything) to do about output such as dynamically generated select fields. For example, I have a country code select generated on the backend via PHP ...
2
votes
1answer
2k views

Creating a custom public user page

I'd like to develop a plugin that allows me to have custom user pages. I really like the way the author archive template handles the URL: /author/username. I don't want to rewrite the author_base as ...
1
vote
1answer
85 views

Issue plugin commands in admin settings page

What is the right way to issue commands in wp-admin? My plugin imports data from a set of RSS feeds via a cron job. Thats all working good. I've set up a custom settings page to change parameters, and ...
0
votes
1answer
230 views

Structuring function with registration_errors hook

I created a plugin that adds a function to the registration process where the user info also gets added to an external db. The problem is that, when the function runs successfully i.e. user is able ...
0
votes
1answer
264 views

Error: Call to a member function get_error_code() on a non-object

I am getting the following error when with the code that I wrote for my plugin: Error: Fatal error: Call to a member function get_error_code() on a non-object in .../wp-login.php on line 335 I've ...
0
votes
2answers
208 views

wordpress remove views from action links in a custom post

I have created a custom post type, but I want to remove the View link from actions, in the listing of the custom post. I have tried this snippet add_filter( 'post_row_actions',array(&$this, ...
0
votes
2answers
235 views

Listing wordpress users with a search function

I'm having trouble finishing off this code that I adapted from Cosmoslabs excellent tutorial. Everything is working (listing and pagination etc) except the search function whic is returning nothing ...
0
votes
1answer
54 views

Is there anything special required to make a plugin work in a multisite environment?

I've been developing plugins for about a year now, but not having any experience with multisite environments, whenever a question comes up that is specific to that environment I'm generally stumped. ...
0
votes
2answers
66 views

Disable plugin visibility at the plugin directory

Hello I have recently pushed my plugin's files to WordPress SVN trunk. Unfortunately, it's not a ready to use release. I don't want anybody accidentally download this half-baked 'release'. Can I ...
1
vote
1answer
2k views

wordpress get meta value by meta key

How to get the meta value by meta key I want to get the value by the meta key. This is what I have tried so far: $args = array( 'post_type' => 'post', 'post_status' => 'publish', ...
3
votes
2answers
505 views

Plugin screenshots not showing in the repository

I'm having major trouble getting the screenshots to show in my plugin. I have validated the readme file and placed the screenshots in both the /trunk and /tags/1.0 directories (1.0 is stable). I have ...
1
vote
1answer
85 views

Creating a plugin to sanitize comment and the url field before display only

I want to create a plugin to sanitize comment and mainly the url field before display only (not before adding to database), to filter the url fields and only allow displaying this field only if it ...
0
votes
1answer
281 views

Restrict certain actions to plugin-specific admin menu pages only

I'm working on a plugin and want to restrict some things to my plugin-specific admin menu pages only. Therefore, I write the slugs being returned when adding (sub)menu pages into an array so I can ...
0
votes
1answer
62 views

How to relate the Category to user?

I am developing one new plugin, In that i had a section to create new category, and having the field Created By(listing all the users in this field). I am storing the category name in WP_terms and ...
1
vote
1answer
83 views

how to get all the child category name in a specified category name?

Supposed the specified category name is "product", which has three layered sub-categories. The structure is like the following: product one product two product three product four I want to ...
0
votes
1answer
108 views

Doing action based on input from options menu

This is my first time writing plugin. I have managed to get options menu with the html form: <?php add_action('admin_menu', 'menu'); function menu(){ ...
0
votes
1answer
524 views

Get a custom table to an array

How can I take my table I created like this: global $wpdb; //Get all the wordpress database stuff $table_prefix = $wpdb->base_prefix; //Get the global prefix for all sites (on a multisite ...
16
votes
2answers
3k views

Enhance Media Manager for Gallery

I would like to enhance the Media Editor, after WordPress 3.5, on the gallery view. I want to add a new select field on the right side and send the selected values to the gallery shortcode. I ...
0
votes
2answers
104 views

wp_get_theme Warning: Illegal offset type

I'm using Post templates plugin. But its very outdated. I'm getting Warning: Illegal offset type at this line $templates = $themes[$theme]['Template Files']; Here is my full function code. ...
0
votes
1answer
117 views

How to validate inputs with filter in register_setting callback

I now have this function that works well : function wpPartValidate_settings( $input ) { if ( check_admin_referer( 'wpPart_nonce_field', 'wpPart_nonce_verify_adm' ) ) { // Create our array for ...
0
votes
2answers
835 views

Most viewed post of custom post type

Im using following code for getting most populer post with thumbnail.I have a custom post type taxonomy (Talks). Custom post types(video) have 6 category. But my code not working. It just getting 1 ...
0
votes
1answer
67 views

Submit form to db

I am unable to get this insert to db function to work using ajax and a form. When I execute this, I receive a blank alert box on success. HTML <div id="rsvpContent"> <form ...
0
votes
1answer
209 views

Initialize class inside plugin

How can I initialize inside wordpress a class. I would like to send requests via ajax to plugins class. First I have the entry point. class EntryClass{ public function __construct() { ...
2
votes
3answers
2k views

Problems with autoloading classes via sp_autoload_register / maybe interfering WP-specific autoloader

I'm working on a plugin in which I do the following for autoloading classes: function TFSLAutoload($class) { $classfile = dirname(__FILE__).'/includes/'.strtolower($class).'.php'; include ...