A name for an event that is executed at specific points throughout the WordPress core.

learn more… | top users | synonyms (2)

7
votes
1answer
2k views

get a list of all registered actions

I'm trying to debug a plugin which I didn't develop and I want to list all the registered actions. I've read this SO thread: WordPress: How do I get all the registered functions for 'the_content' ...
6
votes
3answers
882 views

remove_action on after_setup_theme not working from child theme

I am trying to remove a theme action for an elegant-themes theme using a child theme.. This works when I remove action after add_action code anywhere in the parent theme functions.php. However, it ...
0
votes
3answers
27 views

Dealing with html forms

I want to work with html form but i cant understand the Action method and when we need to use it. For example found this code on w3schools: <form action="action_page.php"> First ...
0
votes
2answers
1k views

Deregister scripts on unnecessary pages using remove_action

To all would-be close-voters: This question is not a duplicate, because I need to remove all scripts added by plugin using remove_action. In Very stubborn wp_register_script / add_action vs ...
3
votes
2answers
367 views

How to modify wp_ajax function?

I want to modify wp_ajax_find_posts function. It receives search string from find-posts form and delivers search results by ajax. Part of the function looks like this: function wp_ajax_find_posts() { ...
1
vote
1answer
569 views

Using add_filter() in Widgets

Just have a query reference the add_filter() function. Can you use this function inside a WordPress widget class. Example I have a widget with dynamic created code that I want to pass to another ...
1
vote
1answer
48 views

action not working

Im working on a site where I need one plugin to trigger another. So When a user checks out from woo commerce with a coupon, add that user to a group. We are using The free Groups plugin. ...
0
votes
1answer
758 views

wp_trash_post action hook with custom post type

When a 'contact' cpt post is trashed, i need a metakey from another cpt 'act' to be deleted, i have been searching all over which hook i should use but unfortunatly the codex action reference page is ...
0
votes
1answer
409 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
1answer
404 views

Add content after get_header

I'd like to add content directly after the div#main (end of header.php) and before /div#main (beginning of footer.php). I'm using an own child-template (of twentythirteen), that contains only ...
0
votes
1answer
43 views

What hook to add at start of WordPress load

I want to add a hook that is the first thing that runs every and any time someone hits a page, post or other WP piece of content on my site, and before anything else in WordPress executes. Can you ...
-1
votes
0answers
12 views

add_to_cart Woocommerce failing to add product [closed]

I have created a function so when you click to add a product to the cart it checks for upsell products and shows them in a box. I can get it to appear with no issue but I cannot get it to add a ...
0
votes
0answers
8 views

Hooking into action that fires in wp_head from widget on front end [duplicate]

I have a custom action hook for which the do_action() is executed in a function that hooks into the wp_head action. I would like to run add_action() for that custom action hook from the front-end ...
0
votes
1answer
1k views

Action hook “wp_insert_post” works but not for last imported post

I want to run a custom function whenever posts are imported to my custom post type. I am currently running this code - function on_post_import($post){ global $wpdb; $results = ...
0
votes
1answer
198 views

GET form action. Redirect to self

I'm writing filter for posts by category on author page. I send category name in $_GET array in this form: <form action="" accept-charset="UTF-8" method="get" id="form1"> <select ...
0
votes
1answer
32 views

plugins_loaded action is not working properly

I am trying to send an email to the user after form submission but I get an errorCall to undefined function wp_mail() in C:\xampp\htdocs\wordpress\wp-content\plugins\contact ...
0
votes
3answers
1k views

How do I add some javascript validation to the admin interface form's onsubmit?

I have a plugin that adds meta boxes to the admin interface and I need to do some validation when the user presses the "update" button before the form is submitted. Is there a WordPress action or ...
6
votes
1answer
3k views

What is the very earliest action hook you can call?

After the solution to this question was to get a function to launch BEFORE the init action is fired by taking the sequence out of its function, it got me thinking, is there any earlier in the WP load ...
1
vote
1answer
361 views

Restrict post edit/delete based on user ID and custom field

I've been able to prevent deletion and editing of posts based on user ID and page ID however, I need to restrict access to editing and deleting based on a custom field. Not sure how to go about doing ...
0
votes
2answers
134 views

Is it possible to track down Actions and Filters?

As far as I know using Actions and Filters hooks is the best approach for developing on WordPress. I have just to ask if there is any way to track down which Actions and Filters are applied on ...
4
votes
3answers
2k views

How can I find out what functions are assigned to actions?

Is there any way to know what functions are added to actions on a certain page in WordPress?
1
vote
1answer
267 views

Filter or action hook to insert content on admin pages before </body> tag

I am developing an administrator plugin and want to be able to write some HTML content just before the last body tag . This content will initially be hidden then displayed with javascript when a user ...
0
votes
1answer
95 views

How to hook into action/filter call

I'm about to create a very simple logging plugin. Every time an action or filter is fired I need to log it to the file. The idea is that we will be able to see exactly which actions and filters are ...
8
votes
3answers
7k 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.
2
votes
1answer
581 views

WP Login forms action URLs displayed as pretty URLs in browser (ex with Restore Password)

I would like to use the WP native login/register/restore password/.. functionality, but display pretty URLs instead of wp-login.php I've been looking at the core code and noticed that most login ...
0
votes
1answer
19 views

Reloading page with a query string upon login for admins

After users with specific roles log in, I would like to reload the current page with a query string added (to trigger a message via JavaScript). How can this be improved? function ...
0
votes
1answer
634 views

Insert new user with form submit 'init' hook

I'm posting a form to insert a new user and hooking my function to 'init'. This code is in my mu-plugins folder. The user gets inserted fine, but the page is not loaded after wards. My form action ...
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
1answer
30 views

passing variables inside a widget add_action

Here's my code inside a widget class: function widget($args, $instance) { add_action('wp_footer', function () { echo $instance['title'] }); } It doesn't output $instance['title']. I tried passing ...
0
votes
1answer
603 views

get_term and get_term_by returning null or false eventhough the term exists

I am trying to use the action hook delete_term, delete_$taxonomy, among other hooks that delete a term but they are presenting the same issue. For example: 1234 is an existing term in the favorite ...
7
votes
5answers
2k views

Remove an action from an external Class

I'm trying to do something similar to this question here: remove_action or remove_filter with external classes? I'm trying to remove the <!-- This site is optimized with the Yoast WordPress ...
7
votes
3answers
3k views

How to get WordPress' hook run sequence?

What is WordPress' hooks execution sequence? I mean, I want to know the order, how add_action hooks are executed, i.e. init wp_head wp_footer after_theme_setup and etc.. I want to know the ...
11
votes
1answer
7k views

how to limit search to post titles?

Is there a way to limit search to post titles? I know I can modify query.php core file but there must be a way to do it with hooks right? Thanks in advance!
-1
votes
1answer
111 views

Generate payment URL in custom email [closed]

When a particular order status is triggered, a custom email is sent to the shopper. I would like to include a link in the email for them to pay for the order. From my current understanding, the ...
1
vote
1answer
27 views

Are there actions or filters I can use for Ajax calls?

I'm interested in writing a caching function for Ajax calls. If a third party plugin does their thing, calls wp_ajax_whatever, how do I pick that off? If a person does slideshow updates with a ...
2
votes
2answers
103 views

How to know what priority to use with add_action()?

I was writing a small plugin to remove some menu items for non-admin users from the backend, and discovered that my plugin didn't do anything unless I specified a priority in my code: ...
0
votes
1answer
68 views

Shortcode display outside the div

I have created a shortcode that retrives and displays a form.The content of the attribute in HTML. function check_my_login( $atts) { return '<form action="" name="" method="post" ...
0
votes
1answer
22 views

Cannot Schedule Sending An Email

I have a function that takes 4 parameters to send an email, and it works if I plainly call the function, but doesn't work when I try to call it from schedule_single_event. Here is the code: function ...
0
votes
2answers
43 views

My add_action (wp_footer, 'method') is not calling?

In my themes functions.php file I have put: add_action('wp_footer', 'method'); function method() { echo "this is being called"; die(); } My wordpress footer.php file looks like this: <?php ...
0
votes
0answers
11 views

How to load individual widgets within sidebar(Not all at once)

I want to load my Wordpress site sidebar widgets when scroll down. So I want to know how to load individual widgets one by one. I tried plugins like 'Lazy Widget Loader'. But they didn't work for me. ...
1
vote
1answer
138 views

How do I add Bootstrap and LESS to my migrated WordPress site?

I'm migrating a website to WordPress - it uses both Bootstrap and LESS. I found a snippet online for enabling Bootstrap and the outputted CSS via functions.php: function theme_add_bootstrap() { ...
11
votes
5answers
3k views

after_setup_theme always runs

I am setting up a child theme for some of my faculty members, and as a part of the theme, I would like a handful of plugins to be activated at the time that the theme is activated. So, naturally, I ...
1
vote
1answer
39 views

How to replace a function using a child theme?

I have the following function where I would like to replace the image nopic.jpg I have updated by deleting some redundant options. if ( ! function_exists( 'TaskerDev_get_first_post_image_fnc' ) ...
0
votes
3answers
691 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 ...
0
votes
2answers
45 views

Difference b/w Simple function call & do_action call

dear I unable to understand of simple function call & do_action function call. do_action: I hook function and I place this in my one template file for use in header template. ...
1
vote
2answers
173 views

How to set a different value in the generator meta tag?

I know that you can remove the following line from the WordPress source code: <meta name="generator" content="WordPress 4.2.2" /> But instead of removing the tag completely, I just want to ...
0
votes
1answer
21 views

How to intercept publish post for a custom post type “event”

I am trying to write a plugin that copies a custom post type "event" from one blog to another. The code for copying I already have working but I cannot seem to get this "add_action" hook to work when ...
0
votes
0answers
24 views

Hook on Publishing a Post Doesn't Fire Correctly (or so I think)

Currently, I'm trying to send out a Push Notification to iPhone every time a blog post is published on my WordPress website. I am using a PHP script to send out the push notification (which works with ...
12
votes
1answer
350 views

Is there a action hook for the “Empty Trash” button?

I would like to run a function when the user clicks the "Empty Trash" button for posts. Something like: add_action('empty_trash','myFunction'); function myFunction(){ // My code }
1
vote
2answers
413 views

Is there any action/filter hook to use when an image gets edited in the editor?

I can't find a specific hook. If I already have added an image to an article via editor and then I edit it, I'd like to intercept the code just before it is sent again to the editor. I already use ...