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
3answers
2k views

body_class hook for admin pages

The body_class hook seem only to work with non-admin pages. When I do add_filter('body_class', 'add_body_classes'); function add_body_classes($classes) { $classes[] = 'myclass'; ...
0
votes
0answers
30 views

The plugin generated xxx characters of unexpected output during activation

I know this question has been asked 100 times, and I've googled it and tried multiple solutions, but I'm still getting this error. I removed all the white space, tried to encode it in UTF-8 in notepad ...
0
votes
0answers
8 views

Set rules for file uploads to dynamically hide/show menu items

I am curious if anyone has a clue about this? Upload a file. If file meets certain criteria, link the file dynamically to a menu item If file is linked, the menu item will show. Until an associated ...
1
vote
1answer
36 views

Plugin Options Not Saving to Database in WP 4.5

WordPress 4.5 broke my plugin and there are no obvious clues why in the change log The plugin controls the visibility of menu items. Users select one or more countries and whether to show or hide the ...
0
votes
2answers
2k views

How to append new form elements in “Add New” form of Users in Wordpress admin panel?

I'm developing a WordPress plugin and I want to append some extra form fields in add new form of Users section inside admin panel without editing core files. Can somebody help me in achieving this.
0
votes
0answers
21 views

Passing Numbers & Letters in Query Strings

I have been fumbling around with this for 45 minutes now, and can't seem to get anything working 100% as I need it to. I am developing a plugin to allow multiple query strings (1 for "level" and 1 ...
0
votes
0answers
8 views

Option tree wordpress options plugin not save key values

I use this plugin for save values for my theme , actually in localhost in my server works fine , but when i install in production server not works The problem it´s with the keys , if i build a key ...
0
votes
1answer
22 views

Option page's form doesn't work

I have two option pages: General Options > MyOptionPage1 and CustomPostType > MyOptionPage2 Both have a form, but the after clicking Save in second option page I land in the 404 page. Here is ...
-1
votes
0answers
21 views

Events Plugin on WP Multisite

I recently created a website for an organization that hosts many events each year, and in their site I tried to build a custom events plugin. It worked great on my local environment, but gave their ...
0
votes
1answer
32 views

Calling a save function from a “submit” button

I am trying to call a function to save changes from a submit button, but I am not accustomed to PHP programming, as I have just started. I tried Googling around a bit, but didn't find anything too ...
0
votes
2answers
35 views

Is it possible to define variables in a wordpress shortcode, and then call the shortcode using a specific variable?

This is my first go at making my own shortcode. What I am trying to do I have 11 different outputs for star ratings I want to be able to use in posts. I want to wrap it all into one shortcode, and ...
0
votes
0answers
15 views

Access submenu without giving access to menu page

I have created a custom post type 'book' and added few submenu's to it, which are also custom post types eg (novel, science, history etc.). I added seperate capabilities to all of the custom post ...
0
votes
1answer
2k 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. ...
1
vote
1answer
34 views

Order of Operation for these three hooks

What is the order of firing for these three hooks? add_filter( 'comments_array', array( $this, 'BuildCommentsArray' ), 10, 2 ); add_action( 'preprocess_comment', array( $this, 'write' ), 10, ...
6
votes
4answers
764 views

Prevent network activation of plugin

I have a plugin that currently doesn't support network activation. The best fix for this of course is to fix it :) which I plan to do. However I wonder if there is a temporary solution I can use to ...
1
vote
1answer
32 views

Verify if user is wordpress logged in from another app since wordpress 4.0

I try to implement in my Node.js app a way to verify if the user cookie is valid. I've found some post in internet who explain me very well the things, but as i try to implement it, with the ...
0
votes
2answers
35 views

Is it save to use eval for a jQuery callback method coming from the database?

I'll be brief and hope I can explain my scenario correctly. Here's my scenario. The jQuery slider plugin has an anonymous callback method. I would like to give the Admin the ability to create a ...
0
votes
2answers
14 views

Change plugin name on WordPres repo

Months ago i have created a simple WordPress plugin that shows Latest post with thumbnails, but as the plugin name includes the word "Ads" it has been a report from a user that the plguin assets are ...
1
vote
2answers
35 views

wp_enqueue_script + wp_enqueue_style Since When

wp_enqueue_script + wp_enqueue_style: these 2 are recent inventions in wordpress are they are from many years. I purchase a course from udemy his authors hasn't used these functions. His videos look ...
0
votes
0answers
691 views

How to call a new php page inside a plugin page?

I have a custom plugin that is accessible via WordPress sidebar, this is the option page of my plugin. How do I called a new page inside my option plugin page? <li><a href="<?php echo ...
0
votes
1answer
10 views

Get images / media attached to a page by page ID

I have a series of pages which have images included on them by means of the HTML editor in the admin area. I need to access these while NOT on the the actual page in question, i.e, I need to access ...
0
votes
1answer
39 views

Does a blank plugin come with any overhead?

I dont really like big plugins like jetpack. I find it much easier to manage multiple plugins with a single piece of major functionality rather than 1 plugin that does everything and use an options ...
2
votes
0answers
79 views

How to modify the new WordPress 4.5 link inline toolbar

I had my own plugin that add custom links options to the old wordpress link edition window (data attribute, nofollow etc). The new inline link toolbar introduced in WordPress 4.5 is ... not what I ...
0
votes
0answers
14 views

plugin settings - multiple upload buttons in sections: how does sanitize_callback work?

my plugin' settings page includes a series of sections, each one contains an upload button: // create the input with the *exact* setting's name function myplugin_upload_cb($args) { echo "<input ...
1
vote
1answer
14 views

plugin settings - uploading multiple files with a single button

My plugin settings' page has a <input type='file' name='adm_uploads' multiple /> button which allows my browser to select multiple files as expected. All goes well except that in my ...
0
votes
1answer
9 views

Problem with adding custom post type meta to header by plugin

I'm trying to write a plugin by which a meta code will be added to specific post type header. I tried to use this code: function msc_header() { if ( is_singular( 'article' ) ) { echo ...
0
votes
1answer
3k views

How to access global variable $menu inside a class function

am puzzling why can't i access the global variable $menu inside a php class function class adminMenus { public function getWPdefaultmenus(){ global $menu; return $menu; } } using ...
0
votes
0answers
16 views

How gzip compression still happening?

I am using Ubuntu 14.04.4 LTS,Apache/2.4.7 and PHP 5.5.9. I installed Wordpress 4.4.2 in my machine. When I run my site in localhost, I noticed that js/css are compressed in gzip format. I didn't ...
4
votes
2answers
114 views

Avoiding plugin name collisions with WP updater

I have a client who has a WordPress site that uses a custom plugin written for them by another developer. Recently, they ran the WordPress updater and one of the updates clobbered that custom plugin ...
0
votes
1answer
67 views

Woocommerce change shipping method by hook

What I would like to do is to have a condition to pick which shipping method is used. For orders with total cost < 100 the shipping method should be 'regular' and for orders with total cost > 100 ...
0
votes
0answers
42 views

WP add_rewrite_endpoint - custom post types destroys permalink URL match

I'm trying to implement AMP-versions to Wordpress posts with a custom plugin. The problem I'm having is that we use a bunch of different post types. They all have their own permalink structure. For ...
1
vote
1answer
37 views

Where does WordPress register default scripts like jQuery?

I'm figuring out the ins and outs of WordPress. I know that WordPress sets some default filters and actions in /wp-includes/default-filters.php, but where does it register its scripts like jQuery? We ...
2
votes
2answers
538 views

Get image URL from media library in input

On wp-admin/post.php?post=447&action=edit for example I have a link and an input. The link appears as follows: <a href="#" class="button insert-media add_media" data-editor="tj_image_url" ...
0
votes
1answer
71 views

Use plupload to upload images and save them to custom folder and database table

I'm building a plugin and I need to upload images and save them to a separate folder from the default wp media folder and to a custom database table. I managed to do both, but for every uploaded ...
0
votes
0answers
11 views

restrict_manage_posts takes from edit.php to edit-comment.php

I am trying to add another filter options on pages screen with following code. When I click on the filter button it takes me to edit-comments.php page. Screenshot: 1) http://snag.gy/VmOhD.jpg 2) ...
0
votes
1answer
42 views

Using OOP inside a Plugin - Is it allowed?

I have pre-written Objects that do such things like file checking the MIME type, then a main upload object but neither of which use the Database. So I am just curious to whether I could intergrate ...
2
votes
2answers
743 views

Multiple files in a plugin

I'm trying to write a plugin with multiple files. I'm sure I did it before without a problem, but now I have the problem in the subject. In the main plugin file I have included a file name - ...
0
votes
1answer
20 views

Is It Always a Best Practice to Decouple the Frontend from the Admin Area When Developing a WordPress Application?

Is it always a best practice to decouple the admin area from the frontend portion in a WordPress application? Are there any instances when one might want to use the admin area/screen as the ...
1
vote
2answers
60 views

Custom Post Type: Upload Multiple Images

So I'm making this Property Listing theme for a client of mine, and on the Properties Custom Post Type (CPT) which I have created I need to add a meta box that allows him to upload multiple pictures - ...
0
votes
0answers
26 views

Update count value based on user visit

I'm working for a custom plugin for getting user count. That plugin will show up user visit count in front end based on date/week/month/year. Here i got the count value for d / w / m / y but now i ...
0
votes
1answer
37 views

How to submit/upload data to database and in specific folder?

I am trying to make video plugin. Want to submit data to move the file in a folder which is in the plugin_name folder. To submit/upload I am trying the 'plugin_dir_path()' function. And it is not ...
0
votes
1answer
25 views

Add predefined values to custom post plugin

I have already created a custom post plugin. I need to add predefined text/values, when creating new custom post within this plugin. Is it possible to handle these predefined text/values in my ...
0
votes
1answer
61 views

Using AJAX in FrontEnd with Wordpress Plugin Boilerplate (wppb.io)

I'm trying to do a tag box similar to that of the backend, but for the frontend. I'm using AJAX to get tag suggestions as the user types in the input field. I've used AJAX in Wordpress in the past ...
0
votes
3answers
45 views

Plugin base URL

In a question that is related to, but not the same as, How to link to images in my plugin regardless of the plugin folder's name plugin-folder/plugin-main-file.php plugin-folder/images/ ...
12
votes
3answers
1k views

Conditionally enqueue a widget's script/stylesheet in HEAD (only when present on page!)

I've been trying to load scripts and styles for a WordPress widget with the following conditions... The scripts MUST load in the HEAD (else they break). The scripts must ONLY load when the widget ...
1
vote
1answer
89 views

AJAX success response is not working but it's saving my changes

I'm a beginner in jQuery-Ajax so please bear with me. My Ajax response does not seem to load but my changes are being saved. but gives me this error on admin-ajax.php "call_user_func() expects ...
0
votes
0answers
21 views

Why is error shown twice? (how to apply menuitem to menu correctly?)

Starting to create a plugin that adds content and hooks that content into a menu (in this case below I started to add a search-functionality to hook into menu just for testing) if( ...
1
vote
2answers
265 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
2answers
851 views

Ajax +wordpress onClick link redirect to new page and create html content

i have two pages in my wordpress plugin index.php charts.php in index.php i have some content and some link.. <a onclick="show_trend()" >Trend</a> while clicking this link ,i have ...
0
votes
1answer
26 views

Can plugin automatically update if i hide the update notification?

I'm trying to remove the plugin update functionality from specific plugins. I have searched about it and find a good answer. According to the answer below function actually hiding the update ...