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

learn more… | top users | synonyms (2)

0
votes
0answers
11 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
12 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
23 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
19 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
13 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
19 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
15 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
10 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 ...
10
votes
1answer
309 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
21 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
19 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
17 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
26 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
22 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
11 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
30 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
21 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
16 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
97 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
21 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
11 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
29 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
122 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
40 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
17 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')); ...
4
votes
1answer
77 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
14 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
14 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
20 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 ...
1
vote
1answer
73 views

WP cron doesn't pass through my arguments

I've been trying to import some posts trough a cron action. The problem is my last step. Everything is going well, except for the execution of the cron. It is only passing trough the first argument. ...
0
votes
3answers
30 views

Action on WordPress Install

I am trying to use this https://gist.github.com/davejamesmiller/1966425 to fire when I first create WordPress site / "install WordPress" (i.e complete the "5 minute setup") but the wpmu_new_blog ...
0
votes
0answers
77 views

AJAX login without a plugin does not work. when add a action to function.php

I am using wordpress ajax login without a plugin. I want to not be allowed users access to the WordPress profile after login, Because i have designed a specific profile in the link: ...
0
votes
0answers
33 views

admin_post hook error message passing

I've mocked up a quick skeleton plugin, I'm trying to catch the $_POST data from the form template. The best route that I've found is using the hook admin_post, unless there is a better alternative? ...
0
votes
0answers
30 views

do_action inside of onclick

I'm brand new with making plugins/widgets, and am probably pretty limited to basic in knowledge with php as well. I want to be able to register a function that runs when a button is clicked. The ...
0
votes
2answers
31 views

How do I override the user's input when updating a custom post type's permalink?

When publishing a custom post type, I'm trying to override the custom permalink based on code rather than what the user types into the input box. I can confirm my action is firing correctly, but I'm ...
0
votes
0answers
14 views

Running wp_schedule_single_event on Post Import

I'm trying to have a category deleted after a certain length of time once a post has been published. I was successful in doing this when a post is manually created, but I cannot for the life of me ...
0
votes
0answers
19 views

Getting current user option within a function

I have created a new true/false field for specific user role "Member" to receive email notifications if a new post is published. For reference I'm using advanced custom fields to create a true/false ...
0
votes
1answer
45 views

remove_action not removing add_action from constructor

I am trying to replace a message from a function that got hooked in a constructor from a class from woocommerce. This is what I tried to remove the message: What I tried. function remove_actions() ...
0
votes
1answer
51 views

Using init hook for register_taxonomy is causing invalid_taxonomy in wp_insert_term()

I'm developing a plugin and I've problem with inserting new term to my custom taxonomy. <?php add_action('init', 'create_tax', 0); function create_tax() { $args = array(...); ...
0
votes
1answer
42 views

Remove_action from plugin with a Class

I've searched around but haven't been able to find a solution to this. I'm trying to hook in and remove an action that was initiated by a plugin (specifically the Groups plugin). The function itself ...
0
votes
0answers
14 views

Add_action does not work

I am trying to make a coming soon page with a small form for subscribers who want to be informed about future developments. Therefore, I want to make a subscribe.php file, located in the root ...
0
votes
1answer
72 views

WordPress Plugin Boilerplate - add_action hook in static “activate” function

I'm hoping someone can point me in the right direction here. I'm using the Wordpress Plugin Boilerplate to develop a custom plugin. On install, the plugin will register a new post type (course), a ...
0
votes
1answer
31 views

Set default Custom Post Meta Value

I've tried almost anything and just can't get this to work. I have a custom post type with a custom meta field and I want a default value to be added on when the Publish/Update/Save button is ...
0
votes
0answers
45 views

Wordpress action form url doesn't work

I have a page-contact.php (i have my custom form) <form id="contact-form" name="contact-form" method="post" action=""> <input type="text" name="name" ...
1
vote
0answers
49 views

action hooks returning old category instead of new category

With some help I created a WP Action to send an email to the author of a post (custom post type) when the category has been changed. This works ok, except that the function is returning the previous ...
1
vote
2answers
27 views

how to change appearence of the content of default post list columns?

Speaking about backoffice here. I usually add columns and filters to the backoffice for certain custom post types. No problem here. BUt what if I would simply like to change something on the content ...
1
vote
1answer
51 views

An echo line in a transition_post_status action leads to “cannot modify header information - headers already sent by”

I tried to set up an action hook with transition_post_status. Inside I wanted to set up a few conditional statements. To see if everything works I wanted to place a debug statement. Problem is as soon ...
0
votes
1answer
165 views

Admin: global $post empty

I tried to get $post var outside function php in wordpress admin panel. The only way that I find to access to $post is to add_action. However I want to get this var outside the add_action and global ...
2
votes
1answer
60 views

Send an email when custom post type category is changed

This is the first time I've attempted to write an action hook. My CPT has 4 categories. I'm trying to make WP automatically sends an email notification when the category is changed. By change I ...