Tagged Questions

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

How to Add a .js file Only in one specific Page Dynamically to Head

I need to add some scrips for Google Maps only in my contact page and I do not want to populate it on all pages. I am not willing to create a custom header as well so I was thinking is there any way ...
0
votes
2answers
200 views

Is it possible to check is loaded language files correctly with WordPress plugin?

I have a plugin to be translated. I have done following tasks: 1. Loaded the TextDomain $my_td = 'mysignup'; function my_signup_textdomain_init() { load_plugin_textdomain( $my_td, false, ...
1
vote
0answers
119 views

Help writing custom function with rewrite endpoint that generates a page from dynamic content

I'm creating a WordPress plugin that will pull content from an API and display it dynamically on a WordPress blog like it's native content. An example of this content would be company locations. I ...
3
votes
3answers
2k views

Where, When, & How to Properly Flush Rewrite Rules Within the Scope of a Plugin?

I am having a bit of a strange issue with rewrite rules not flushing properly. I have tried using flush_rewrite_rules(); and flush_rewrite_rules(true);. I have also tried globalizing $wp_rewrite ...
0
votes
1answer
134 views

How to List Custom Post Type Titles Based on Theirs Taxonomy Terms Inside a Nested Loop

I am trying to list at least the last three updated Custom Post Type's title lets call it "Cast" inside another loop which is listed based on the Taxonomy terms called "Actress" I used the following ...
0
votes
1answer
136 views

Custom Taxonomy Not Showing in Menu

Using Wordpress 3.7.1 and PHP 5.4.12 I am trying to create a Custom Post Type called "News" and an associated Taxonomy Called "Subject". I generate the code from Generate WP site as below: After ...
0
votes
0answers
502 views

add_rewrite_rule not working

I'm trying to do some url rewriting. I've picked this example right off the wordpress wiki here: add_rewrite_rule('^nutrition/([^/]*)/([^/]*)/?','index.php?foo=bar','top'); The wiki page says: ...
0
votes
2answers
98 views

Issue on Adding Taxonomy to Custom Post Type Using Function

Using WordPress 3.7.1 and PHP 5.4.12, I am trying to add Custom Post Type and Taxonomy to my Theme, so far the custom post type method works but the Taxonomy is not adding to the Admin Dashboard. ...
0
votes
1answer
232 views

Is it possible to create an action hook using do_action() within add_action()?

Is it possible to create a new action hook like do_action('my-hook-name'); inside a call to add_action();? I'm aware this code doesn't work, but I was thinking something along the lines of... ...
2
votes
1answer
182 views

Custom admin column disappearing when using Quick Edit [duplicate]

I have added a featured image column to my posts in the WP admin. This all works fine except when using the Quick Edit feature. Upon update, the column disappears, or rather isn't returned by the ajax ...
0
votes
1answer
3k views

How to add multiple featured image in meta box in post editor?

I would like to add multiple featured image in meta box in post editor area apart from default available featured image. I have added the meta box but i have no idea on adding the featured image ...
0
votes
2answers
38 views

Get Posts by IDs (optionally)

I want to check if a variable contains list of post IDs, then I want to query the posts of those IDs only, but if that variable is empty then I want to display all posts. Problem: If I supply IDs to ...
0
votes
1answer
120 views

Add Excerpt On Quicksand Plugin

I'm using this plugin called "Quicksand" for Wordpress.. You might wanna check the link. What it does normally is it filters posts based on the category.. It shows the Featured Image Title of ...
0
votes
0answers
69 views

Create plugin with form in post and submit it to specific form

I need to write plugin which add form at the end of specific posts with submit button. It is clear for me. Next after click submit I need to submit form to my own form from plugin and show more inputs ...
1
vote
1answer
32 views

What is the best way to mimic a search query within a plugin

I'm in the process of building a Wordpress plugin. I wish to mimic WP's default search functionality but in the form of a 'live search'. I have my JS setup to grab the query string (i.e what would be ...
0
votes
1answer
1k views

Change the name of an installed plugin

I have installed a third-party plugin for my wordpress site. What I want is to rename that plugin so that it matches my purpose for installing it. Is it possible? The plugin I'm trying to modify is ...
0
votes
1answer
98 views

Getting error “The package could not be installed. PCLZIP_ERR_BAD_FORMAT ”

i am newbie in wordpress. i have created my own plugin and it's working fine for me... now i have created rar/zip file my plugin folder... i am uploading my plugin .rar file in my another wordpress ...
1
vote
1answer
94 views

Enqueue Wordpress plugin scripts below all other JS

I am developing a simple Wordpress app but I am having an issue as all of the plugin scripts are rendered before those which are enqueued in my functions.php. Here is a sample section of the ...
0
votes
1answer
60 views

Admin-ajax.php is dying “0” without processing function

I am trying to learn how to process AJAX requests in Wordpress the correct way. To do this I am adapting this tutorial to create a super simple AJAX request to place the ID of a post (from a link) ...
0
votes
1answer
27 views

how to call uninstall.php

i am newbie in wordpress... i have created my plugin... now i am creating uninstall.php file for uninstall my plugin... this is my code of uninstall.php if(!defined('WP_UNINSTALL_PLUGIN')) exit ...
0
votes
1answer
32 views

How to get Wordpress Adminmenu items?

I want to get all the menu items in the admin menu in the backend. To be clear, the menu which is generated from /wp-admin/menu-header.php. How can I do this, I see that plugins for instance ...
1
vote
0answers
44 views

Create a custom capability to allow an 'Editor' to edit only 'Subscriber' users

I want to create a new "Moderator" role (in between Administrator and Editor), that can edit only "Subscriber" type user accounts. I can create the role and add existing wp capabilities, but I don't ...
1
vote
1answer
145 views

Best practice for show data to one specific user?

I'm attempting to build a locked page on wordpress (through a plugin) that shows differant data, depending on who signs-in. Essentially it has three screens, as follows: If you sign-in as the admin ...
4
votes
1answer
85 views

Cron firing my function everytime wp-admin is visited

This is a MU-plugin I'm developing, and I want it to run hourly. Unfortunately, it's running every time I visit any site's wp-admin page. I've used the Debug Bar plugin with the Cron plugin, and it ...
0
votes
1answer
111 views

Passing values between enclosing and enclosed shortcodes

Is there a way to pass data between the enclosing and enclosed shortcodes? For example, I would like to do something like: [boxes per_row=4] [box]foo[/box] [box]bar[/box] [box]baz[/box] ...
0
votes
2answers
643 views

How do I programatically insert a new menu item?

I'm developing a plugin and I want to insert menu items programmatically. When my theme creates a menu, it uses this call: wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => ...
0
votes
2answers
523 views

How to check if a stylesheet is already loaded?

I was wondering how to check if a css file is already loaded. For example, I have in my theme Font Awesome font-awesome.min.css and I have a plugin that make use of Font Awesome too. So, I ended up ...
0
votes
1answer
31 views

How to create and use Custom hooks

I am newbie in wordpress. I have just created contact us plugin for my own project. In my plugin I have used many functions you can take a look of my code. I want to make this plugin based on custom ...
0
votes
2answers
26 views

how specify a directory to file when downloading it

I use this code to download a file from remote server to mine and the file is created and saved but in the home directory and i want it in the plugin directory $url ='*.dat'; // Use wp_remote_get to ...
1
vote
1answer
37 views

Is there a way to verified if an add_filter is already applied?

I have in my theme this filter: add_filter('widget_text', 'do_shortcode'); Now I'm developing a plugin where I have that same filter. I would like to know if is there a conditional that I can check ...
0
votes
1answer
27 views

Every time I de-activate a custom plugin, the site encounters a critical error

I have a custom plugin that I no longer use. I was looking to de-activate it from my site (and, subsequently, my network) but every time I attempt to, I get this error: Please activate the {plugin ...
0
votes
2answers
698 views

SESSION in WordPress Plugin Development

I wondering the session was disable in wordpress. I try to find some information on using session variables in the wordpress. I tried the following method to implement session variables in the ...
0
votes
1answer
138 views

Storing values in Post Meta vs new tables

I want to store list of user IDs in the post meta who have rated a post . So, for each post I will need to check the post meta to see if the user id exists in it or not. So my question is that, is it ...
0
votes
1answer
28 views

Cant' Grab WordPress Built-in Posts Through Loop

Using WordPress 3.7.1 I am trying to display all Regular Post on my created page lest say TestPage. Here are the steps I took to do this: 1- Generate a Custom Page Template called:Test Page and ...
0
votes
1answer
37 views

Display my plugins content based on a pages post_id

I have created a plugin that has the frontend content in a file named showmap.php, I currently have a shortcode that includes the contents of showmap.php on the page the shortcode is placed. I ...
0
votes
1answer
148 views

Creating option to allow user to select the page my plugin content will display on

I have an options page for my plugin, but cannot seem to figure out how to create an option to allow admins to select a page that will display my plugins content. Does anyone have an example of how ...
0
votes
0answers
78 views

How to detect shortcode usage, submit a form from widget to that page?

I've created a plugin and now want to create a widget containing a form that will submit to the page where my plugin shortcode is embedded from any wordpress page on the front end. I assume that ...
0
votes
1answer
52 views

Adding a custom button to WordPress Add Post (and Edit Post too) screen, that can save the post

I am writing a plugin that hides the publish box from authors, so that I can have them click on a button in a custom meta box I created, to save their post. (This is not the sole purpose of the ...
0
votes
0answers
126 views

How to Display Custom Post Type's Gallery (images ) in Through WP_Query

I am trying to load an Image Slider images from a Custom Post Type image Gallery Feature. For example let say I have an Custom Post Type called banner which I can load images to it's Gallery and I ...
-1
votes
1answer
366 views

How to create a page template using custom plugin

I am building a plugin. I just want to create page template whenever i install plugin. Page template like full-width template. I have used codes after searching but not able to get success. So please ...
1
vote
2answers
715 views

How to use relative path with my plugins folders?

Hi i tried for picking all images in a folder so that what ever images user puts in a specified folder inside my plugin i can take and use it in plugin. I tried the following php functions to pick ...
0
votes
0answers
21 views

Are there any good ways to know the plugin I developed for WordPress is used by which websites? [duplicate]

Normally, contributors make a plugin for people to download. People download and install to use. That's it. If I can learn the types of websites that download and use my plugin, I would have a ...
1
vote
1answer
57 views

A better way to include localized labels in Wordpress plugins

is there a better way to include labels to be localized in Wordpress plugins and themes? My current setup involves calling the method below to get the labels: public function plug_get_labels(){ ...
0
votes
1answer
2k views

WooCommerce custom payment gateway

I'm trying to write a WooCommerce plugin for a client's website that they're going to be selling subscriptions to customers. I've been exploring my options and the best one I can come up with is to ...
0
votes
3answers
95 views

How to Register/Link to .js Files in WordPress Dynamicaly in Header.php

Can you please let me know how I can dynamically register/link to my js files in wordpress? I have two js files as below code but I do not know how to map to them uring the bloginfo() as it is taking ...
0
votes
4answers
227 views

How to include code into functions.php file via a plugin

I have a lot of custom code in my functions.php file, what I would like to do is move all of this into a plugin for example myplugin-functions.php and then include the file into the themes ...
2
votes
4answers
227 views

How to avoid plugin name conflicts from the upgrade notifier?

I've wrapped a quick hack as a plugin to add Google Analytics to my site. Named it "Google Analytics" and, sure enough, WP offered me to upgrade my v0.1 plugin to some random plugin from the plugin ...
1
vote
2answers
369 views

global $current_user not current user

I believe I have a misunderstanding of what the global variable $current_user is exactly. I'm attempting to display the current user's email and name on a page using add_filter('the_content', ...
0
votes
1answer
55 views

Declare plugin dependency [duplicate]

I have written a custom plugin that use a specific 3rd party plugin code, so I want to declare my plugin depends on this 3rd party plugin, is it possible? What would be normal approach to this issue?
1
vote
1answer
139 views

Check Paypal Purchase is Success or Not in Easy Digital Download Plugin

I trying to do something for every purchase of corresponding product in easy digital download. Let say i need to add the auto random discount code for every purchase made in easy digital download. I ...