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
1answer
115 views

Custom Plugin - CSS works, JS doesn't

In the plugin I'm making, I use separate js and css files (____.js, ____.css). This is the first time that I've included an external .js file in anything. I'm registering and enqueueing both in the ...
1
vote
2answers
59 views

Why is my ajax call refreshing the page?

I'm attempting to upload an audio file via AJAX form. Here is my HTML in the profile-edit template. <form method="post" id="my_upload_form" action="" enctype="multipart/form-data"> <input ...
3
votes
2answers
40 views

Escaping built-in WP function return strings

Should one filter the output of builtin WP functions such as get_permalink() and well-known WP plugins such as ACF (Advanced Custom Fields) such as get_field()? For instance get_permalink() calls ...
0
votes
1answer
458 views

Howto: Use Custom Post Types as Submenu Items in Admin

In a plugin, i've created 3 Custom Post Types, for example: Dogs Cats Goldfish I've also created a "Pets" Top-level menu page using add_menu_pagewherein I'd like to add the 3 CPTs as submenu ...
1
vote
1answer
657 views

Display custom fields in frontside user profile

I installed the CIMY User Extra Fields plugin to add new custom fields in theuser profile. I added 1 custom field for gender to the user profile but it displays only in the admin panel user profile. ...
1
vote
1answer
32 views

Custom role capabilities to administrator not taking effect (no plugin)

I have created a custom post type from a plugin. I added a capability type teacher. Then I have added custom capabilities to administrator. But the problem is for the first time after completing this ...
0
votes
0answers
8 views

Jetpack filter hook for twitter publicize post

I would like to know whether is there any filter hook in jetpack plugin which gets called before post get published on twitter through jetpack using publicize feature. I browsed many times, but I ...
0
votes
0answers
13 views

How to create session for user which is not an admin user

Hello I am working on building a plugin which has the following functionality like stated below My problem is I am stuck at point I have created registration form for the users where users will be ...
0
votes
0answers
21 views

Update broke rewrite rule

With the update from 4.4 to 4.4.1 somehow suddenly my rewrites aren't working anymore. I've written a plugin to show attachments on a page (the landing page specifically) so people that come to the ...
2
votes
0answers
32 views

Global Objects and Public Methods

I'm developing a plugin and am just thinking over best practices. How common is it to have a global object? Currently on plugins_loaded I am creating a global object of my class: add_action( ...
1
vote
1answer
17 views

JS Support Ticket - Auto create WP account

Maybe you guys know if it's possible to create an account when a new user creates a ticket. At this point there are 2 options. Let user create a ticket based on e-mail address Let user create an ...
0
votes
0answers
23 views

Getting a value of a post taxonomy object

The following returns the list of names of all taxonomies from my post_type: $date = get_object_taxonomies( "pa_first-registration-date" ); var_dump($date); Within this array I have the value: ...
8
votes
3answers
267 views

Vagrant script to setup all the common PHP / WordPress version combinations

