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

learn more… | top users | synonyms (2)

0
votes
0answers
136 views

Can't update an option when the publish_post action is fired.

I'm using Tom McFarlin's Plugin Boilerplate, and I'm facing this huge problem where I can't update an option when the publish_post action is fired. I have a function that hooks into the publish post ...
3
votes
1answer
158 views

Which action for triggering cron “wp”or “init”?

Which one do you recommend using within a plugin and why? add_action( 'wp', 'trigger_me' ); function trigger_me() { if ( !wp_next_scheduled( 'my_plugin_cron' ) ) { ...
0
votes
1answer
630 views

How to access function from outside of a class within this class in WP plugin?

I am developing a WP plugin called e.g. DD_Awesome_Plugin and this is my code so far (simplified version without additional code logic within class functions): class DD_Awesome_PLugin { public ...
2
votes
3answers
1k views

Sending form data via PHPMailer - How to action PHP script from a form

Some easy points on offer... I wish to action a PHP script from a WordPress page but where is the best place to store the script? The script works perfectly fine using a non-WordPress environment in ...
1
vote
1answer
72 views

Wordpress Theme Update Action?

I've done quite a bit of searching. I'm looking for hook/action called after a theme update. I know the initialization one - but a basic update? Cannot seem to find. If one does not exist, how can ...
0
votes
0answers
245 views

Front end form submission/processing, without using a template file

I'm writing a plugin which has a front end form that is generated by a shortcode. I'm struggling with processing the form submission in any way. Many tutorials describe placing form processing code at ...
3
votes
1answer
218 views

How to add a “publish” link to the quick actions

I'm trying to add a "Publish" link by the quick actions: but I'm not exactly sure of how implement it. Here's what I've got so far: add_filter('post_row_actions', function ( $actions ) { ...
10
votes
1answer
494 views

How to create an API for my plugin?

I have been developing plugins for WordPress, most plugins I have developed use two or three classes, hence not as huge as Buddypress or WooCommerce. I am planning to develop two open source plugins ...
1
vote
0answers
97 views

Update User Meta after Registration [closed]

After a user registers, I am creating two pages of two different custom post types, and then need to store a custom meta value in their user data to assist with redirects later. I've found that if I ...
1
vote
1answer
525 views

Empty Super Cache programmatically (with ACF action)

I regularly use Advanced Custom Fields to create awesome backend interfaces for my clients (as I'm sure a lot of us do…). ACF includes an Options add-on that creates one or multiple global options ...
1
vote
1answer
188 views

Removing an action, or dequeueing style - Both not working

What I am wanting to achieve is to remove an action called inside of another action. The action is calling a style, and although I have tried to deregister, and dequeue the style, it is still ...
1
vote
2answers
156 views

Replace a word with a word in the URL string

I'm trying to replace a word on every page for example "Denver" with a word from a URL string, so I'll have like ?city=Atlanta in the URL. So I was thinking of using PHP's GET to just get the city ...
1
vote
1answer
373 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 ...
1
vote
2answers
2k views

Trouble understanding apply_filters()

In apply_filters() apply_filters( $tag, $value, $var ... ); I'm having trouble wrapping my head around the $value and $var. I read the codex and it sounds like the $value can be modified, $var not, ...
3
votes
1answer
275 views

Is there an action for when permalinks are rebuilt?

In my plugin, I have a list of titles and permalinks in the options table. It's updated every time my custom post type is saved. Since I'm saving permalinks the option data can become bad if the ...
10
votes
1answer
501 views

Using jQuery to delete data stored in wp_options

I wonder if anyone could advise me further on my problem. Part of my plugin stores log files for debugging purposes. I have successfully displayed them in a (div#log) in my admin page using jquery ...
1
vote
2answers
359 views

Removing an action from an external plugin class

I am using a plugin that has this line of code to add an action from the Eazyest_Frontend class: add_action( 'eazyest_gallery_thumbnails', 'ezg_thumbnails',5); I want to remove that and do ...
0
votes
1answer
56 views

How to show a users bio on a page

I'm fairly new to Wordpress. I have users that create profiles on my site and one of the sections is their bio. How can I take this information and display it on lets say a "users profile page". ...
0
votes
0answers
54 views

How to load script-related styles automatically?

Scenario: It is common that a JS dependency is bundled with a style file to work properly (just think about your favorite slideshow jQuery plugin). AFAIK, in this situation, the script and style have ...
1
vote
1answer
666 views

Using several add_action with parameters inside a class

I'm creating a theme framework and using a class to initiate all basic function of the theme (adding theme support, menus, etc). I've got stuck when I tried to enqueue the scripts and styles though: ...
1
vote
2answers
282 views

Hook before inserting user into database

I'm working on airsoft website using woocommerce. One of my client's needs is to prevent a user to register if his name or mail is in a blacklist (I don't know yet if I'll use a csv file, a json or a ...
1
vote
0answers
53 views

Alternative to the filter comment_reply_link

I'm making a plugin and need to add a link to every comment on the front-end. I've used the filter comment_reply_link but that filter doesn't work when we're on the lowest level of threaded comments ...
0
votes
2answers
170 views

Problem with executing a function on saving a post

Here is my basic plugin code. I am just starting from scratch. I will explain the functionality. It is simple, While my plugin is active it will add a new meta box in add new post page just below the ...
1
vote
1answer
256 views

Filter list by a unique meta value dilemma

I'm been racking my head at this for a while now, and I can't figure out how to fix the code. Here's the issue; I found a snippet of code online to filter my post results in edit.php based on ...
-1
votes
1answer
81 views

What do the numbers mean at the end of add_action('save_post')…?

I've seen on a few tutorials that there are numbers at the end of the call to save Custom Fields/Meta Boxes on the save_post hook. For example, in the WordPress Codex it gives the following example: ...
0
votes
1answer
58 views

How to do a task only once for logged in users

I want to do a task only once after an user has visited my site. I am currently doing like this: function my_task(){ //do my tasks } add_action('init', 'my_task'); I am doing this from a ...
0
votes
1answer
61 views

Is there an action for save_menu and/or update_menu?

I want to "save" my menus into transients. I want to update those when there's been any changes to the menus via the admin custom menus. I've looked for an action but can't see to find anything. ...
0
votes
1answer
82 views

Dynamically change post_parent in every page load?

What's the correct Wordpress action where I can hook to dynamically change the post_parent of a post? I understand that a post can't have multiple parents so that's the only way I can think of to ...
0
votes
1answer
945 views

add_action on a specific page

I found this script Wordpress Media Manager 3.5 - default link to and it works fine for me. But my problem is, that I have a custom wp_editor on the front end where I want it to work, but I can't ...
-1
votes
1answer
79 views

How to remove a class [closed]

Is it possible to remove classes from a plugin and add theme into to theme? I need to modify Woocommerce WP_Checkout class but I want to move it to my theme folder so if woocommerce will be updated ...
1
vote
0answers
36 views

Hooks are not being removed in child theme

I have a hook file: function load_admin_package(){ do_action('load_admin_package'); } /* * ----------------------------------- * Define hooks bellow * ----------------------------------- */ ...
1
vote
1answer
75 views

Issue plugin commands in admin settings page

What is the right way to issue commands in wp-admin? My plugin imports data from a set of RSS feeds via a cron job. Thats all working good. I've set up a custom settings page to change parameters, and ...
1
vote
1answer
636 views

Why are you using add_action for shortcode?

I would like to create shortcodes, some tutorials write about to use add_action add_action( 'init', 'register_shortcodes'); but I read tutorials where the author didn't use it, only put ...
3
votes
1answer
316 views

Difference between do_action_ref_array() and do_action()

I am having trouble wrapping my head around these two functions. I understand do_action() but I don't see clearly when do_action_ref_array() would be useful. Couldn't we pass an array to do_action() ...
1
vote
0answers
105 views

Set static page/post from another blog on same network

I have a multisite project and have a small problem with static front page/post. In general i am looking for a way to choose a static page/post out of the whole network on my main blog. Now i'm not ...
1
vote
1answer
52 views

What is the purpose of $merged_filters?

Savvy WordPress user here, or at least trying to be. I have the hang of hooks and filters with the code in WP's plugin.php The only thing I cannot seem to understand is the $merged_filters global. ...
0
votes
2answers
101 views

Display Something in the Header After All Styles are Loaded

I'd like to include a functionality in a theme that will overwrite styles from previously included CSS files. For this purpose, I need to be able to display a <style> in the header after ALL ...
0
votes
2answers
97 views

Action hook to control access to certain parts of my site

I'm searching for an action hook which I can use to control access to certain parts of my Wordpress site. I want to write some custom PHP which will check certain user attributes and decide if they ...
0
votes
1answer
38 views

Building WP Web App: Creating a Feed for post revisions

I'm building a project management web app using WordPress. I want to create a kind of "news feed" on the home page so that everyone can see what the latest posts added/edited were. I need this to ...
1
vote
1answer
184 views

Detect type of post status transition

I have a function on my site that it supposed to run when a new post is published (email push notification), with the exception of the same article updated (i.e publish_to_publish transition, I don't ...
0
votes
1answer
202 views

How to get current action?

I am developing custom registration form. Is it possible to get current action (comment adding or user registration) in function? For example i am using: add_filter('preprocess_comment', ...
2
votes
2answers
1k views

remove_action in a theme

I'm using a theme that gets updated pretty frequently. For this, it has added a custom.php file to include modifications. Now, in this theme, under the functions.php, the developer has included his ...
-1
votes
2answers
87 views

Hooks are not executing

Based on my understanding of hooks, you create a hook, by doing do_action('hook_name'); then add something to said hook and call the method where you want it to do the hook, so: public function ...
1
vote
1answer
82 views

Create hooks based on an array of hook names?

I have this idea where I would create a class that would take in a set of hook names then create them, for me to use when ever, and where ever. Currently the way to create a hook is we do something ...
2
votes
2answers
147 views

add_action on inherit post status

I'm trying to use the add_action() hook to run a custom function, but am struggling with the post status. I originally tried using: add_action('pending_to_publish_portfolio', 'my_function'); ...
0
votes
1answer
529 views

register_activation_hook in oop approach

I tried to develop a plugin in OOP approach. I tried to load all the function needed inside the constructor class e.g action hooks. The problem is this hook "register_activation_hook". It wont load ...
-1
votes
1answer
2k views

WooCommerce Order Status Displays Twice on Order Page

I modified the woocommerce_custom_order_columns function to make some changes to the WooCommerce Admin Order page. Everything works great, except that Order Status shows up twice (but only for the ...
3
votes
2answers
388 views

Action hook 'wp' firing twice… why?

I noticed that when I hook into 'wp' it seems to be firing twice -- for example add_action('wp', 'just_testing'); function just_testing(){ global $post; error_log($post->ID); } returns ...
0
votes
1answer
275 views

Would there be anything stopping me from removing both wp_head and wp_footer?

Some plugins rely on either wp_head or wp_footer or both to introduce their own stylesheets and JavaScript. Those scripts take time to load and slow down my website. Therefore, I would like manually ...
3
votes
2answers
342 views

How do I use add_action from a class method?

For some context, we're building an activation system for new users of an app using WordPress as a framework. We've got a plugin driving most of our interactions, where all of this code resides. When ...