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

learn more… | top users | synonyms (2)

1
vote
1answer
21 views

When can you get current page ID and initialize hooks right after?

I'm developing a plugin and need to know on what page user is and then add specific hooks and filters for that page. And my problem is that is_page() and the_ID() doesn't work outside of wp, ...
0
votes
1answer
14 views

Action hook with wrapper html

I want to add a space for a banner across the top of my WooCommerce Category pages, but i'm trying to figure out how to add some markup that will wrap the action. In my archive-product.php I have the ...
0
votes
1answer
35 views

How can I edit comment meta value before it is saved?

I have introduced a custom field in comments form using add_comment_meta() function. I would like to know if there is a way to edit the data of the comment meta just before the post data is saved so ...
0
votes
1answer
13 views

WordPress save_post hook not firing when checking if _GET['post'] is set

I was facing an issue (a custom metabox not saving), and after 2 hours I finally realised that, if you try to add an action to the save_post hook inside an if statement checking whether $_GET['post'] ...
0
votes
0answers
5 views

Catalog/Archive page products and adding weight choice per product-all items are added to cart

I am using the following code to create a choice of quantity on my catalog/archive page with over 40 products. It looks close to what I try to achieve. Unfortunately, when I change 1 item, the cart ...
0
votes
0answers
13 views

wp_schedule_event doesn't work

Can someone tell me where I'm going wrong? Images in folder /wp-content/cached_img/ are not delated add_filter( 'cron_schedules', 'cron_add_week4' ); function cron_add_week4( $schedules ) { ...
0
votes
1answer
26 views

get_header and hook avoid normal call

