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

learn more… | top users | synonyms (2)

2
votes
3answers
929 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 ...
0
votes
1answer
57 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
182 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 ...
0
votes
0answers
32 views

BuddyPress: groups_group_create_complete action does not fire after creating a new group

The action hook groups_group_create_complete does not fire after I created a new group. What could be the problem?
3
votes
1answer
157 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
451 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
82 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
407 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
155 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
133 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
334 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
0answers
175 views

How to add X number of products to woocommerce cart at once

I am trying to add x number of products input and button to my catalog page so I can select a number, then hit add to cart. Is it possible to add in this function? The user will provide a number ...
1
vote
2answers
910 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
200 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
442 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
202 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
51 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
536 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
212 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
51 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
130 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
226 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
63 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
54 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
51 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
77 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
663 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
76 views

How to remove a class

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
35 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
66 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
494 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 ...
2
votes
1answer
261 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
98 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
42 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
88 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
90 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
37 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
151 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
164 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', ...
1
vote
2answers
701 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
79 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
68 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
127 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
358 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
276 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
257 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
258 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 ...
1
vote
2answers
140 views

admin-ajax.php “ Missing argument 2” warning

I have the following code in functions.php <script type="text/javascript"> var post_id = "1055"; // hardcoded post id for testing purposes var type = "some_type"; var data = {action: ...