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

learn more… | top users | synonyms (2)

2
votes
0answers
89 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 ...
2
votes
0answers
54 views

How can I invoke an action after a CiviCRM triggering event?

If I want to have a certain action taken after a CiviCRM 'trigger', what is the best approach? I'm a Drupal developer used to using Drupal workflows on CiviCRM actions, and I am unfamiliar with ...
2
votes
0answers
158 views

Auto Load Plugin Hooks inside Must Use Plugin

I am creating a custom MU plugin to run on a multi-site network. I am working on a function that will dynamically include files containing additional action and filter hooks based on the active ...
1
vote
0answers
76 views

How to find the hook(s) that make site slow

I am working on a site and it is working fine except one thing that it is very slow. I tried to figure out that which plugin or theme is creating the problem and find out that woocommerce-subscription ...
1
vote
0answers
14 views

Building a request processor for multi-page forms, etc using $_GET requests

Good day, What I'm trying to accomplish in a semi-elegant way today is building a multi-step form type thing. Essentially, I'm trying to rewrite the page based on a $_GET request. Like, say, it's ...
1
vote
0answers
28 views

add_action shortcut?

I think in PHP 5.4 or above (don't remember the exact version), instead of writing: function some_function() { } add_action( 'init', 'some_function' ); One can pass an anonymous function: ...
1
vote
0answers
52 views

Redux callback action

I'm very new with Redux. I don't know how to show and hide a textarea using switch (without saving). When my switch turns on, the text input displays and when it turns off, the input hides itself. I ...
1
vote
0answers
44 views

Using pre_get_posts to Filter Posts

I'm trying to filter archive_research.php to show only the research with status=current. In functions.php: add_action( 'pre_get_posts', 'only_current' ); function only_current( $query ) { if ( ...
1
vote
0answers
61 views

Comment search plugin

I want to develop a plugin which places a search input field above the first comment on the post pages, filters the comments below that post, and only shows the comments which include the string that ...
1
vote
0answers
117 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: ...
1
vote
0answers
52 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
0answers
78 views

Theme elements not translating

Ive got a theme that is set-up for translating but didn't come with any translations. I used poedit to automatically detect the strings, and subsequently translated it in full. However certain ...
1
vote
0answers
425 views

Having an add_action( 'user_new_form',)

I am using the following action; add_action( 'user_new_form', 'epx_add_user_form_to_admin_area',489); function epx_add_user_form_to_admin_area($current){ $current .= 'this is a test'; echo ...
1
vote
0answers
257 views

Add custom buttons with custom actions in Edit Post screen in WordPress?

I am creating something for a client and I have a Class that I created with a Custom Post Type called 'PuSH Feeds' and when the user adds a new post and publishes it they can then click on one of two ...
1
vote
0answers
47 views

Multiple Loops Meta Data

I am now trying to figure out how to create the functions/ loops to pull my data from custom post types. I have two post types(keys): And I need to pull the data from both to run my functions. ...
1
vote
0answers
203 views

How to customize the “Insert/edit link” popup box?

is there a way to customize the "Insert/edit link" popup box in the editor so that it does something like this: Have a checkbox that says "Insert affiliate tag at the end of link" If the checkbox is ...
1
vote
0answers
117 views

I have 2 plugins using the same wp_login action hook and one is not working

so this is after a few hours investigating, I have s2member plugin and a custom plugin what happens is they are both using wp_login hook in this manner, s2member: add_action("wp_login", ...
1
vote
0answers
70 views

Issue understanding and using WordPress filters and actions

I have a custom WordPress plugin that I have developed. The plugin is a widget bundle containing a bunch of custom widgets. The scenerio The plugin allows for custom css styles through creating a ...
1
vote
0answers
72 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
0answers
62 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 ...
1
vote
0answers
45 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
0answers
118 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
0answers
73 views

How to prevent further updates of custom meta when using actions to set one meta based on another

I'm using rilwis' Meta Box plugin (see https://github.com/rilwis/meta-box) to add custom meta boxes to a custom post type. I then want to populate one piece of meta data based on the value of ...
1
vote
0answers
102 views

Copy post to separate database with “add_action(…)”

I'm basically trying to have a copy of a post be sent to another database's table when it's published. I've gotten it to add a new row in the new table, with my own static arguments, but I'm not sure ...
1
vote
0answers
75 views

Submit custom form from post content and execute in plugin

I have prepared custom form (quiz plugin) with embedding in custom posts via {{QUIZ_ID}} placeholder. My form is displayed in post correctly but bigger problem is what form action should I create (and ...
1
vote
0answers
71 views

Selectively applying action based on role

I've added an action to my functions.php file that forces a plugin (Content Scheduler) to act on posts, even when it wasn't explicitly enabled by the person writing the post. I've got that working, ...
0
votes
0answers
17 views

Run javascript code after “woocommerce_payment_complete” action hook

I am trying to fire custom javascript code after successful payment in woocommerce. Code that I use so far: add_action( 'woocommerce_payment_complete','mysite_woocommerce_payment_complete' ); ...
0
votes
0answers
24 views

register_nav_menu & add_action & in AJAX callback

Is it possible to call add_action or register_nav_menu in AJAX callback? I.e. add_action('wp_ajax_some_ajax_action','ajax_callback'); function ajax_callback(){ ...
0
votes
0answers
34 views

remove_action not working with procedural function

I have a purchased theme that procedurally loads an action like this: function func() { echo "head content"; } add_action( 'wp_head', 'func', 5 ); Following the remove action codex I tried the ...
0
votes
0answers
42 views

How do I output the returned value of a function that uses an earlier hook?

If I define a function that retrieves a value within an action hook and returns it, what is the best way to call the function in a later hook? My general aim is to write reusable functions with ...
0
votes
0answers
23 views

Order categories input fields

I am using: add_action('category_add_form_fields', array ($this, 'add__form_fields'), 10, 2); To add an extra field in the categories form, it is possible to choose the position of this new field? ...
0
votes
0answers
15 views

how to init wordpress env from within custom script

I know you can run a php script using the wp-cli command which will init the wp env for you as discussed here Initialize WordPress environment to use in command line script but what I want to do is ...
0
votes
0answers
21 views

How do I get the full details of a registered/enqueued script?

I'm trying to get the details (such as src, in_footer etc) of enqueued/registered scripts. For example: add_action('init', function() { global $wp_scripts; var_dump($wp_scripts->queue); ...
0
votes
0answers
53 views

Filters, priority when run after plugins_loaded

In my main plugin I filter the_content to add rich snippets. Something like this: add_filter('the_content', 'add_schema'); function add_schema( $content ) { $schema = NULL; //To avoid undefined ...
0
votes
0answers
23 views

Get Custom Post Type posts on normal edit-posts and pass to TinyMCE

I am following a tutorial for adding a dropdown list in tinyMCE editor. In the end I would like to have a Select list similar like it is in this image , but populated by post titles from Custom Post ...
0
votes
0answers
19 views

How to add new tab and data in Wordpress Users section

I have to add new tab and new data in wordpress users. Please see the image below. The points tab came from the plugin mycred but i don't know what was used. What I think was it was done using: ...
0
votes
0answers
45 views

Why a class property becomes empty?

I have a class with a private property/variable named $postID that I can pass successfully (this was tested) to every function within this class except one named handleForm(). When it is passed to ...
0
votes
0answers
162 views

Custom Message with Order status from WooCommerce Payment Gateway Callback to Order Thank You Page

I would like to pass on the custom message to order-received page in woocommerce. Here how i currently handle the callback from payment gateway if ( isset( $_REQUEST[ 'callback' ] ) { ...
0
votes
0answers
64 views

On WP 4.4, how to get the post id on comment_post hook

Since WP 4.4, seems like is not possible anymore to use get_the_ID() or the_ID() when hooking on comment_post action. How can I get the post_id when a new comment is saved?
0
votes
0answers
23 views

Adding a taxonomy filter

I'm am attempting to add a custom taxonomy filter. I have partially achieved this, I have a dropdown menu that displays all of the desired terms. However when I actually attempt to filter on these ...
0
votes
0answers
19 views

Is there any hooks or filters to detect an action after user upload video to AWS (Amazon Web Service)?

I am using the plug-in AWS and offloads3 to upload video to AWS, however, I would like to find a hook or filter to detect a state when after user uploaded video/image successfully to Amazon web ...
0
votes
0answers
54 views

Is it bad practice to use $_POST['post_type'] in an action hooked on save_post?

In a custom plugin I wrote an action hooked on save_post that Only needs to fire when a particular Custom Post Type is modified Sometimes uses wp_insert_post to add a post of a second Custom Post ...
0
votes
0answers
72 views

Custom button on admin page doesn't trigger click event

I created a custom button on the "users" admin page. I have a script (loaded correctly) which should register the button click, but it doesn't. I followed an example where they hooked the ...
0
votes
0answers
29 views

Add action after function defined in plugin

I'm trying to write my second ever plugin (my first was a derivative of Hello Dolly) and I have a function that does something, however my issue is that I don't know what action to use to call my ...
0
votes
0answers
11 views

How to trigger an email when a posts metadata has been updated?

I'm really struggling on this one, so I appreciate the help from all of you guys/gals. I've built a progress bar type of application for a client. The basic setup is that each project (custom post ...
0
votes
0answers
67 views

Access Action Hook from Child Class in External Plugin Class

I am attempting to access an action hook that is declared in a plugin's child class. The plugin uses a singleton instantiation pattern: class WC_Freshdesk { protected static $instance = null; ...
0
votes
0answers
33 views

Add info to plugin list view on WP admin

I'm writing a plugin, and want to add some custom info to the plugin list view on the wordpress backend. Like, here: [] Is there an action or a hook I can use, I tried searching for it but couldn't ...
0
votes
0answers
24 views

Why is this require statement not working?

I am faced with this strange issue when the script loads it gives me an error: [04-Oct-2015 18:36:04 UTC] PHP Warning: require(../main/otherfile.php): failed to open stream: No such file or ...
0
votes
0answers
21 views

Hook To Get All Posts Deleted

I've added an which makes a call to an external service every time a post is deleted. However, it's on the delete_post hook, which works fine when I delete a single post, but if multiple posts are ...
0
votes
0answers
17 views

Store Variable to be used Across Admin All Post Page

In the main taxonomy admin page (All page, All post, WooCommerce Orders, etc.) I am looking to store a variable to be stored for the page and then be used by a filter for each individual item row. ...