2

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??

1

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() )
    return;

// Get user data
get_currentuserinfo();
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.

2
  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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