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)

4
votes
1answer
2k views

Export data as CSV in back end with proper HTTP headers

I wrote a plugin that displays all products in a woocommerce store in admin settings option, now I want to add a link to download the products as CSV file. The problem is, when I click the link I get ...
2
votes
3answers
90 views

When is wp_loaded initiated only with admin or only when user enters the site or both?

When is wp_loaded initiated? Im trying to add function that downloads a big file for the plugin DB, and I need it to be executed whenever user/admin/unknown user get in the frontend, after the site ...
1
vote
1answer
40 views

Create a plugin to change the action to which a function is hooked

I have a plugin that hooks a function on to the woocommerce_before_my_account action. I would like instead for the plugin to hook that function to the woocommerce_after_my_account action. If I ...
-3
votes
1answer
26 views

Difference between WordPress stand alone & through host gator

I am new to WordPress development, I noticed a certain thing in the pricing. If I go into www.wordpress.com and try to buy a plan for e-commerce , I am getting a quote of $299 per year but if I buy a ...
1
vote
1answer
41 views

Do uploaded plugins get updates if they came from the wordpress plugin directory?

I'm a plugin developer and want to ensure my users are getting updates when I release an update within the wordpress plugin svn repo. I know if they search for the plugin through the plugin area of ...
0
votes
0answers
27 views

In WordPress do I create tables for my plugin or do I create custom post types for a Student and Classes Registration system?

I want to use WP 4.x as a framework to build a small Student system. I do not wish to use an existing plugin. My needs are unique, and these do not do what I need. In my design, I have Students ...
1
vote
1answer
54 views

Why does Wordpress have a noop.php file?

While configuring Ctags to recognize WordPress functions, I came across the noop.php file. Here is an excerpt: /** * @ignore */ function add_action() {} /** * @ignore */ function did_action() {} ...
7
votes
8answers
9k views

Wordpress Plugin Development - Headers Already Sent Message

I'm developing Wordpress plugins. When i activate my plugin, i'm getting a message The plugin generated 293 characters of unexpected output during activation. If you notice “headers already ...
0
votes
0answers
21 views

Custom Taxonomy with Core Post Type Pagination Issue

I've added a custom taxonomy to the core Wordpress Post Object: register_taxonomy("main-category", "post", array( "hierarchical" => true, "labels" => $tax_labels, "public" => ...
0
votes
1answer
23 views

get_avatar filter in WordPress 4.4, how to filter properly

Old code in my plugin replaced the get_avatar. It stopped working with the release of WP 4.4, therefore, I decided to try to learn how to use add_filter instead. There are other posts discussing the ...
0
votes
0answers
23 views

Need to hide form after submission

I am trying to hide a registration form after submission so that it only displays the thank you for login in or a default thank you page what is my best method for hidding the form after i register ...
0
votes
0answers
24 views

add_action wp_ajax_ not loading in plugin file WP Network

I'm developing a plugin that relies pretty heavily on AJAX calls. It works well in a single-install version of WordPress, but when I ported it into a Network WP my AJAX functions stopped working ...
0
votes
0answers
26 views

Integrate existing simple plugin with wordpress multi site

I have a simple plugin that add's new currency to woocommerce. Here is the code: <?php if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( ...
2
votes
4answers
4k views

How to return only certain fields using get_posts()

I'm trying to get only the fields that I need using the get_posts() function in WordPress. I currently have the following code: $posts_args = array( 'orderby' => 'post_date', ...
0
votes
0answers
17 views

Upload Image from Custom Field to Wordpress

What do i really need .. is .. for example: I have Custom Field "image_url". I go to google and search for image. I found one. I manually place the direct image link to my "image_url" custom field. ...
0
votes
1answer
23 views

How to insert category name above post title in a featured pages plugin?

I'm trying to hack a plugin to insert the category name of the post above the post title in a plugin/widget that displays three posts in a single row on the front page. The hack I tried is as ...
0
votes
1answer
36 views

