Hooks a function on to a specific action. Actions are (usually) triggered when the WordPress core calls do_action().
2
votes
1answer
184 views
How to modify wp_ajax function?
I want to modify wp_ajax_find_posts function. It receives search string from find-posts form and delivers search results by ajax. Part of the function looks like this:
function wp_ajax_find_posts() {
...
1
vote
1answer
71 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 ...
0
votes
1answer
33 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', ...
0
votes
1answer
77 views
How can I hook into creating a new post and execute wp_die(), before the post is inserted into the database?
Info about wp_die from codex: Kill WordPress execution and display HTML message with error message. A call to this function complements the die() PHP function. The difference is that HTML will be ...
0
votes
1answer
77 views
where does my function output from load-* go?
I've got a function hooked into load-edit.php that prints out print content:
add_action('load-edit.php', array($this, 'generate_bulk_print_content'));
public function generate_bulk_print_content() {
...
0
votes
1answer
35 views
Modify functions.php to add a term 'uses-theme' set to theme name on post save
I need to automatically (without anything visible to the user in the UI and without user intervention) 'mark' a post in a sub-blog with the theme it was set to when the user posted.
As I understand ...
0
votes
1answer
48 views
Can admin_bar_menu or another action be used to modify the admin bar on the admin side?
I have used add_action('admin_bar_menu', 'modify_admin_bar') to change the admin bar on the "front end" of WordPress (the site the user sees). However, it seems that modify_admin_bar() is not called ...
0
votes
1answer
115 views
Dynamic wp_enqueue_scripts?
Is it possible to call wp_enqueue_scripts dynamically?
For example, I want to use in function.php my own function
addThemeJS( true, 'modernizr', THEME_JS_DIR . "/plugins/modernizr.custom.js", ...
0
votes
1answer
86 views
stumped on add_action hook to delete_comment - any ideas?
I'm pretty new to plugins and trying to run a function when deleting a comment. This entails hooking into "delete_comment" if I'm not mistaken.
...
0
votes
1answer
46 views
Running a wordpress action when a custom post type term (taxonomy category) is changed
Trying to make a system whereby a function is called upon an admin changing the taxonomy category (term - if i understand correcrtly) of a custom post type.
I thought the action tag "edit_category" ...
1
vote
0answers
56 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
vote
0answers
46 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');
...
1
vote
0answers
42 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 ...
0
votes
0answers
6 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?
0
votes
0answers
26 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 ...