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
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
2answers
41 views

Where to enqueue stylesheets for plugin?

I want to enqueue stylesheet to plugin I'm developing, like this: function utm_user_scripts() { $plugin_url = plugin_dir_url( __FILE__ ); wp_enqueue_style( 'style', $plugin_url . ...
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"); ...
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 ...
1
vote
2answers
44 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
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
43 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
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 ...
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
43 views

wp_query (or hook) posts by date (id) in array then set post_type

Hi I am building a plugin and am not as familiar with wordpress hooks as I would like. The code would not be used to display on a page rather just setting in the database. I am looking for a hook or ...
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
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 ...
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
47 views

How to set a header in wp_safe_remote_get()?

Previously I am using the below code. Now I need to change this code and replace file_get_contents() with wp_safe_remote_get(). I need to know how to set 'header' => "Accept: application/json" ...
0
votes
1answer
24 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' ...
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 ...
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
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?>" ...
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 ...
0
votes
0answers
38 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
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
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 ...
0
votes
1answer
117 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 = ...
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
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
17 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
0answers
15 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 ...
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
32 views

Allowing all HTML tags in textarea

I'm developing a plugin that has a custom field which is a textarea that needs to accept all HTML tags. To sanitize the data, other than using wp_kses() and including an array of every HTML tag that ...
0
votes
0answers
24 views

How to protect a comment with a password?

Is there any way to Protect a comment with a password so that the comment can be seen only when the right password is entered. I know a post can be password protected , but thats not the way i want ...
1
vote
0answers
37 views

Is it possible to delay execution of shortcode output callback?

I have a problem : shortcode output callback triggered too early. /* Defined in plugin constructor */ add_shortcode( 'foobar' , array($this,'pre_render_routine')); function ...
1
vote
0answers
16 views

Use just a shortcode from another page

I am building a bbpress forum and I have it set up right so that when you click a forum it displays a loading image and loads the link with ajax instead of redirecting the page However, this loads ...
0
votes
0answers
47 views

How to develop custom URL redirection

I'm writing a custom theme and have a custom post type which represents an external entity (e.g. a website). Hence, I have a field 'external_url' in my post type. Part of the custom post type post's ...
0
votes
1answer
64 views

Adding Additional Variables on Menus Page

I'm learning PHP by building a plugin to show or hide menu items based on a user's location. I am a bit stuck at the moment. In the function below, the text input is being saved to the database, but ...
3
votes
1answer
21 views

Adding extra pages to plugin that shouldn't appear in the sidebar

I'm trying to add extra pages to my wordpress plugin and link to these pages through links, form forwards etc. I don't want them to appear in the menu on the left - so add_submenu_page isn't the ...