term_exists() returning NULL on term that exists

It seems that term_exists() is returning NULL for a term that already exists: $name = "כל האזורים" $taxonomy_name = "geographictermsisrael" $args = array("slug" => "everything", "parent" => 0) ...
0
votes
0answers
17 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
1answer
27 views

Multiple API Endpoints (wp_remote_get)

I'm trying to create a custom page with data from external API. But i need to get data on 2 endpoints $json = json_encode(array( )); $response = wp_remote_get('https://api1.endpoint.com', array( ...
0
votes
1answer
67 views

Is there a way to make is_search() always return false

I am making a plugin that display related posts when users put the wrong URL... Samples are like this http://diskonblog.net/gandaria/hellow I do not want to change the theme at all. However, for ...
0
votes
0answers
23 views

XML feed for Wordpress Social Board plugin modifications

At work, I've been tasked with modifying the Wordpress Social Board plugin by duplicating their RSS feed functionality to display an XML feed specific to our calendaring system. For example, this is ...
1
vote
2answers
3k views

query users by role

I have a custom plugin which queries users and usermeta, but I now need to filter admins out of the results. A very simplified version of my sql query is: SELECT * FROM usermeta LEFT JOIN users ON ...
0
votes
0answers
18 views

Difference between wp_salt schemes

I am running a wordpress user system with 15k users/day. I have a custom message system and there is an issue in it. Sometimes (like at 1/1000 users) wp_hash that generates security nonce returns ...
0
votes
0answers
12 views

get_option() is undefined in TinymceWindowManager

I have added button to tinymce editor, which opens Popup using TinyMCE window manager and popup file is sbb-pop.php. I want to show settings using get_option() on popup window. But it throws error ...
1
vote
1answer
36 views

When is the proper time to minify css and js with git workflow?

New to web development, and have been utilizing a git repository for my wordpress website. I maybe over thinking this but here goes... Currently, my workflow is as follows: Make changes locally and ...
0
votes
1answer
36 views

How do you clean a filename after image sideloading a url that contains `%20`?

Right now I'm creating a plugin to sideload images from an external source. The UI allows me to select files on the external server then downloads them via AJAX & media_sideload_image. ...
1
vote
0answers
16 views

How to create a backend for a custom theme?

Let's assume that there are six different pages in a website. Each page is different & only common part is header & footer. So how will you create back end such that most of the website can be ...
1
vote
1answer
694 views

How to Use WordPress Color Picker API in Custom Post Type Metabox

I have a Custom Post Type called "Banner" which has a custom Meta box with two advanced fields "Title" (text Field) and "Color" (color Picker). Can you please let me know how to use the WP Color ...
0
votes
0answers
25 views

Wordpress get value get_query_var('paged') of a url

