Client login with news access credentials

2

Explanation:

I have a customer list in post_type through metaboxes , where the email and password fields exist, and the client name is the_title();

Objective:

I need to login with the email and password fields and check if there is any client (post_type) with these credentials.

Observations:

I have a post_type of news, which when entered are directed to a specific client, that is, when logging, you can only have access to the news directed to the client that is logged in.

    
asked by anonymous 19.02.2014 / 21:40

1 answer

0

/ * Resolution I found: * /

$email = $_POST['email'];
    $senha = $_POST['senha'];

    $args = array(
        'post_type' => 'clientes',
        'meta_query'=> array(
            'relation' => 'AND',
            array(
                'key' => 'email',
                'value' => $email,
                'compare' => '='
            ),
            array(
                'key' => 'senha',
                'value' => $senha,
                'compare' => '='
            )
        )
    );  

    $cliente_args = new WP_Query( $args ); 



/*Buscar noticias que possuem o ID (GET) no metabox; */ 
            $args = array(
                'post_type' => 'noticias',
                'meta_query'=> array(
                    array(
                        'key' => 'clientes',
                        'value' => $_GET['id'],
                        'compare' => '='
                    )
                )
            );  
            $clientes = new WP_Query($args); 
    
21.02.2014 / 15:58