The actions tag has no wiki summary.
2
votes
2answers
57 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 ...
2
votes
2answers
235 views
Run javascript code after wp_login hook?
after using the wp_login hook, is it possible to add a snippet of javascript code to the page seen immediately after the login in wordpress?
I want to use this top implement a notification system ...
0
votes
2answers
227 views
How to get post ID with hooks publish_post, new_to_publish, etc
I have two plugins, one uses the function wp_insert_post(), the other has a code like this:
add_action('future_to_publish', 'myFunc', 10, 1);
add_action('new_to_publish', 'myFunc', 10, 1);
...
4
votes
1answer
107 views
Store source permalink on XMLRPC calls
In a theme I'm developing, I need to link to the source post when the post has been stored using XMLRPC. That implies that every time Wordpress asks for a permalink (using get_permalink()) the theme ...
1
vote
1answer
49 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 ...
0
votes
1answer
35 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
22 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 ...
0
votes
1answer
61 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 ...
0
votes
1answer
61 views
remove_action returns FALSE
I'm trying to remove the canonical link reference from my page headers and I'm using the following code in my functions.php:
remove_action('wp_head', 'rel_canonical');
However, when I test the ...
0
votes
1answer
99 views
template_redirect action only firing if logged in
add_action('template_redirect', 'add_header_redirect', 0, 0);
function add_header_redirect(){
if( is_page(array(8, 'testimonials', 'Testimonials')) ){
$default_testimonial = get_permalink( ...
0
votes
1answer
147 views
Create action running on trashed_post hook to modify post_meta value
I have a custom post type that always do math operation to its post_meta and other custom post type post_meta.
For example:
post-type 1 = cpt_product_order
post-type 1 post_meta = ...
1
vote
0answers
21 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
27 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
52 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
18 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. ...
1
vote
0answers
40 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
53 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
55 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
15 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
26 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 ...
0
votes
0answers
35 views
Plugin Edit file/table data?
Hello WordPress people,
At the moment I'm building a plugin.
Via a form people can add some data that will be inserted in a database table.
At the same page I'm reading that table the display al the ...
0
votes
0answers
37 views
Trying to understand the action: save_post and an incomplete $post object
I begin with a fresh post (i.e., add New). I fetch (via Ajax) an image (read: src) from another site. In the process of saving (action: save_post) I want to PHP copy() the image to my local server and ...
0
votes
0answers
26 views
Strange / unexpected results with add_action('save_post')
As I'm sure plenty of you know already, 'save_post' will actually fire multiple times for a given save. Rather than copy / paste the same 12+ lines of code every time I need just a single fire, I ...
0
votes
0answers
20 views
Link to the same page ( action=“whattowritehere?”=
I am really noob for web and just got jumped in the middle of it... so there are my code which is working perfectly without wordpress..but if i use it with a custom template the buttons actions didnt ...
0
votes
0answers
54 views
Which hook/action for save on publish and update?
This function works exactly as expected when:
Add a new post with a youtube url in the content somewhere
Click 'publish'
Click 'update'
What I'd like to have happen is for it to run correctly ...