The hooks tag has no wiki summary.
-1
votes
0answers
14 views
hooks of qTranslate
Is there any ways to find out all hooks of qTranslate? I am thinking to add an action when a user clicks a flag to change the language. I've checked the cord codes of qTranslate, and it seems that ...
0
votes
2answers
219 views
'save_post' hook not working in WP 3.5
I used to have an extra option added to the 'Edit Media' screen (using the attachment_fields_to_edit hook, and then saving with attachment_fields_to_save). However, I've updated to 3.5 today, and the ...
0
votes
0answers
12 views
One page site (returning from google) + history manipulation
I am making a one page site using wordpress.
The one page has all the menu pages linked into one, but there will be arbitary pages (landing pages) for subcategories and stuff at the moment.
I have ...
0
votes
2answers
231 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);
...
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:
...
3
votes
2answers
4k views
Use latest jQuery in WordPress (admin interface)
I want to use the latest jQuery (and jQuery UI) versions on my admin interface (editing a specific post type that I created).
I tried this:
// jQuery 1.x
wp_register_script('jquery1x', ...
0
votes
1answer
1k views
Woocommerce Product Category Widget - hide categories that have no products in stock
I'm using WooCommerce on my Wordpress site, and have a widget in the sidebar showing all product categories. It's setup to hide empty categories, and that works well. However, it still shows ...
2
votes
1answer
35 views
Display custom list of tags in post/page editor with hooks
I used the information posted on this blog post to display specific tags when editing a post. The editors on my site wanted the ability to display pre-specified tags instead of the most popular ones. ...
0
votes
1answer
33 views
Hooks - Query about WooCommerce plugin integration to non-compatible theme
I am quite new to WordPress and wish to learn more about hooks and how to use them.
Could anyone point out the necessary hooks in this page.php code to replace the markup in the following WooCommerce ...
0
votes
1answer
24 views
How to return hook data when multiple parameters are present?
What is the proper way of returning data to a hook when there is more than one parameter present?
Example
apply_filters('image_downsize', false, $attachment->ID, $size)
Attaching a callback ...
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 ...
0
votes
0answers
15 views
Lightbox Post Pop-up on homepage [duplicate]
I've been working on sampression lite theme and what I want to achieve is when a post' thumbnail/read more link on homepage is clicked, a modal will pop-up ( similar to pinterest and this wp theme ...
0
votes
0answers
16 views
Creating a new post every time an image is uploaded
I'm making this question because the one I found by searching seems not to work.
I have a custom post type project on my theme. When I upload an image via the media library in the wordpress backend I ...
0
votes
1answer
410 views
How do I implement the Wordpress Iris picker into my plugin on the front-end?
This question here is asking the same question as I am, but there were no adequate answers nor a selected correct answer so I am asking again hoping if I ask in a more coherent manner I might get a ...
1
vote
1answer
40 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
32 views
How do I handle multiple Submit buttons in plugin's option page?
I'm developing my first plugin for WordPress and I'm getting a grasp of the whole hook system. I'm now stuck on a (probably) small issue, that I could possibly circumvent, but I'm afraid of coming out ...
0
votes
2answers
569 views
How to use a WooCommerce action hook?
I am wondering how you would implement the following hook.
do_action( 'woocommerce_process_product_meta_' . $product_type, $post_id );
What is the correct way to call a call the action from a ...
0
votes
2answers
22 views
prepopulate form from a hook within wordpress function.php file
I have a form that I created by simply using the HTML editor in the wp-admin backend for a page. I have some variables in a hook for that page, I would like to pre-populate some of the form fields ...
1
vote
0answers
30 views
Show message in media-new.php
I'm wondering if there's a way to show a specific message when user uploads a file using the wp-admin/media-new.php script.
So far I have this:
function my_uploads_notice(){
global $pagenow;
...
0
votes
1answer
148 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 = ...
0
votes
1answer
171 views
How do I change TinyMCE button “i” to create a i tag rather than em?
I want to give the "italic" button back the "styling" behaviour, rather than the spammy <em>. I want that button to print a <i> tag, rather than <em>.
<em> tags became popular ...
0
votes
1answer
86 views
Include WooCommerce 2's prettyphoto scripts on all site pages
So when WooCommerce updated to version 2 they replaced the fancybox lightbox scripts with prettyphoto. I would like to use this on all my wordpress site's pages, not just the product pages, but the ...
0
votes
1answer
34 views
Why enqueue styles on hook
Why do we need to enqueue styles on a hook, why not just enqueue them straight in like this?
wp_enqueue_style( $handle, $src);
the codex page gives an example of using a hook but doesn't explain ...
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 ...
0
votes
1answer
168 views
Redirect back to origin page after using get_delete_post_link()
I need to implement frontend and backend redirection after delete specific post using get_delete_post_link(). Which hook i can use? Any advice would be appreciated.
Something similar to :
<?php ...
0
votes
1answer
117 views
How to use the password_reset hook to validate new password and display error
When a user resets their password via the link in the password reset email, I know I can use the password_reset hook to get the user object and the new password. I want to validate the new password to ...
0
votes
1answer
297 views
Custom posts and get_post_meta in {$post_status}_{$post_type}
I am making a function to parse a .csv file uploaded in a custom field of a custom post. The name of the custom phone and the field's name is plan_information . The problem is when I ...
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 ...
0
votes
0answers
39 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 ...
0
votes
1answer
29 views
Extend WC_Product Class
I'm using Woocommerce, and I want to extend the WC_product class, I tried using
class xxxx extends WC_product { ... }
and hooking it to
add_action('plugins_loaded', 'my_callback', 0);
But using ...
-1
votes
0answers
59 views
How to hook into WooCommerce checkout process?
I need a way to add a hook so when a user completes checkout on WooCommerce, I can grab the user email address and any coupon code used, and do something with some custom PHP code. How do I go about ...
4
votes
4answers
238 views
Import Wordpress XML File from Within Functions.php
I am developing a theme which has a different method of adding in content and so, the default install of Wordpress won't show any content because of this. I was wondering if it is possible to ...
-1
votes
2answers
53 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
2answers
84 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, ...
11
votes
3answers
1k views
Multisite: How to add Custom Blog Options to new blog setup form?
Seems like a simple enough requirement, but I'm struggling:
I want to add an option field to the "Add New Site" -- a simple text option is fine.
How do I do this??
I need to save this custom blog ...
3
votes
1answer
50 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 ...
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
2answers
1k views
Which hook should be used to add an action containing a redirect?
I want to build a plugin that grabs certain url params from the query string to build a new query string for the same page. I'm following the excellent the Professional WordPress Plugin Development ...
0
votes
2answers
108 views
rewrite rule to redirect to the most recent date permalink
I've got an archive that's displayed using a URL on the form www.mysite.ex/mycpt and I need to make a rewrite rule for that URL which redirects to a permalink with the latest date archive, which is on ...
0
votes
1answer
274 views
correct way to call javascript into hook function
function node_wp($post_ID) {
global $post;
$post_title = get_the_title( $post_ID );
$post_url = get_permalink( $post_ID );
$json = array(
'title_post' => $post_title,
...
0
votes
2answers
69 views
gform_after_submission content appears immediately after <body>, not in post body
I have the following function that successfully uses form fields (IDs 13 and 18) from a Gravity Form (ID 18) as parameters within wp_query.
This displays a list of posts with specific taxonomy terms ...
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 ...
0
votes
2answers
52 views
Theme not calling Jquery properly
I am developing a theme and I have called jquery along with other JS files from a theme-enqueue.php file. For some reason only the Jquery file that is hosted on googles servers is adding the theme URL ...
0
votes
1answer
24 views
How can I add a filter to a particular post format?
I have several post formats and I want to use add_filter selectively, applying the filter to some of the post formats but not all. When I do this in my functions.php file it affect all the post ...
0
votes
2answers
73 views
Theme Customizer not loading JS for live preview
I am currently working on adding options to the theme customizer. For the last two hours I have been trying to get the live preview working and I am trying figure out why my theme isn't loading the ...
0
votes
1answer
58 views
Hook to be used when creating a database table
I read the Codex and some other tutorials describing the process of creating a new table for WordPress.
I thing that the steps are pretty straightforward; however, I'm encountering a small problem.
...
1
vote
1answer
65 views
Gravity Forms field entries into wp_query loop
I have a simple function that filters the page content when form (ID 18) is submitted. It simply displays the entry of field (ID 13)...
add_action("gform_after_submission_18", "set_post_content", 10, ...
0
votes
0answers
58 views
custom styling for woocommerce categories
I am using hooks and customizing the template files to use woocommerce. On my products page I want a list of categories along the top like this. I would even settle for a neat list of them where my ...
1
vote
2answers
59 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 ...
0
votes
1answer
49 views
Catch and display error on save_post action
I wrote this function that adds data to an external db every time a custom post called 'event' is created. How can I prevent the save from happening if this function returns an error? At the moment, ...


