# Helpers Functions

Weglot plugin is exposing functions that can be called in your code.

To see the source code of all available functions, you can go to the file : **weglot-functions.php.**

{% hint style="warning" %}
Make sure your plugin's version is > 3.0
{% endhint %}

### weglot\_get\_service

```php
weglot_get_service( string $service )
```

Return a Weglot service.

### weglot\_get\_options

```php
weglot_get_options()
```

Return all Weglot options.

### weglot\_get\_option

```php
weglot_get_option( string $key )
```

Return Weglot option by key.

### weglot\_get\_original\_language

```php
weglot_get_original_language()
```

Return the original language key (string of 2 characters).&#x20;

### weglot\_get\_current\_language

```php
weglot_get_current_language()
```

Return the current language key (2-le).&#x20;

### weglot\_get\_destination\_languages

```php
weglot_get_destination_languages()
```

Return an array of public destination language keys.

### weglot\_get\_request\_url\_service

```php
weglot_get_request_url_service()
```

Return weglot request URL service.

### weglot\_get\_languages\_available

```php
weglot_get_languages_available()
```

Return an array of all languages objects available.

### weglot\_get\_button\_selector\_html

```php
weglot_get_button_selector_html( string $add_class = '' )
```

Return the language's selector button HTML in string format.

### weglot\_get\_exclude\_urls

```php
weglot_get_exclude_urls()
```

Return an array of all excluded URLs.

### &#x20;weglot\_get\_translate\_amp\_translation

```php
weglot_get_translate_amp_translation()
```

Return `true` if amp pages translation is activated.&#x20;

### weglot\_get\_current\_full\_url

```php
weglot_get_current_full_url()
```

Return a string of current URL.

### weglot\_is\_eligible\_url

```php
weglot_is_eligible_url( string $url )
```

Return `true` if `$url` is an eligible URL.

### weglot\_get\_api\_key

```php
weglot_get_api_key()
```

Return a string of private API key.

### weglot\_has\_auto\_redirect

```php
weglot_has_auto_redirect()
```

Return `true` if redirect users based on their browser language option is activated.

### weglot\_get\_full\_url\_no\_language

```php
weglot_get_full_url_no_language()
```

Return a string of current URL without the language key

### weglot\_get\_rest\_current\_url\_path

```php
weglot_get_rest_current_url_path()
```

Return a string of rest current URL path.&#x20;

##


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.weglot.com/wordpress/helpers-functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
