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
0answers
23 views

Wordpress price filter search

I am going to start create a website for a client.In his website. He need something like this Well First of all I am sorry if this question is not for this community. But I really want to k now ...
0
votes
0answers
24 views

Hide Activate Plugin message until my condition is not true

Hi i am creating a custom plugin in which i am working on dependency. so i am using the following code . include_once(ABSPATH.'wp-admin/includes/plugin.php'); function ...
1
vote
3answers
137 views

How to determine if the current file is loaded in a plugin or in a theme?

How to determine if the current file is loaded in a plugin or in a theme? A boolean PHP function.
0
votes
0answers
32 views

How to delete more than one table while uninstalling plugin

I have create a plugin which is creating multiple table while installing so now i want to delete them while uninstalling plugin. This is how i create the multiple table while installation function ...
-3
votes
1answer
32 views

Getting warning of Missing argument 2 for wpdb::prepare()

I am using prepare method with Update Query $updatequery = $wpdb->prepare("UPDATE `".$table_name_sms."` SET sftemplate_name = '".$message."',sftemplate_type = ...
0
votes
0answers
32 views

How to Write simple update query in Wordpress

Hi i have update query which is working fine $table_name_sms = $wpdb->prefix ."smsfactorymessagetemplate"; $updatequery = $wpdb->query("UPDATE `".$table_name_sms."` SET sftemplate_name = ...
0
votes
0answers
16 views

Display custom wp_before_admin_bar_render link only for subscribers

I have wp_before_admin_bar_render link called applications . I want this link exclusive only for subscriber users. Here is my code. add_action("wp_before_admin_bar_render", "add_event_app"); ...
1
vote
2answers
45 views

Is using WP Transients to save external data for a plugin the best/right way?

I am developing a plugin which relies on external data to be fetched from time to time. To speed things up, I´d like to cache the received data and refresh it in intervals of 10 or 15 minutes. This ...
0
votes
0answers
28 views

Developing Wordpress Plugins with storing and exporting thousands / millions of data

I want to develop a plugin that will import and export WordPress users with csv file. But my concern is looping thousands or millions of data without exceeding php execution limit or Internal Server ...
0
votes
1answer
27 views

Call to undefined function error in plugin

I wrote a function inside a class that gets a user's country from the IP address... function getcountry() { if (!class_exists('GeoIP')) { include_once("geoip.inc"); } if ...
0
votes
1answer
48 views

How to add credit card validation check to wordpress [closed]

Im working on a restaurant reservation website and I need to add a feature similar to one found on booking.com, that is once someone wants to make the reservation I would need them to leave us their ...
1
vote
0answers
15 views

When to use Exceptions vs Error Objects vs just plain false/null

I'm in the process of writing a plugin and I'm trying to gauge when to use different approaches of handling errors. There are three methods I'm considering: Throwing an Exception (custom class) ...
0
votes
0answers
23 views

Is there a way to capture http request variables and provide different content?

I want to implement a rest webservice on top of wordpress. That means that for a given content type (custom), if the request either cotains something like ?format=json or the http negociation accepts ...
0
votes
0answers
13 views

Custom search for users

I've coded this up and it works great to search for "John" as a wildcard: $your_search_string = 'John'; $user_list = new WP_User_Query( array( 'search' => '*'.esc_attr( ...
0
votes
0answers
42 views

Marking Multiple Options Selected in Different Select Boxes

I've added a multi select box to each menu item on the Menus page. How can I mark multiple items as selected for a given select box? <script type="text/javascript"> ...
0
votes
0answers
44 views

Extending TinyMCE to Work with Medium Editor

I'm trying to extend tinyMCE. What i'm trying to achieve is to use this Medium Editor extend tinyMCE functionality as buttons within the backend Page / Post / Custom Post Type. This is similar to ...
0
votes
1answer
1k views

How to get current page name in my wordpress plugin

I am creating a custom wordpress plugin. Where for some pages like http://example.com/clinic http://example.com/pharmacy i will append my template code from my plugin folder. Which mean i will ...
0
votes
1answer
23 views

Adding another field to user table

I would like to add another field to user such as address, phone no. Added related fields in wp_users and add some come and updated with wp_update_user but it doesn't work. I can add in wp_usermeta ...
0
votes
1answer
34 views

Update File Once Every 30 Days

I'm building a plugin that requires a database file which is updated monthly. I would like to write a function that automatically replaces the old file once every 30 days. Here's what I have so far. ...
0
votes
1answer
33 views

Wordpress custom plugin that uses woocommerce enabled payment gateway for payment

I have a certain special product that I do not want to be listed with other products, nor be added to the cart. I want that specific product to have a fixed customized page where the user can pay for ...
0
votes
1answer
40 views

Developing a plugin where users can edit entries saved in database

it's the first time I'm writing a plugin. So far, it creates a table in database on activation, users can add entries to database and they can check saved entries. I've added Edit and Delete links ...
1
vote
2answers
27 views

Can i create two tables at single time while installation of custom plugin?

Hi i want to know can i create two tables while installing my custom plugin. This is the way i am creating the tables in database function wnm_install(){ global $wpdb; global $wnm_db_version; ...
0
votes
2answers
48 views

How to insert variable which contain array value in wp_options table?

I have create a form and i want to store the form data in wp_options table so for that i have created this query $insertquery = $wpdb->query("INSERT INTO `wp_options`(`option_name`,`option_value`) ...
0
votes
0answers
31 views

Can I override the permalink/slug on creation

I have a plugin that imports data from an external API, creates a 'Product' Custom Post type ( or updates an existing one ) and then adds all the meta data. Every time we update the product from the ...
0
votes
1answer
24 views

What is more secure checking capabilities of user or checking role of user in WordPress plugin development

Suppose I need to check the logged in user is subscriber not anyone else. So if I check the capability like "read". Then subscriber is OK but "read" capability is also associated to admin/publisher as ...
1
vote
0answers
26 views

How to append element after thumbnail

Hey I just wanted to know how to add an element after the first thumbnail image in my loop. Basically I want an HTML div tag inserted after the first image in my post. Anyone know how to do that in ...
0
votes
0answers
16 views

Lost/Forgot Password on same page

I have a plugin that creates dynamically login page template, where login and forgot password input box both are there (www.test.com/login). Login works well with : add_action('wp_login_failed' , ...
0
votes
1answer
25 views

Data inserted by wpdb insert is different than data pressnt in database.

I have made this insert query: $insertsuccess = $wpdb->insert( 'compservices', array( 'orderId'=> $orderID, 'orderedTime' => $date, 'useremail' ...
1
vote
0answers
47 views

Where to add hooks in a class

In the code below, shouldn't the hooks under the bottom two functions be placed inside the constructor? class The_Class { private static $instance = null; public static function ...
0
votes
1answer
18 views

Deactivate Other Incompatible Plugin Upon Activation

I'm building two mutually incompatible plugins. When either one is activated, the other must be deactivated. I'm using the code below to accomplish this. It works fine the first time I upload and ...
0
votes
0answers
22 views

Sanitization in wpdb insert not working

I have given below insert query and provided <script>alert("hello");</script> to insert in address field. But It seems its is not sanitized. In PHPMyadmin I am able to see the inserted ...
1
vote
1answer
20 views

Dynamic CSS Vs Inline Issues in Code any Way around in a Wordpress Themes?

One of my Developer has used this kind of Code to style - <div class="progress-bar progress-bar-striped custom-color-progress" role="progressbar" aria-valuenow="<?php echo $percentage?>" ...
1
vote
1answer
91 views

Adding content before the loop in category pages

I am creating a plugin and I want to show all sub category list in the top of every category page. I had created a function and call "wp_list_categories" in that function. The problem is when I call ...
0
votes
0answers
39 views

Notice when Extending WP_List_Table

I have extended WP_List_Table in my class, and have a fully functioning class. However I'm left with the following warning: Notice: convert_to_screen(), add_meta_box() was called incorrectly. ...
0
votes
2answers
36 views

_e in wordpress + <a href=“<?php bloginfo('url');?>”>Home</a>

In wordpress we use _e when we have to print things. Example - <div class="col-md-12 col-sm-12 col-xs-12 tuts"> <p><?php _e( 'We are sorry, but there is nothing here! You might ...
1
vote
3answers
87 views

Loading scripts with wp_register_script and wp_enqueue_script

How could I include the following script and stylesheet in a wordpress plugin if they only need to load in the admin panel? <script type="text/javascript" ...
0
votes
0answers
20 views

How to make conditional wp_dropdown_categories

I would like to filter posts by using wp_dropdown_categories on change event of first category next dropdown updates with remaining categories listed in second category which matches the post. Please ...
0
votes
1answer
118 views

Chosen Select jquery Not Working in Plugin

For some reason js and css files are not loading in my plugin. Here's what I have: (ostensibly unrelated code replaced with '...') class Location_Specific_Menu_Items { private static $instance = ...
0
votes
0answers
17 views

Create Dynamic List of Pages that are visible to search engines

I am creating a website that has a database of games. Each game will have Title, Description, Banner Image, Rating, etc... I want to just enter the game into my custom database table and have the ...
1
vote
1answer
22 views

Some strings from a .mo file do not load

In a plugin I'm developing, most translations do work, but some strings refuse to work without an apparent reason. For a settings page, I'm using this pattern: $clgs_settings_descriptions = array( ...
6
votes
2answers
3k views

Custom Post Type Plugin: Where Do I Put The Template?

I'm writing a custom post type plugin. Part of it I'm outputting to the template via shortcodes. But other parts need a custom post template, and I figured out how to use the template hierarchy for ...
0
votes
2answers
25 views

Plugin create pages and use templates

I have a plugin that is creating a few pages and I want to use the custom templates I made for those specific pages. The pages a creating fine and even one of the templates is working but the other ...
8
votes
3answers
278 views

Best Practice for Referencing the Plugin Directory

My plugin uses the following code to reference a file, but I've read WP_PLUGIN_DIR won't work if a user renames the default plugin folder. I would also like to replace ...
3
votes
2answers
73 views

What is the added “complexity” of custom tables?

Wordpress Codex says: Think very carefully before adding a table because it adds complexity to your plugin that many users and site builders prefer to avoid. Why is it so? Adding more tables is ...
1
vote
1answer
48 views

Call to a member function have_posts() on a non-object on normal loop

<?php defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); define( 'MY_PLUGIN_PATH', plugin_dir_path( __FILE__ ) ); define( 'MY_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); ...
0
votes
0answers
63 views

How to open the Attachment Editor frame in the WordPress media modal?

I am building a plugin that uses wp.media to launch a modal where the user can select multiple images to add to a gallery. There are many tutorials that explain this process and I managed to ...
0
votes
0answers
18 views

Add wordpress category id to user meta with button

I want to know which categories my users are most interested in so I want to add a button to categories theme so if they click it that is saved to user meta. Similar to this: Let user subscribe to ...
0
votes
0answers
26 views

wp_verify_nonce() didn't work in the function

I'm creating link with wp_nonce in GET parameter: $link = esc_url( wp_nonce_url( add_query_arg( 'my_arg', 1 ) , 'product_subscription' ) ); echo '<a href="'. $link .'">'. $link .'</a>'; ...
0
votes
2answers
49 views

Wordpress restrict plugin file direct access

i am developing a wordpress plugin, but before that i have checked the code for the few plugin already developed. I have seen a common approach to restrict the direct where the plugin developer starts ...
0
votes
0answers
16 views

Multisite Woocommerce Price Plugin Help Need

I want to make woocommerce multisite plugin. Which can share price and convert into local currency from main website. Price share based on user desire, not for all products. If someone know about ...