The hooks tag has no wiki summary.
2
votes
0answers
62 views
Placement of Code in Plugin for hooking `save_post`
I ran into a strange Problem today developing a new Plugin.
I set it up as usual, creating the f711-roomprice folder in the Plugindirectory, and creating the f711-roomprice.php as well as an inc ...
2
votes
2answers
61 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
1answer
36 views
Hook to edit an column on comments screen?
At the moment I'm doing
add_filter("manage_edit-comments_columns", function($columns) {
unset($columns["author"]);
$columns_one = array_slice($columns,0,1);
$columns_two = ...
2
votes
1answer
89 views
publish_post plugin hook doesn't always pass $post->post_content
I've written a simple plugin that grabs the contents of a post, as the post is published, and sends them to an external site for archiving. This generally works but when dealing with posts that ...
2
votes
1answer
102 views
Post thumbnail relative link and HTML modify
I want to remove the website url from all the_post_thumbnail() so they become relative and remove/add attributes from the output.
So far I got the following code added to functions.php of the theme, ...
2
votes
5answers
236 views
How do I make a theme “plugin-ready”?
How do I revise a theme so that I can publish my event hooks and anyone can build a plugin to add new functionality easily to my theme?
2
votes
2answers
177 views
Which hook should be used to validate custom form fields on the login form?
I've added a custom input field with login_form hook.
So, I need to process the post data to validate.
I've used the lostpassword_post for lostpassword_form and works great, but I cant find a hook to ...
2
votes
1answer
92 views
Problem using role_has_cap hook
I'm trying to filter a capability check in order to work around the lack of filters to customize the user edit page in the admin area. But I can't seem to add filters to a hook, and I'm sure I'm ...
2
votes
1answer
103 views
How can I customize the upload error message in Wordpress?
After following the guide for How can I prevent uploading bmp image? to remove bmp (and in my case tiff images) from being uploaded, I tested and it is working, but noticed users are now getting the ...
2
votes
2answers
242 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 ...
2
votes
1answer
58 views
Hooks for Links Box [duplicate]
Possible Duplicate:
Getting archive pages in WP's AJAX internal link finder?
Are there any hooks for the new internal links box that was created in WP 3.1? I'm trying to modify it in my ...
2
votes
3answers
492 views
Is there a hook for user activation (after they click the email confirm)?
Is there a hook for user activation (after they click the email confirm)? I am creating a plugin to automatically add them to my email software, but I want them to have to confirm their email first.
1
vote
3answers
370 views
How many times can I hook into the same action?
I have a theme which includes some setup, using after_setup_theme but I'd like to write my own functions which also need to run after_setup_theme. I'd prefer to keep my stuff in a separate file. Can I ...
1
vote
3answers
366 views
Insert all post IDs in new database table
I have a plugin which creates a new database table. Upon activating the plugin is there a way to insert all my posts ids into that table?
Right now I'm using an action hook to immediately insert the ...
1
vote
2answers
1k views
Why isn't is_home() working correctly?
I put a if(is_home()) bit in my theme's functions.php and it doesn't seem to work. The function containing this bit is called on init so is_home should work already.
1
vote
3answers
78 views
When to use actions and when to use filters
I'm trying to understand where to use filters and where to use actions.
Suppose I have a query in a plugin, which later add on modules might modify to change the results of the query, thus modifying ...
1
vote
1answer
1k views
WordPress Hook for user register
how can I tell WordPress, that if a user registers, it shall execute my function?
1
vote
3answers
492 views
Why doesn't wp_enqueue_script() work when including a JavaScript file with TEMPLATEPATH?
I am trying to use tips from here to add my JS file.
I put the following in the functions.php of atahualpa theme I've got installed
function lektor_init() {
if (true) {
...
1
vote
2answers
85 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, ...
1
vote
2answers
82 views
Too many actions/filters!
New to wordpress here. The concept of actions/filters in and of itself is not too difficult to grasp. What I am overwhelmed by is the HUGE amount of actions and filters available. When I am looking at ...
1
vote
3answers
319 views
wordpress custom modules/widget areas on the page? can i make my own?
im kind of a wordpress noob so please excuse my inexperience.
so long story short, ive been tasked with creating a WP theme (kinda simple) but, one of the areas, around footer area, has a few things ...
1
vote
3answers
145 views
How/Where can we request new WordPress hooks to be added?
I use the great Changelogger plugin, which adds plugin version history to the plugins page when there is an update, but it doesn't work from the updates page where you can update WordPres core, ...
1
vote
1answer
109 views
filter the_title problem in nav
Hi I have a problem with the_title filter:
I have this code at my constructor:
add_filter( 'the_title', array($this, 'change_title') );
and this as callback (for testing purposes)
public ...
1
vote
2answers
60 views
Failed to invoke other hook from the init hook
Related to this question (Use wp init hook to call other hooks?) but not the same.
Sometimes, I found that the hook will failed to run when I place inside the init hook, e.g.
Not Work:
...
1
vote
1answer
192 views
Execute function when post is published
I try to use this function i have created when a post is published for the first time.
function a_new_post($post){
$post_id = $post->ID;
if ( !get_post_meta( $post_id, 'firstpublish', $single ...
1
vote
3answers
249 views
Is there a recover_post hook to go with trash_post hook?
I'm using the trash_post hook to set a flag in a custom table to indicate that this item is "deleted", but when the user chooses to restore that post, what hook can I use for that? I couldn't find ...
1
vote
3answers
1k views
How to hook wp_list_pages?
How can I hook the wp_list_pages function so that it reads a value of a custom field and displays it instead of displaying the page title?
1
vote
2answers
1k views
How do I “unhook” / de-register jQuery so that it's not called as part of wp_footer();?
I need to "unhook" jQuery from my wp_footer() ... it's being called automatically and I'm looking for something I can add to functions.php which prevents it from being called a second time in the ...
1
vote
2answers
904 views
What hook should be used to programmatically create a post only when master post is updated?
Pippin and Jean-Baptiste Jung have very good tutorials on how to programmatically create content when a new post is published using these four actions hooks...
publish{post_type}
...
1
vote
1answer
955 views
Why is save_post hook not running?
I am trying to save my meta box, I have something like
function xxx_meta_box_callback() {
add_meta_box('xxx-meta', 'xxx Details', 'xxx_meta_box', 'xxx-post-type', 'side', 'default');
...
1
vote
3answers
930 views
Hook for post and page load
I need to run a function when a particular post or page is loaded. Is there any hook that lets me check whether a post is being displayed during page load ?
1
vote
2answers
196 views
action lifecycle
I'm looking for a documentation page where wordpress action lifecycle is explained. Does it exist?
I can't understand if init is called before admin_head or viceversa (even if the name is ...
1
vote
2answers
62 views
Same Conditionals Not Working on Two Different Hooks
Everyone!
I am new to WP and trying to build a plugin. I have the following codes working properly:
add_filter('the_content', 'say_hello');
function say_hello($content){
if(is_single() || ...
1
vote
2answers
834 views
Unregister post type from child theme
I'm trying to unregister a post type from a child theme but I haven't been able to do so, the code in the funcions.php file on the parent theme is something like this:
add_action( 'init', ...
1
vote
1answer
357 views
Hook up MU site creation
I want to write a plugin so I can hook up the wp_install_defaults function.
I actually need to do the following: when a new site is created, I want to import a default XML file with some categories ...
1
vote
3answers
1k views
Hooking a function onto the sidebar?
I'm looking for a way to add some content to the top of the sidebar when it get's loaded.
I've tried hooking onto the get_sidebar action as referenced here, but it seems to override the sidebar call ...
1
vote
2answers
978 views
post meta data clearing on autosave
For starters I am using this GREAT answer to achieve custom post types as well as a custom way to insert those post types into other pages, you can view that answer here:
Custom field/meta populated ...
1
vote
3answers
253 views
How to find hooks as per Just-In-Time approach?
How can I follow Just-In-Time approach in hooking up my function to an action? I mean everybody just attach the functions to a very early stage like init which leaves the scope of optimisation. I saw ...
1
vote
3answers
331 views
Good tools for locating hooks in a wordpress page/admin interface/blog post?
I've recently started using the Hikari Hooks plugin for Wordpress as it seems to allow you to get a good idea of what do_actions are being called on the page, so that you can easily find out where ...
1
vote
3answers
138 views
How to inject content after <body>
I would like to inject some elements directly after the <body> tag.
Is that possible using only WordPress hooks?
1
vote
2answers
90 views
Creating a function that receives the taxonomy terms that have been changed in a custom post type
Ive been looking into actions and hooks etc... from wordpress, but cant seem to do a very simple thing. I just want to execute a function whenever a post is updated, and within the function I want the ...
1
vote
1answer
52 views
How to check if upload window came from the featured image link?
I need to verify if the media-upload screen came from a click on the "feature image link" on the admin screen. How can i do it?
I've already change the way the uploader works , but I need to check ...
1
vote
1answer
71 views
How to Remove the “Restore” Link in Quick Edit?
I want to know is there any hook to remove the Restore link in the edit page - trash page?
/wp-admin/edit.php?post_status=trash
I know I can hide it with a css/jquery trick, but I prefer to use a ...
1
vote
1answer
33 views
Is there any way to allow a plugin to write over a previous version?
When installing a plugin, it will not install if the directory to which it is attempting to install already exists. This means that users of our plugin must first manually deactivate and delete the ...
1
vote
2answers
837 views
Adding custom text in items titles from wp_nav_menu()
I need to add something after each title of a specific menu called by wp_nav_menu()
I tried
add_filter('wp_nav_title', 'testing_stuff');
with
function testing_stuff() {
$item->title = ...
1
vote
1answer
914 views
Hook to get image filename when it is uploaded
I want to get the full local filename of an uploaded image so that I can copy it to a new directory and process it with my own image processing scripts. Which hooks/actions should I look into to ...
1
vote
1answer
512 views
functions.php conditional tag - only show in single.php?
//Geo Map
add_action( 'woo_post_inside_after', 'my_geo_mashup' );
function my_geo_mashup() {
global $post;
if ( in_category('listings') ) {
echo GeoMashup::map();
}
}
Works to ...
1
vote
3answers
7k views
Remove title attribute from images
I'm looking for a way to remove the title attribute from images, preferably through using a hook or a filter.
Most clients don't bother giving images a proper title, thus eliminating the purpose of ...
1
vote
1answer
674 views
How to check if certain plugin exists and in expected version
I've created plugin that goes to wordpress plugin repositories. Now, I need to create another plugin (sub plugin or child plugin you may call) that require this certain plugin to be already installed ...
1
vote
1answer
45 views
How to remove a metabox from menu editor page?
I am not sure if it is much different for any page but I am wondering how to remove a metabox from the appearance>menu page without having to go into the wordpress core files and remove it. Is there ...