Method by which plugins and themes extend core WordPress functionality.

learn more… | top users | synonyms

1
vote
1answer
330 views

“save_post” hook not triggered in WP 3.6.1

I developed a plugin having a custom metabox that is using the "save_post" hook to store data. The plugin is old 18 months and is used by thousands of customers, so I'm pretty sure everything is good. ...
0
votes
1answer
10 views

When is get_currentuserinfo() needed?

I know you usually call it inside functions after global $current_user, but sometimes it works whether you have it or not. So what are the conditions where is it needed? Sample code: function ...
-1
votes
0answers
7 views

Woocommerce free shipping based on payment gateway selected [on hold]

I'm trying to get free shipping available when a certain Payment gateway is selected. So I've got 2 payment gateways: if Payment gateway 1 selected --> With shipping costs if Payment gateway 2 ...
0
votes
1answer
232 views

using wp_footer hook in a plugin

I'm using the wp_footer hook into the plugin and it doesn't work, but when I copy the code to the "functions.php" file of the active theme it does work, what is the possible problem in this situation ...
0
votes
1answer
324 views

List posts based on First letter of Posts

I want add a Pagination [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] .......[Z] Easy Post Title - By Admin on 2013 post content....bla bla bla... Example Post - Another Test ...
0
votes
1answer
10 views

Gravity Forms | Form Object is NULL

I am trying to customize some gravity forms behavior. Therefore I've tried to hook into gforms from my theme. Unfortunately the form object is always NULL. Why is that the case? Example code: 1) ...
3
votes
1answer
16 views

Change text of Description in Image Library

i would like to change or add text to the Media Library Overlay on the right side if you click on an image and can enter a description for the image. At the moment there stands "Description" or ...
1
vote
1answer
27 views

Injecting a custom sql query into a page/theme

I have written a custom sql query for our WordPress website (fairly elaborate and not achievable with the standard wordpress code) and I've got it to run via $pageposts = $wpdb->get_results($query, ...
2
votes
1answer
292 views

Gravity Forms field entries into wp_query loop

I have a simple function that filters the page content when form (ID 18) is submitted. It simply displays the entry of field (ID 13)... add_action("gform_after_submission_18", "set_post_content", 10, ...
-2
votes
0answers
16 views

What are Differnce Between [closed]

I know Below Question Might be asked many time or having many answer in Google. But i dare to ask below Question as it WordPress most helpful website. 1 } Filter and Action 2 } apply_filters , ...
0
votes
2answers
64 views

jQuery does not work

I am working on a project where I need jQuery for. I added this to my functions, and the scripts are loaded in my header if I watch my page source, but jQuery doesn't work. What am I doing wrong? ...
1
vote
2answers
44 views

Update meta values with AJAX

I am working on a voting system in Wordpress. I first made it with GET requests but someone told me you should not use GET for this, So I started working with AJAX to update custom fields/meta values, ...
0
votes
0answers
39 views

template_redirect hook executes twice [closed]

I looked for a hook which executes just before template is rendered and I found do_action( 'template_redirect' ); inside \wp-includes\template-loader.php. This hook fires before determining which ...
1
vote
1answer
3k views

How to customize woocommerce related products?

I have the following lines of code in my website that will display the related products at the bottom of my single product page in WooCommerce... functions.php: // display upsells and related ...
0
votes
1answer
240 views

Create action running on trashed_post hook to modify post_meta value

I have a custom post type that always do math operation to its post_meta and other custom post type post_meta. For example: post-type 1 = cpt_product_order post-type 1 post_meta = ...
0
votes
2answers
13 views

Transition Post status not working

I have a plugin which uses the transition_post_status hook, to fire a custom function on post update. But I don't know why its not working. Here is the code add_action('transition_post_status', ...
5
votes
3answers
3k views

How to know what functions are hooked to an action/filter?

Is there a way to know what functions are hooked to a particular hook? For example if I'd like to know what functions are hooked to the wp_head hook.
1
vote
2answers
38 views

