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

learn more… | top users | synonyms (2)

0
votes
3answers
26 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 ...
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
42 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
31 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
18 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
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 ...
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: ...
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 ...
-1
votes
1answer
107 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
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. ...
0
votes
1answer
67 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
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
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. ...
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 ...
1
vote
2answers
171 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
29 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
54 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
30 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
18 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
36 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
51 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
24 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
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 }
0
votes
1answer
59 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
48 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
35 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
42 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
33 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', ...
0
votes
0answers
26 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
36 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
39 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
25 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
121 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
29 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
79 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 ...
0
votes
2answers
146 views

Create a post builder skin in a plugin

Currently I'm working on a plugin that will display a grid based on post type with many settings to customize it. One of the settings will be to choose between different skins available to display ...
0
votes
1answer
42 views

What add_action reference should I be using or should I use do_action?

I am working on some automated emails. I am fairly new to add_action and do_action. I am having a tough time understanding it. The site in question has number goals set up that people reach over ...
0
votes
1answer
19 views

Where to place add_action when enqueueing?

Do I place add_action before or after function myTheme_script {enqueue functions here} when enqueueing a script or stylesheet into functions.php, or does it matter? I'm seeing both from moderators on ...
0
votes
0answers
13 views

after_switch_theme not working in a class? [duplicate]

Here is my class (by way of example) after_switch_theme is being stupid and refuses to fire. class myPlugin(){ __construct(){ add_action('after_switch_theme', array($this, 'rewrite')); ...
5
votes
1answer
103 views

Getting instance variable in scope of 'wp_enqueue_scripts'

I need a little help getting my head around passing instance variable to a hook. I am reading the CSS files I need in my template dynamically and storing them in a $settings object that I am keeping ...
0
votes
0answers
21 views

add_action to stop processing further on error notice

I am trying to stop a woocommerce do_action( 'lostpassword_post' ). On another function I am adding the above action and checking on default values it should not send email and infact want the ...
0
votes
0answers
20 views

call_user_func_array error only when another plugin is active

So I wrote a plugin that uses the following function to make the backend: add_action( 'admin_menu', 'create_backend_menu' ); if(!function_exists("create_backend_menu")) { function ...
0
votes
0answers
28 views

How to get all the predefined do_action() calls from an active theme

To hook my plugin content into anywhere, suppose I offered the theme developers to create their own hooks with a prefix (pre_) anywhere in their theme - the rest of the hook is unknown to me. So what ...