00 Day
00 Hour
00 Min
00 Sec

Reply To: Few Developer Questions – Custom Fields

Home Forums HRM Few Developer Questions – Custom Fields Reply To: Few Developer Questions – Custom Fields

#43053
Jay
Participant

Hello @Abdul

You can pass the meta_key through [meta_query]. I’d recommend you to follow the codes on the file ..../wp-erp/includes/functions-people.php line number: 84.

Following codes:

if ( $meta_query ) {
            $sql['join'][] = "LEFT JOIN $pepmeta_tb as people_meta on people.id = people_meta.<code>erp_people_id</code>";

            $meta_key   = isset( $meta_query['meta_key'] ) ? $meta_query['meta_key'] : '';
            $meta_value = isset( $meta_query['meta_value'] ) ? $meta_query['meta_value'] : '';
            $compare    = isset( $meta_query['compare'] ) ? $meta_query['compare'] : '=';

            $sql['where'][] = "AND people_meta.meta_key='$meta_key' and people_meta.meta_value='$meta_value'";
        }

Thanks

Contact Us

Reach out to us for any inquiry

You must enter full name
You must enter email
You must enter message

We received your query

We will reply to you very soon :)