Hook to generate a dynamic sitemap with “All in One SEO Pack” Plugin

Besides the urls of posts, pages and categories, I need my site's sitemap to include the urls of various pages that display data coming from an external source other than the WP database (Rails API). ...
0
votes
1answer
30 views

Hook only specific post type

with this function I change the title of my posts in the posts type 'alternatives'. My problem is that Wordpress changes all my titles now. Does anyone know how I can set this for the specific custom ...
0
votes
1answer
42 views

Is there an admin hook that will let me read GET variable before it's too late to set the header Location

I need to redirect the page based on the query vars in my plugin admin menu. I don't know where I can hook in to read the query vars or the GET vars order to decide if the page needs to be redirected. ...
1
vote
0answers
29 views

Move excerpt meta box to above content editor

I found a WordPress hook called "edit_form_after_title" to add a text box after the title. How can I use this hook to display the excerpt after the title while creating a new post?
4
votes
1answer
65 views

Changing the “Plugin Activated” Message Default

Whenever an administrator in WordPress activates a plugin, upon the reload of the plugin page, a notice will appear upon successful activation reporting "Plugin Activated". Is there a way to change ...
0
votes
1answer
250 views

Redirect back to origin page after using get_delete_post_link()

I need to implement frontend and backend redirection after delete specific post using get_delete_post_link(). Which hook i can use? Any advice would be appreciated. Something similar to : <?php ...
1
vote
1answer
66 views

Setcookie works on admin but not front end

I have a simple function to set a cookie to the value of whatever parameter is attached. For example, if I visit http://example.com/?devsource=http://dev.example.com/ it should set the value of the ...
1
vote
1answer
25 views

How to hook in after user's registration email has been sent?

I want to redirect to a page after the user's registration email has been sent. What is the correct hook? user_register is too early, that is the user is entered into the database but the email ...
-2
votes
1answer
29 views

How to place plugin hook in a wordpress template

In many WordPress plugins, there are installation directions to add <?php do_action('plugin_name_hook'); ?> in your theme's templates. Where exactly do I need to place this code and what should ...
0
votes
0answers
50 views

Contact Form 7 to web service

I wonder if anyone can help me with something that's driving me crazy. I'm trying to implement a series of forms that will write to a CRM and the data must be passed as XML. I'm not particularly ...
0
votes
1answer
26 views

How to replace settings in WordPress plugin from a theme

I created an array with some default settings in a plugin, and want to allow it to be replaced from functions.php in a theme without using stored data (eg. add_option). I want this to be just a hook ...
0
votes
1answer
51 views

How to add a second 'place order' button in WooCommerce [closed]

