Author must complete profile info before they can publish a post?

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

Related posts

Leave a Reply

1 comment

  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.