parse_db_host($host); } else { // Backward compatibility for WP 4.7 and 4.8 $port = 3306; $socket = null; // Peel off the port parameter if (preg_match('/(?=:\d+$)/', $host)) { list($host, $port) = explode(':', $host); } // Peel off the socket parameter if (preg_match('/:\//', $host)) { list($host, $socket) = explode(':', $host); } return [$host, $port, $socket, false]; } } /** * @param string|null $type * @param string|null $permission * @return object */ function wpCountPosts($type = null, $permission = null) { return wp_count_posts($type, $permission); } }