My client would like two 'Place order' buttons on his checkout page (http://www.jobgrandprix.fr/checkout/?set-cart-qty_2652=1). By default, the 'Commander' (his site is in French) button is at the ...
0
votes
1answer
607 views

How to add a new product type on woocommerce product types? [closed]

I want to add a new custom "product type" to woocommerce plugin: Tried to duplicate one of currently exist product type files (woocommerce template structure) as a new file (file name and inside ...
0
votes
2answers
22 views

What is the action hook that deletes a taxonomy term from the backend? And how to retireve the term id before deleting it?

I need to delete some postmeta when deleting taxonomy terms from the backend. Before deleting the term, I need to retrieve the postmeta's meka_key and the term id that is going to be deleted. Use the ...
-1
votes
1answer
31 views

How can I get the term_id from the action hook 'set_object_terms'?

I have the following code and I want to use the term_id inside that function. I aware that the variable $terms contains the term; however, I do not know how to get the term id from it. ...
2
votes
2answers
356 views

Run javascript code after wp_login hook?

after using the wp_login hook, is it possible to add a snippet of javascript code to the page seen immediately after the login in wordpress? I want to use this top implement a notification system ...
0
votes
0answers
12 views

Hook on Add new category from post editor [duplicate]

How can I "hook" on Add new category metabox from post editor page? I need to add some default values to DB when adding new category
1
vote
3answers
113 views

What are the benefit in adding hook in the init() hook?

I see a lot of plugins using this approach to add a new hook, e.g. add_action('init', function() { add_action('SOME_LATER_HOOK', xxx); add_filter('SOME_LATER_FILTER', yyy); }); Why they don't ...
1
vote
2answers
968 views

Include WooCommerce 2's prettyphoto scripts on all site pages

So when WooCommerce updated to version 2 they replaced the fancybox lightbox scripts with prettyphoto. I would like to use this on all my wordpress site's pages, not just the product pages, but the ...
0
votes
0answers
31 views

Custom login errors and redirect

I am working on a custom login page in Wordpress and found these 2 functions for a redirect back to the custom login pages to show errors there and nog on the Wordpress default login page. The first ...
0
votes
0answers
352 views

WooCommerce payment gateway receipt page

I'm trying to make a fairly simple WooCommerce payment gateway and the only thing I have left to do is to output some text on the receipt page. For some reason I just can't get my code to work. ...
0
votes
1answer
247 views

How to use the password_reset hook to validate new password and display error

When a user resets their password via the link in the password reset email, I know I can use the password_reset hook to get the user object and the new password. I want to validate the new password to ...
-1
votes
1answer
322 views

How do I change TinyMCE button “i” to create a i tag rather than em?

I want to give the "italic" button back the "styling" behaviour, rather than the spammy <em>. I want that button to print a <i> tag, rather than <em>. <em> tags became popular ...
1
vote
1answer
471 views

How can I hook into creating a new post and execute wp_die(), before the post is inserted into the database?

Info about wp_die from codex: Kill WordPress execution and display HTML message with error message. A call to this function complements the die() PHP function. The difference is that HTML will be ...
0
votes
0answers
16 views

Turn off xml rcp for certain users

I built a web app with wordpress that receive inputs via ifttt.com. Ifttt uses the xml rcp protocol to send messages to a worpdress based site. Specifically, ifttt creates a new post when certain ...
0
votes
0answers
10 views

Extra Editing Box in WP Dashboard

So I am trying to add an extra box in the WP post dashboard. In this box I will add a piece of HTML code. This code created the box in the WordPress area: $woo_metaboxes[] = array ( "name" => ...
0
votes
0answers
8 views

How to make the registration form as page [duplicate]

I am currently using 'Cimy User Extra Fields' plugin for adding extra fields on my registration form. But i want to move the whole registration form on a single page so i have all the website footer ...
0
votes
3answers
393 views

Theme Customizer not loading JS for live preview

I am currently working on adding options to the theme customizer. For the last two hours I have been trying to get the live preview working and I am trying figure out why my theme isn't loading the ...
-3
votes
1answer
36 views

Is there any Reference of Wordpress hook and hacks? [closed]

I am searching for a website to have lots of Wordpress hacks and hooks. Some hooks like activating debug mode or etc. Can you give me lots of this futures ?
0
votes
1answer
27 views

change output location of plugin function using a custom hook

I'm running the YouTube Video Fetcher plugin and it fetches youtube videos and displays it on your website. However, instead of displaying the video after the post, I want to hook the code into a ...
0
votes
1answer
17 views

Can my hooked uninstall class function access a global var declared in main plugin file?

My current setup is as follows... In the main plugin file, these two hooks are set (not inside any class): register_activation_hook(__FILE__, array('DG_Setup', 'activation')); ...
0
votes
1answer
43 views

disable publish button until condition is not met

I currently wrote a plugins to customize my wordpress website. I surprisly find it easy to do many things with hook. Now I want to make author not be able to push publish button if no category is ...
0
votes
0answers
53 views

Plugin action hook fires when it should not (unrelated admin screen)

I maintain a plugin which generates a PDF of a page or post when an icon or link is clicked. PDFs may be cached, and as such, when a page or post is edited, we refresh the cache by regenerating the ...