MC4WP_API_v3_Client::__construct ( string $api_key )

Constructor

Source file: api/class-api-v3-client.php

View source


Parameters

$api_key

(string) (Required)


Uses


Source

    public function __construct( $api_key ) {
        $this->api_key = $api_key;

        $dash_position = strpos( $api_key, '-' );
        if( $dash_position !== false ) {
            $this->api_url = str_replace( '//api.', '//' . substr( $api_key, $dash_position + 1 ) . ".api.", $this->api_url );
        }
    }


User Contributed Notes

You must log in before being able to contribute a note.