\DevOwl\RealProductManagerWpClientUtils

Utils functionality.

Summary

Methods
Properties
Constants
startsWith()
isRedirected()
getIpAddress()
getUserFullName()
getCurrentHostname()
mapBlogsToHosts()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

startsWith()

startsWith(string  $haystack,string  $needle)

Check if a string starts with a given needle.

Parameters

string $haystack

The string to search in

string $needle

The starting string

isRedirected()

isRedirected()

Check if the current page request gets redirected.

getIpAddress()

getIpAddress()

Get the IP address of the current request.

getUserFullName()

getUserFullName(\WP_User  $user = null)

Get the full name for the currently logged in user.

Parameters

\WP_User $user

Fall back to current user

getCurrentHostname()

getCurrentHostname(): string

Get current home url, normalized without schema, `www` subdomain and path.

This avoids general conflicts for situations, when customers move their HTTP site to HTTPS.

Returns

string —

Can be empty, e.g. for WP CLI and WP Cronjob when Object Cache is active

mapBlogsToHosts()

mapBlogsToHosts(array<mixed,integer>  $blogIds)

To avoid issues with multisites without own domains, we need to map blog ids to their `site_url`'s host so we can determine the used license for a given blog.

Parameters

array<mixed,integer> $blogIds