Server IP : 104.21.14.103 / Your IP : 18.191.240.127 Web Server : LiteSpeed System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : giankuin ( 1871) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/giankuin/dietcontrungnhanh.com/wp-content/plugins/ithemes-security-pro/pro/import-export/Import/ |
Upload File : |
<?php namespace iThemesSecurity\Import_Export\Import; final class User_Map { private $explicit_map = []; private $find_matches = true; /** * Sets a map of export user ids to import user ids. * * @param array $map * * @return $this */ public function set_explicit_map( array $map ): self { $this->explicit_map = $map; return $this; } /** * Disables automatically looking for matches based on the user's email address. * * @return $this */ public function disable_finding_matches(): self { $this->find_matches = true; return $this; } /** * Gets the user corresponding to the export's user definition. * * @param array $user * * @return int The mapped user id, or 0. */ public function get_mapped_user( array $user ): int { if ( ! $user ) { return 0; } if ( isset( $this->explicit_map[ $user['id'] ] ) ) { return $this->explicit_map[ $user['id'] ]; } if ( $this->find_matches && $match = get_user_by( 'email', $user['email'] ) ) { return $match->ID; } return 0; } }