Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action('wp', function() {
- if( is_author() ) {
- global $authordata;
- $user_ip = $_SERVER['REMOTE_ADDR'];
- $meta = get_user_meta( $curauth->ID, 'wcpf-count', TRUE );
- $meta = '' !== $meta ? explode( ',', $meta ) : array();
- $meta = array_filter( array_unique( $meta ) );
- if( ! in_array( $user_ip, $meta ) ) {
- array_push( $meta, $user_ip );
- update_user_meta( $curauth->ID, 'wcpf-count', '1' );
- } } });
Add Comment
Please, Sign In to add comment