I am looking for a way to quickly and repeatedly set up testing / debugging environment for our plugin, most probably using Vagrant. Projects like VVV focus on a single-environment setup (or, a couple ...
0
votes
1answer
20 views

Unable to give correct path in wordpress

Suppose their is a wordpress theme say zumper. Apart from files such as footer.php, header.php their are other folders such as layouts inc suppose I have a file america.php in layouts folder and ...
0
votes
2answers
910 views

AJAX request not routing through proxy

I've built a plugin that uses AJAX to post a URL to the URL2PNG API and bring back a screenshot into WordPress via wp_remote_get. It works beautifully in my development environment. In production, ...
0
votes
1answer
396 views

How do I alter the position of a Custom Post Type menu item within my plugin admin menu?

I'm writing a plugin (for the first time, so bear with me!) which includes a custom post type; 'Programmes'. In the admin menu, I've set up a new menu group for the plugin, and I have the 'Programmes' ...
0
votes
1answer
579 views

wp_insert_user keeps echoing values

This is bugging the heck out of me. Essentially I've narrowed the issue down to one line of code: $user_id = wp_insert_user ($userdata); From what I can tell nothing should be echoed here, but I ...
1
vote
0answers
32 views

Create WooCommerce subscription on import CSV order file

I have a WooCommerce WordPress site running, with the upload function of customer / Order / CSV Customer Import Suite (WooThemes). This only uploads my orders & not my subscriptions ( Woothemes ...
1
vote
1answer
16 views

How to use copy() function and paste file in /wp-content/themes directory

copy("http://localhost/medium/theme.zip","themenew.zip"); currently it is pasting file in wp-admin folder, Is there any way I can copy .zip file to /wp-content/themes directory. Thank You :)
1
vote
3answers
624 views

WordPress 4.0 Cookie Authentication to avoid nonce error when publishing a post and page

Cookies are now tied to internal sessions in WordPress 4.0. This means plugins using basic cookie authentication will have trouble because a token is required for publishing a post or page (as well ...
7
votes
1answer
186 views

WordPress 4.5 deprecated get_currentuserinfo()

As of about 10 days ago, WordPress 4.5 developers deprecated get_currentuserinfo() as a pluggable function. Unfortunately my plugin uses it's own get_currentuserinfo() to login users from an external ...
0
votes
0answers
26 views

Creating shortcodes in plugin

First time creating a WP app, so please bear with me. Essentially, I want to be able to input a value in a form, which gets processed and put into the database. Once that is done, I was trying to use ...
1
vote
2answers
28 views

Custom plugin: Trying to show saved data on frontend

I'm working on my first plugin and I have made a nice settings page which saves and works. But I have split it to few files and now I can't determine if field is checked.. I have also tried ...
0
votes
0answers
14 views

Dynamically create contact form 7

There is any way to create / import contact form 7 dynamically? I have predefined contact forms for client. And want to provide them dynamically. Basically, Client will create these itself or we will ...
0
votes
1answer
18 views

Insert terms for custom taxonomy on plugin activation, or each page load (init hook)

Consider a plugin which adds a custom Taxonomy and then fills the taxonomy with a large term hierarchy (tens of hierarchical terms, may become hundreds in specific installations). I understand that ...
0
votes
1answer
1k views

Using radio button meta data from a custom meta box

Very new to attempting PHP and am hacking together my first plugin using tutorials.. I have a custom meta box with a Yes/No radio button on all WordPress pages (in the editor). EDIT- I removed the ...
0
votes
1answer
26 views

Adding submenu to custom plugin menu page created with add_menu_page() function

I have created a custom menu page using add_menu_page() function. Everything in that page appears as it should in the screen. What I am trying to achieve is adding another submenu under the under the ...
0
votes
0answers
29 views

Admin panel specific page only with admin_head for 4.1?

<?php /* Plugin Name: Header Problem Demo Plugin URI: http://wordpress.stackexchange.com/questions/215190 Description: Shows how old admin_head-{page} method no longer works Version: 1.0 Author: ...
0
votes
0answers
17 views

How do I hide a meta box properly?

I want to hide the main meta box where you put the text in for the page, if a condition is met, but then if a button is clicked, I want to show it. I used jQuery to do this but the style gets messed ...
46
votes
4answers
14k views

Best way to initiate a class in a WP plugin?

I've created a plugin, and of course being me, I wanted to go with a nice OO approach. Now what I've been doing is to create this class and then just below create an instance of this class: class ...
1
vote
1answer
424 views

How to get Login Error messages on a custom template

I want to display login form and process the login on the same page, so that if there is any login error it should display the error messages on the same page. I have added this function: ...
1
vote
0answers
17 views

ob_start() combined with wp_query

I'm making my first plugin and I have a problem with displaying my shortcode. It shows in the top all the time but I have read some about ob_start(); and trying to use it but the shortcode just ...
0
votes
1answer
304 views

Wordpress removing data attributes for scheduled post

Hi I'm using the smarty templating engine in wordpress to generate HTML like the one below: <li> <div class="checkbox_container" data-asin="B0009Y7APU"><input type="checkbox" ...
23
votes
1answer
5k views

Is it possible to reuse wp.media.editor Modal for dialogs other than media

To expand: I'd like to utilize the same Modal code/appearance ( as used in wp.media.Modal, wp.media.FocusManager ) to open a modal of my own custom dialog, not the Media Editor. In the past, I've ...
1
vote
1answer
848 views

wp_schedule_event in a class

This is my (stripped down) plugin, in OOP: <?php /* Plugin Name: Cron Test Plugin URI: http://www.mywebsite.com/ Description: Test Version: 1.0 Requires at least: 3.0 */ class CronTest { public ...
0
votes
0answers
5 views

How to modify the plugin update counter in the main menu? (red badge in the Plugins menu button)

I am providing a self-hosted plugin update system for my plugin. I hoked everything in order to replicate the information provided by the "Wordpress repository" pending for update plugins in the admin ...
0
votes
1answer
25 views

How can I use wp_ajax_response for front-end error reporting?

I already have the wp hook code in place, and now I want to send error messages back to the front end to be placed in alert box or html element. //my plugin add_action('wp_ajax_track_upload', ...
0
votes
0answers
18 views

Add a page with a plugin [duplicate]

I have a plugin that adds a few admin pages, a dashboard widget and a normal widget but I can't figure out how to add a page to the site. I want to create a permalink that makes wordpress use ...
0
votes
1answer
20 views

How to Insert images in WordPress using code

I am trying to create a plugin for auto posting. I was able to create new post and then get the attachment for the post. But images are not showing inside the post itself. but if I click on media ...
0
votes
1answer
16 views

What should I use instead of get_blog_option?

I am using a plugin that was using get_blog_option and it no longer works. I looked up the call and it doesn't work because it's a wpmu function only. Is there an equivalent method that I can use ...
1
vote
2answers
119 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
1answer
565 views

How can I add a Custom Button to Add or Edit post / page next to Add Media?

I'm trying to add a custom button nearby the Add media on the wordpress Add and Edit Post/Page. How can I do that? Thank you very much for your help!
0
votes
0answers
7 views

WordPress Plugin error: Multiple primary key defined

Given an SQL statement like this to fire on plugin activation: $charset_collate = $wpdb->get_charset_collate(); $sql_fields = "CREATE TABLE wp_my_table ( id int(11) NOT NULL AUTO_INCREMENT, ...
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. ...
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.
3
votes
1answer
59 views

Detect a focus on wp_editor

I wan't to detect/callback when a wp_editor(..) output text-area/content-editable is focus. Quite a simple question that I could not find anywhere. <div class="compose-body"> <?php ...
1
vote
5answers
9k views

what's the meaning of the field wp_capabilities in table wp_usermeta

I am new to wordpress, in table wp_usermeta I notice that we have a row meta_key meta_value wp_capabilities a:1:{s:13:"administrator";b:1;} First, what's the meaning of ...
0
votes
1answer
37 views

New Users are saved with no role selected

I'm working on a plugin that adds new user roles: Manager and Employee. Managers are supposed to be a "pseudo-admin". They can manage all post content (private or otherwise), and should be allowed to ...
0
votes
2answers
33 views

How do I link to a php file in my plugin directory?

Basically in the wp-admin section I have a page where I attempt to export some records from a grid. I have an Export link which leads to something like admin.php?page=download&selected_ids=1,2,4. ...
0
votes
0answers
10 views

Any way to make Apache's internal redirect work?

What I really want to do is to make URLs like http://localhost/bmicalc/bmi24.57 to redirect to http://localhost/bmicalc/index.php?pagename=bmi&result=24.57 without changing the URL in the ...