Am creating a custom wordpress funtion that receives ajax url value , and i want to get the value of var paged of the received url see below code : functions.php function something() { $p= ...
5
votes
2answers
2k views

How do I create links at the top of WP_List_table?

I am trying to create links like the ones in the post tab. See Image Below. I created my WP_List_table but I am not sure how to create those links or how to get them to show a different db query. I ...
0
votes
1answer
34 views

Help me filter get_adjacent_post

I'm not keen on private posts interspersed with published posts on the front end, so I'm writing a plugin that seeks to segregate and separate them out. As part of this I want to modify the post ...
0
votes
1answer
44 views

How should I go about registering JavaScript that isn't a file? [duplicate]

For a plugin I'm creating it generates custom JavaScript that should be executed in the footer of the page. Being that it's custom JavaScript, I can't simply put it in a file and register & ...
0
votes
0answers
24 views

How to add mp3 uploader as custom field in custom post type? [custom-post based plugin ]

i'm developing a plugin which is based on custom post type. i want to upload mp3 file with each new post which is my custom post. for that, i have to upload mp3 file and some meta info of mp3 file. ...
0
votes
0answers
18 views

Retrieve specific field value for every menu items in nav menu

I'm added the new custom select html tag filed with two check boxes to menu items all work without any problem and i create this code within Walker class <?php if (!empty($item->normalwidth)) { ...
1
vote
1answer
61 views

Use register_taxonomy() in register_activation_hook()

I would like to use register_taxonomy() to define a hierarchy of geographical terms. It seems that the natural place to place it would be in a function called by register_activation_hook() seeing how ...
0
votes
0answers
8 views

Wordpress plugin(widget) development error logs [duplicate]

I am trying to development a wordpress widget, but for most time it's really hard for me to debug. Are there any way in wordpress plugin development that I can print something in a error_log file?
0
votes
0answers
50 views

enqueue css in a wordpress plugin condition

I have found a bug in a wordpress plugin /plugins/woocommerce-eu-vat-assistant/ In checkout page if the option "Added possibility to make EU VAT field compulsory when the customer enters a company ...
0
votes
1answer
27 views

Adding custom fields to Wordpress nav menus

I'm added new custom checkbox field to the nav menu items. the check box added without any problem when i check it it's work but when i want uncheck it not work and stay in checked state. the code ...
1
vote
0answers
26 views

Sharing a common set of image files for media library, across all sites within multisite

In mutisite, the uploads directory structure looks like this: /wp-content/uploads/sites/1/ /2/ /3/ Each number is the id of the site within the ...
1
vote
0answers
30 views

Get draggable widgets on Edit Post page

Is it possible to get the widgets with settings (just as widgets.php page) on the Edit post (like attached image) ? There i can define a custom sidebar in post meta. However how to get the list of ...
0
votes
1answer
46 views

plugin_dir_url & plugin_basename not working when plugin dir is outside wordpress dir

I have been using these functions for quite a while now but yesterday I noticed that they were not working properly on a site where the plugin directory was outside the main WordPress folder. ...
0
votes
0answers
20 views

Execute code only after user clicks 'update' button for CPT being edited

In my plugin, my custom post type posts might be updated either by a user clicking 'update' on the editor page, or programmatically. I need to execute a settings validation routine only when the ...
0
votes
1answer
27 views

Getting duplicate page when activating my plugin

I am creating a plugin in which I need to create a dynamic page and assign a template to it. I have created it using the code below: function gallerypage() { global $wpdb; $check_page = ...
0
votes
1answer
68 views

How to call external functions from a PHP script in a WordPress plugin?

I'm a WordPress beginner, and I have tried to develop plugins, but I don't know how to call external functions in a WordPress plugin. For example, I have an external PHP script called download.php in ...
0
votes
0answers
21 views

Displaying friend's posts only

So I am using the WPMU Dev friends plugin which adds functionality for WP members to search for friends and to add new friends etc. There is a specific function defined in the PHP file which says it ...
1
vote
1answer
21 views

preprocess_comment array doesn't have comment_ID

I have a function using the filter preprocess_comment and want to use the update_comment_meta( $comment['comment_ID'], 'post_id', $post_id );. However, the array in preprocess_comment doesn't have ...
0
votes
1answer
20 views

Proper Prepare Statement for ALTER TABLE and using AFTER

My code for ALTER TABLE doesn't make use of the prepare() method of $wpdb and so the code needs to be updated properly. There are plenty of examples of query SELECT, etc but couldn't find something ...
0
votes
0answers
23 views

Adding tab to custom TinyMCE plugin

I am creating a custom button for the wp posts editor by following this documentation. I replaced the addCommand callback with something like this: ed.windowManager.open({ ...
0
votes
1answer
13 views

Plugin outputs content of posts unbidden!

I've written my first plugin. The intent is to show the image, title and excerpt of the first 6 posts. (It uses a function from Divi, here and there). function jm_blog_layout($atts) { ...
0
votes
1answer
50 views

Taxonomies within plugin invalid

I have two taxonomies being registered in a functions file. They are then initialized like so: function foo_register_post_types_and_taxonomies() { foo_register_post_types(); // defined in ...