Method by which plugins and themes extend core WordPress functionality.

learn more… | top users | synonyms

0
votes
3answers
93 views

How to hook into publish_posttype?

I'm trying to hook into WordPress publish. The code below is what I'm using, but it doesn't appear to be running. I have it in a plugin file that I deactivate/reactivate each time I make changes ...
2
votes
2answers
29 views

What hook is executed just after wp_query has been executed?

What hook is executed just after wp_query has been executed? before template is rendered? I want to change the page title but it depends on what has been queried. I have put it in template_redirect ...
2
votes
2answers
147 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
2answers
49 views

Adding a form at the end of the content

I'm trying to add a little form after each post for a plugin I have to code, but I'm not very familiar with Wordpress. By using add_action with the_content as hook, I was able to add some text to the ...
1
vote
2answers
135 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
2answers
104 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
88 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 ...
0
votes
2answers
24 views

How to change value of $menu_class in ep_nav_menu?

How can i change value of $menu_class parameter in wp_nav_menu() so that I can give a special css class to one of items in menu for example "Home"? here is some code but they didn't show me the ...
0
votes
2answers
265 views

How to pass hook variable to function?

I have a function that has an add_action inside it that calls the user_register hook. I would like to be able to echo the variable $user_id from the user_register hook and the $_POST array as well. ...
0
votes
2answers
75 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 ...
0
votes
2answers
253 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
124 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
142 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
1answer
51 views

Change event firing in wordpress

I have to run a function when a post is published. The function checks a custom meta value and works accordingly. I am using couple of hooks for this purpose: new_to_publish draft_to_publish ...
0
votes
1answer
51 views

Getting all post/page IDs related to a soon-to-be-deleted tag/cat

When deleting a tag, category or other term I would like to get the IDs of the posts that are related to the term before deletion. Wordpress uses wp_delete_term, which is found in taxonomy.php, to ...
0
votes
1answer
266 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 ...
0
votes
1answer
81 views

Hooking get_posts()

On a site this is a plugin that uses get_posts() to make a list of pages. The list is used to create a list of pages and create next page and previous page links. ( ...
0
votes
1answer
366 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 ...
0
votes
1answer
85 views

What filter or action to replace comments or add new comment system

I am looking to make a plugin for my site, which either replaces the current comments in a post or adds an additional comment system. I am getting the comments from a custom RSS feed from my forum ...
0
votes
1answer
433 views

List posts based on First letter of Posts

I want add a Pagination [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] .......[Z] Easy Post Title - By Admin on 2013 post content....bla bla bla... Example Post - Another Test ...
0
votes
1answer
36 views

How to make plugin work in each template in wordpress

I am new to plugin development .I want to get all images of a particular page/post and want to show them as slideshow below the page ..Currently i am able to gather all images in media library and ...
0
votes
1answer
50 views

Which hooks are essential for post templates?

Im in the process of building a very custom theme and Im beginning to work on the post templates, but I dont know which hooks are essential for them. So like, I've seen (but cant remember where)some ...
0
votes
1answer
35 views

Meta boxes not showing up

Okay so I'm trying to render a meta box. This is what I have so far, trying to keep it as basic as possible: add_action('load-post.php', 'ad_templates_callback' ); add_action('load-post-new.php', ...
0
votes
1answer
188 views

Incorrect data after modifying post using backlink from wp_die

I have hook: function myHook( $post_ID, $post ) { $data = get_post_meta($post_ID, 'data', true); if ($data) { _log('data:' . $data); /* here some checks and validation */ ...
0
votes
1answer
93 views

How do I replace title with my plugin?

I am developing a plugin for WordPress 3.5. My blog's default title is "Test". Here is some code of my plugin: add_filter('wp_title', 'my_replace_title'); function my_replace_title(){ return ...
0
votes
1answer
79 views

Function is Missing an Action Hook

I have tied an action into a status change, which works on the backend. However,using a frontend button for updating post status does not trigger the ...
0
votes
1answer
106 views

Looking for Hook that is fired after a plugin or wp upgrade is installed/updated

I'm trying to write some code to sms me whenever someone updates/installs a plugin, or updates the WP core, but I can't seem to find a hook that gets fired when this happens. Does anyone know if there ...
0
votes
1answer
307 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
262 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
270 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
66 views

Checking url from plugin

I'm trying to change the login url from wp-login.php to simply 'login'. I'd been looking through another plugins source to find ways of doing it. Some of the applicable parts that I've got so far: ...
-1
votes
1answer
52 views

How can I get the term_id from the action hook 'set_object_terms'?

I have the following code and I want to use the term_id inside that function. I aware that the variable $terms contains the term; however, I do not know how to get the term id from it. ...
-1
votes
1answer
160 views

How to hook wp_mail to add a custom email as BCC for each sent email?

Is there a way to hook into the wp_mail function to add a custom email as hidden (BCC) copy to each email sent? If so, how? -edit- It's not like I want to send an email with BCC, I would like to ...
-1
votes
1answer
377 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 ...
-2
votes
1answer
56 views

How to place plugin hook in a wordpress template

In many WordPress plugins, there are installation directions to add <?php do_action('plugin_name_hook'); ?> in your theme's templates. Where exactly do I need to place this code and what should ...
-2
votes
1answer
58 views

str_replace css meta tag?

I'm trying to modify the css meta tag and make use of a CDN url - and other things. What I have tried (as a quick test) is : function change_stylesheet_loc($uri) { $uri = ...