WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am creating a real estate site where user info is essential part. The author info need to display under their post so that the visitor know how to contact them. Thus, the contact info in profile page is an essential part that the author must be filled.

So I like to know is there anyway to force author to complete the profile information before they can publish a post??

share|improve this question

That´s just a quick sketch. You´ll have to search up the functions yourself and complete the code:

// don´t add on front page
if ( ! is_admin() )

// Get user data
global $current_user;

// Search what keys you need to be filled
echo '<pre>'; 
    print_r( $current_user );
echo '</pre>';

// Check the field
if ( ! $current_user->foo )
    // deny
if ( empty( $current_user->foo ) )
    // deny
if ( ! isset( $current_user->foo ) )
    // deny

Then take a look at this code on how to prevent publishing.

share|improve this answer
ok thanks....will take a look at it – dev-jim Apr 25 '12 at 3:21
after one day of scratching my head...I still unable to find the solution. I have no clue how to start. I am not a programmer and I am new in WP...more advice will be appreciated. – dev-jim Apr 25 '12 at 18:40
How about editing your Q and showing what you did so far? – kaiser Apr 25 '12 at 18:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.