Add error message on password protected page

The latest entered password is stored as a secure hash in a cookie named ‘wp-postpass_’ . COOKIEHASH. When the password form is called, that cookie has been validated already by WordPress. So you just have to check if that cookie exists: If it does and the password form is displayed, the password was wrong. add_filter( … Read more

What is an easy way to display a front-end user registration form?

Jeff Starr wrote a great tutorial on front-end registration, login and password recovery taking the similar approach as suggested by onetrickpony. So take this as a follow up to his answer and as another resource that might help you get it done: http://digwp.com/2010/12/login-register-password-code/ Now you have two examples how to code this yourself and trust … Read more

How to handle form submission?

You should use the wp_ajax or the wp_ajax_nopriv function. First of all you should put the the admin ajax url as the action attribute value in the submission form. <form id=”” action=”<?php echo admin_url(‘admin-ajax.php’); ?>” method=”post” class=”form” > That way the the form will be submitted to the admin-ajax.php by default (without JavaScript). You can … Read more

How to edit a user profile on the front end?

You can do that by copy your theme’s page.php to a new file named something like user-profile.php and add to the very top of it this code: <?php /** * Template Name: User Profile * * Allow users to update their profiles from Frontend. * */ /* Get user info. */ global $current_user, $wp_roles; //get_currentuserinfo(); … Read more

How to include landing page with form submission?

Setting a cookie might be the best option. In case the visitor had js disabled, I figured it best to set the cookie in the http header using php. However, it seems that init is the last possible action WordPress will allow a cookie-setting function to hook into, but it fires too early for conditional … Read more

How to define form action in JSF?

The best solution for me is to use the default <button> tag instead. Since typical button styling is not being applied (in my case I am using Primefaces), I set it manually. Here’s the whole result: