Method by which plugins and themes extend core WordPress functionality.

learn more… | top users | synonyms

0
votes
0answers
14 views

How to modify core when there is no hook?

I want to add a custom HTML5 attribute to the <form> element in the comments form. Since the form field itself is generated by comment_form(), and there is no hook to edit within the opening ...
0
votes
1answer
462 views

get_post_meta not working inside a function in functions.php but works outside

function notify_new_posts($post_id) { $keyval = get_post_meta( $post_id); $buyer_wdistance = get_post_meta( $post_id, 'cf_wdrive'); //$buyer_wdistance = $keyval['cf_wdrive'][0]; ...
1
vote
1answer
26 views

Why does wp_enqueue_style() in plugin not load stylesheet?

I'm trying to load a custom stylesheet (for the front-end, not admin area) via plugin. As near as I can tell, I'm doing things the way the Codex says is correct, but my CSS doesn't get loaded. This ...
0
votes
1answer
14 views

WooCommerce comments_template Filter Not Firing

I have a template file that is being called via wp_ajax that returns data from a specific WooCommerce product. In the "tabs" section of the template file every tab is working fine: Description - ...
0
votes
1answer
22 views

Modify a plugin's content

I'm using Mooberry Book Manager which has a hook in it's grid mbdb_book_grid_after_link I've created a plug in so that I can show additional content in the grid, it's very basic <?php /* Plugin ...
2
votes
1answer
647 views

save_post hook not triggered in WP v3.6.1

I developed a plugin having a custom metabox that is using the save_post hook to store data. The plugin is 18 months old and is used by thousands of customers, so I'm pretty sure everything is good. ...
0
votes
1answer
604 views

Insert new user with form submit 'init' hook

I'm posting a form to insert a new user and hooking my function to 'init'. This code is in my mu-plugins folder. The user gets inserted fine, but the page is not loaded after wards. My form action ...
1
vote
0answers
28 views

wp cron job fires at every second or so, if callback is wrapped with DOING_CRON check it never fires at all

I am a bit lost while dealing with a open source plugin implementing wp cron. You can read about the problem on github https://github.com/nekojira/wp-currencies/issues/6#issuecomment-116735909 - I ...
0
votes
2answers
48 views

Knowing if a post is sticky in the 'save_post' action. Where do I have to hook?

I'm using this plugin (FantasticElasticSearch) to index content when it's published. So far it was strightforward and an easy task but, now that I tried to index a flag saying if a post is sticky, I'm ...
0
votes
2answers
46 views

Trying to send AJAX data to WordPress hook

I'm trying to send jQuery data via AJAX to a WordPress template file. I've tried several different techniques and solutions based on other questions posted that pertain to this topic, with no ...
30
votes
9answers
6k views

Where can I find a list of WordPress hooks?

Where can I find a list of all the WordPress hooks and over-ridable functions (pluggable, scriptable, etc)? Edit: Plugin is listed here.
1
vote
1answer
39 views

Issue adding text after short description on product pages Woocommerce

I am trying to add some text after the short description on woocommerce. I have come up with the following add action but when I use it, it replaces the existing short description text. Is there a ...
6
votes
3answers
2k views

How to get WordPress' hook run sequence?

What is WordPress' hooks execution sequence? I mean, I want to know the order, how add_action hooks are executed, i.e. init wp_head wp_footer after_theme_setup and etc.. I want to know the ...
0
votes
2answers
28 views

Which hook runs first(init,… or ???) [duplicate]

For example,any "naked" code, i.e.: IF ($_POST) then...., runs directly, before any WP action. for example, this runs later (even with point 1): add_action('init','my_function',1); I want to ...
11
votes
1answer
7k views

how to limit search to post titles?

Is there a way to limit search to post titles? I know I can modify query.php core file but there must be a way to do it with hooks right? Thanks in advance!
0
votes
1answer
18 views

What is the action or filter for changing permalink in Edit Post/Page?

I know about edit_form_after_title hook but what about changing the permalink. How does WordPress creates permalink because that permalink and the one that get_the_permalink returns doesn't match? ...
-1
votes
1answer
15 views

add_filter to 'woocommerce_before_main_content'

I added a filter in functions.php and change priority very high and low to 1 but every time the parameter is an empty string""; add_filter( 'woocommerce_before_main_content','wc_start_layout'); ...
1
vote
2answers
444 views

How to use the 'comments_number' filter?

I'm not sure how to use this filter. Could someone show me an example? I'm trying to change ('0', '1', '%') to ('0 Comments', '1 Comment', '% Comments'). I'm using this function to get the comments ...
0
votes
1answer
19 views

hook that when page is strating to load

I want to create a page loading message based on php when the wp page is starting to load. is there a hook about it? simply like opposite of wp_loaded? wp_loaded is after the page is fully loaded, I ...
0
votes
1answer
724 views

wp_trash_post action hook with custom post type

When a 'contact' cpt post is trashed, i need a metakey from another cpt 'act' to be deleted, i have been searching all over which hook i should use but unfortunatly the codex action reference page is ...
0
votes
1answer
356 views

Add content after get_header

I'd like to add content directly after the div#main (end of header.php) and before /div#main (beginning of footer.php). I'm using an own child-template (of twentythirteen), that contains only ...
0
votes
1answer
401 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 = ...
6
votes
1answer
47 views

Hook that get's triggered when the author of a post is changed

Is there any hook that gets trigged when the author of a post is modified from the edit post screen? I can list to the update post hook, but then I will not know whether the author of the post was ...
1
vote
1answer
80 views

Plugin development, hooks, generate content

I'm building my first plugin. This plugin will activate a theme, set up a default front page, register tax. / cpt, and create some content. (cpt = custom post types) I made it work all this in ...
0
votes
1answer
25 views

Post formating on Home page

I've simple question regarding WordPress post looping. I want to achieve something like this on my site: ~ I am running Real estate portal site and I want to display featured property on my home ...
0
votes
2answers
34 views

My add_action (wp_footer, 'method') is not calling?

In my themes functions.php file I have put: add_action('wp_footer', 'method'); function method() { echo "this is being called"; die(); } My wordpress footer.php file looks like this: <?php ...
6
votes
2answers
86 views

Better to fire specific hooks or generic hooks with parameters?

I'm creating a form plugin to handle forms that can be hooked into using actions/filters by developers. My plug-in needs to be able to handle different forms with different sets of filters and I see ...
0
votes
0answers
20 views

Trigger jQuery event with WordPress hook

I'm looking to fire a custom jQuery event after a user submits a comment but I can't quite grasp how to do that within the PHP code. I'm using the comment_post hook: add_action('comment_post', ...
5
votes
1answer
66 views

switch_to_blog(): Load textdomain

I am using the WordPress multisite feature with Multilingual Press Pro to create a multilingual site with linked posts. In a network activated plugin the custom post types are registered. For ...
0
votes
0answers
12 views

Checking login status before wp_get_current_user is initialised

I am building a theme switcher, that needs to block access to not logged in and subscriber users. Problem is that this has to be done in a function that is called at the "setup_theme" phase/hook, and ...
0
votes
0answers
17 views

how to remove sidebar on single post- and sub-pages using hooks/actions (Omega theme by Themehall

I've created a child theme from the 'Omega' parent theme by Themehall. I'm trying to remove the sidebar on all single post pages and sub pages of my blog and instead have a single full-width column ...
3
votes
3answers
1k views

How to Debug the 'save_post' Action?

Is it possible to validate PHP code? I have a Custom Post Type (Film) with Custom Meta Boxes. Everything is working fine, I can add new Films and details to the Custom Meta Boxes. My problem is ...
0
votes
0answers
9 views

Filter to set a variable once a post is populated?

I'm working on a playlists plugin. The playlists are just custom post types; and they have extra properties I need to populate once a 'playlist' post is loaded. So the idea would be to have a ...
0
votes
1answer
1k views

using wp_footer hook in a plugin

I'm using the wp_footer hook into the plugin and it doesn't work, but when I copy the code to the "functions.php" file of the active theme it does work, what is the possible problem in this situation ...
2
votes
1answer
66 views

Schedule WordPress Auto-Updates to only run during business hours

We've turned on WordPress Auto-Updates (yey!), but, just in case this does break anything, we'd like to only run Auto-Updates during daylight hours (e.g. 09:00 - 17:30). We have the "on init" WP-Cron ...
0
votes
1answer
5 views

Conditional for autosave or auto draft?

I am attempting to create a file using fopen() on save_post. I am having trouble finding the right condtionals to prevent the the file from being created from an auto save. I only want to create the ...
0
votes
1answer
18 views

How to know what filter to use and how to use it?

How can I know what filter I can use to change anything and what my function have to return ? For exemple, sometimes I have to add a or a to a post title. It works (WP doesn't sanitize html tag ...
1
vote
1answer
21 views

Plugin options, presets and filters : can you help me improve my workflow?

I'm building a plugin and I have hard time handling options on it. I already did try several ways but I think i'm stuck on a structural problem here. I would like to have your input on all of this ...
1
vote
1answer
35 views

How to replace a function using a child theme?

I have the following function where I would like to replace the image nopic.jpg I have updated by deleting some redundant options. if ( ! function_exists( 'TaskerDev_get_first_post_image_fnc' ) ...
0
votes
1answer
371 views

save_post not working with attachments

I've made a Meta Box for Posts and Pages, and while testing added Attachments too. But, curiously, the hook save_post does not fire. $cpts = apply_filters( 'my_filter', array( 'post', 'page' ) ); // ...
0
votes
3answers
641 views

What is the action hook that deletes a taxonomy term from the backend? And how to retireve the term id before deleting it?

I need to delete some postmeta when deleting taxonomy terms from the backend. Before deleting the term, I need to retrieve the postmeta's meka_key and the term id that is going to be deleted. Use the ...
2
votes
3answers
679 views

Wordpress auto login after registration not working

So I looked up a bunch of threads trying to figure out how to automatically log a user in after registration, and came up with this. function log_me_the_f_in( $user_id ) { $user = ...
0
votes
0answers
22 views

Hook on Publishing a Post Doesn't Fire Correctly (or so I think)

Currently, I'm trying to send out a Push Notification to iPhone every time a blog post is published on my WordPress website. I am using a PHP script to send out the push notification (which works with ...
0
votes
3answers
1k views

How do I add some javascript validation to the admin interface form's onsubmit?

I have a plugin that adds meta boxes to the admin interface and I need to do some validation when the user presses the "update" button before the form is submitted. Is there a WordPress action or ...
0
votes
2answers
539 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 ...
1
vote
3answers
486 views

How do I display only the latest post on my home page, while maintaining proper plugin hooks?

What I'm trying to do is display the most recent post (a la my theme's "single.php") on my "home" page. This is complicated by the fact that I have certain plugins (specifically, Scripts n Styles) ...
0
votes
1answer
34 views

Modifying date filter on admin page for custom post type to link to custom field

Apologies if a similar question has already been asked, but I can't seem to find the exact functionality I am looking for. Basically I have a custom post type (sermons) which has 'recorded_date' as ...
0
votes
1answer
86 views

Edit admin post page

I have to customize the admin page where you edit the other pages "wp-admin/post.php". I have to add a lot of things, and delete others, change colors and add a custom menu to the top. I don't know ...
1
vote
1answer
30 views

Filter for Admin Nav Menus Drop Down

In short, is there a filter for the Admin Panels Nav-Menu Dropdown List? For non-administrators I need to remove access to modifying / selecting a specific menu but still allow access to other ...
1
vote
1answer
29 views

Hook for when a page template is changed

I know that you can remove the editor section of the page editor page ( :/) depending on the template chosen using add_action( 'load-page.php', 'hide_editor_function' ); (with proper functionality of ...