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

learn more… | top users | synonyms (2)

0
votes
1answer
25 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. ...
1
vote
1answer
151 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
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
3answers
739 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
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. ...
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
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 ...
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 }
1
vote
2answers
438 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 ...
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
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
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
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: ...
5
votes
1answer
197 views

Content hooks vs User hooks

This is more of a theory question than a question with a direct answer. I've been working with different actions for firing functions when a post is updated or deleted and when users are updated or ...
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
50 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 ...
29
votes
2answers
9k views

Passing a parameter to filter and action functions

Is a way to pass my own parameters to the function in add_filter or add_action. For example take a look in the following code: function my_content($content, $my_param) { do something... using ...
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
2answers
644 views

Return a custom value in a function added to an action hook

I looked into the difference between action and filter hooks, and as far as I understand, it is not possible to have a function, which is added to an action hook, return a (custom) value. My ...
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', ...
0
votes
1answer
329 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 ...
4
votes
2answers
2k views

add_action(), add_filter() before or after function

When looking through WordPress snippets/tutorials/plugins I often see add_action() and add_filter() being placed before the function is declared: add_action( 'publish_post', 'email_friends' ); ...
0
votes
2answers
158 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 ...
1
vote
1answer
386 views

Implement Hooks Using Array

I'm trying to implement some hooks into a theme, but rather than write out every hook with repetitive code I was wondering if I could use and array to declare the hooks instead. E.g. ordinarily i'd ...
2
votes
1answer
166 views

With what hook can I address all posts from all custom post types when they are published?

I want that when every Custom Post Type is published, a hook is called (where I send an email notification to the administrator). I know I can use: add_action('publish_{custom_post_type_name}', ...
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?
3
votes
1answer
1k views

Add something to beginning of the content

I'm using add_action('the_content', 'myFunction', 10) to append data to the end of the content. How can I place content at the beginning of the content?
0
votes
1answer
43 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
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
125 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
1answer
20 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 ...
1
vote
1answer
82 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
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')); ...
0
votes
5answers
3k views

Remove meta robots tag from wp_head

I am in need to remove just this line <meta name=robots content="noindex,follow"/> from wp_head but can't find the right hook to use it with remove_action(). <meta name=robots ...
5
votes
1answer
106 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
28 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 ...