Method by which plugins and themes extend core WordPress functionality.

learn more… | top users | synonyms

0
votes
3answers
465 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
3answers
105 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
177 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
211 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 = ...
1
vote
2answers
333 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 ...
1
vote
2answers
50 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
139 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
45 views

How do I hook my function to run only after submitting login form

I'm new to wordpress. I'm writing my first plugin. I don't understand how to have my function run only after submitting the login form while not running every time I refresh the login page. I tried ...
0
votes
2answers
300 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
27 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
129 views

How to hook in to the “output buffer” and add html content

I want to be able to hook into the output buffer flow and add some conditional content to my WP pages. What I want to do is test cookies and display a semi-transparent screen with a content box based ...
0
votes
2answers
103 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
406 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
votes
2answers
419 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. ...
-2
votes
1answer
66 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 = ...