I would like to use a custom header, like get_header('new') But I cannot modify the templates easily where the calls are being made due to several reasons. (many files and same code base deployed on ...
1
vote
1answer
14 views

What's hook to use immediately after a user is authentcated

Does anyone know the add_action() hook to use immediately after a user is successfully authenticated. Hook Test based on @mmm's answer I ran this test from my mu-plugins.php file: function ...
0
votes
0answers
22 views

Are immediately-called actions not usable in themes?

If there is a filter or action called immediately in a plugin file (not on 'init' or 'wp' action etc.), is it at all possible for a theme to filter it? Looking through wp-setting.php I would assume ...
0
votes
3answers
35 views

Dealing with html forms [closed]

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 ...
1
vote
1answer
49 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
47 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 ...
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
51 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
1answer
24 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
43 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 ...
2
votes
2answers
121 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: ...
1
vote
1answer
33 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 ...
-1
votes
1answer
134 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 ...
0
votes
1answer
26 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
53 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. ...
0
votes
1answer
82 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" ...
1
vote
1answer
40 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
2answers
54 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. ...
0
votes
1answer
25 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
27 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 ...
1
vote
2answers
200 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
0answers
33 views

How to edit the response header of a post/page?

I am rendering a post/page differently. Instead of displaying an HTML document, I am making the page render a javascript code. The default content type of a wordpress post/page is text/html, is there ...
0
votes
1answer
72 views

Filter wp_dropdown_categories Per Post Type

I'm using wp_dropdown_categories to add a categories filter to the media library. It works fine, except it displays all the categories that are assigned to posts, but I would like it to only display ...
0
votes
1answer
34 views

How passing values ​​to construct function with Actions?

Must use a do_action (); to pass values ​​to my class. How do I do that?? add_action( 'plugins_loaded', array( 'someClassy', 'init' )); class someClassy { public static function init() { ...
0
votes
2answers
34 views

How can I set a dynamic value for post_updated_messages based on return value of post_updated?

I'm familiar with how to set custom messages for post updates using the post_updated_messages action hook. This question is slightly different. I have a function/action hook on post_updated: ...
0
votes
1answer
21 views

remove parrent theme action in child

I'm create Child theme from Storefront now i want to remove these action in child theme add_action( 'woocommerce_before_shop_loop','storefront_sorting_wrapper',9 ); by this function: add_action( ...
0
votes
0answers
51 views

Geting only alert Output from JS file but not run functionality with avilable hook wp_footer and any other

Working Code Status: I was testing my js files, what these files were adding and running correctly or not. So I write a alert code in my-custom.js with my theme functionality, and now I hook my ...
0
votes
0answers
60 views

Bulk action on custom post with wp list table

I'm a bit confused and I'm hoping somebody can help me. I am trying to do a bulk action for deleting the items in a custom post type which are shown via extended wp-list_table class. I found some ...
0
votes
0answers
35 views

Adding Banner below nav

I'm using GeneratePress and want to add a banner image below .main-navigation what action/hook do i have to use to do this? I've tried looking in functions but i cant see anything for the top and ...
12
votes
1answer
367 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 }
0
votes
1answer
94 views

Wordpress wp_loaded action hook

I am using Shortcode exec php plugin and putting PHP code in a post via Wordpress Posts panel. add_action( 'wp_loaded', 'echoFunction'); function echoFunction(){ echo "someText"; } Why doesn't ...
0
votes
0answers
57 views

Errors by hook action user_profile_update_errors

add_action( 'user_profile_update_errors', 'validate_update_user' ); user_profile_update_errors does work when I edited user? mayby work only I update my profile?
0
votes
0answers
39 views

Gravityform + Custom Post Types Action Hooks?

I'm using gravity forms as well as the gravity forms + custom post types plugin for a job board. Job are added through the gravity form, then the plugin converts them to a custom post type. Jobs are ...
0
votes
1answer
48 views

Make the 'all' filter default instead of 'mine' in a custom post type

I reckon this one is quick and easy... I think I'm just missing something very obvious. My inquiry is nearly identical to this stackoverflow post. For non-admin users, the default filter for posts ...
0
votes
1answer
45 views

Types plugin custom post add_action hooks

I'm using the wp-types plugin to create a custom post type. I'm developing my own plugin which I need to fire whenever a post of my custom post type is updated. Right now add_action( 'save_post', ...
1
vote
0answers
35 views

load_plugin_textdomain doestn't work with add_action plugins_loaded

I am trying to load localization for my plugin. There is directory called languages in my plugin folder with .po and .mo files inside of it. I have the following code in the plugin main file: ...
0
votes
1answer
43 views

Wordpress custom post action hook

I'm working on a plugin for wordpress that I would like to fire every time a custom post of the type 'job' is posted, published, edited, trashed, untrashed, etc. (basically whenever there is an update ...
0
votes
1answer
49 views

Placement of add_action() for ajax callback?

This is probably a palm slap question, but I'm confused. I created what I thought was a simple WP template page. A form to update a form to a db via ajax callback. At the bottom I placed the ...
0
votes
1answer
26 views

Adding add_action function

How does this hook work? I need to insert an action into a page specified within the wp_head() or wp_footer() function. But when you add the action in wp_head (add_action ( 'wp_head', ...
4
votes
1answer
127 views

is it possible to get the hook name in add_action?

given this: <?php add_action( $hook, $function_to_add, $priority, $accepted_args ); ?> Is there a way to get $hook value inside the function $function_to_add?
0
votes
0answers
31 views

When to hook into edit profile action?

I have the following function which combines the values of a few user profile fields and saves them as a new user_meta called COMBINED_WORKSHOPS. The function works, but I don't know when/where to ...
0
votes
0answers
12 views

Is it possible to use login_enqueue_scripts to add the stylesheet to head section? [duplicate]

here where I'm having trouble: I need to add my styleshhet to the WordPress login page among the tags <head></head> but my code doesn't work, it always enqueue the stylesheet before ...
0
votes
1answer
127 views

Change meta tags programatically

Is there a way to change the meta tags not in the head but in a template file through code? I would like to change the meta tags <meta property="og:title" content="title" /> <meta ...