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.6 4.7.7 4.7.8 4.7.9 4.8.0 4.9.0 4.9.1 5.0.1 5.0.2 5.1.1 5.1.2 5.1.3 5.2.0 5.2.1 5.3.2 5.3.3.1 5.3.4 5.3.5 5.3.6 5.3.7
woocommerce-multilingual / addons / wpml-dependencies / vendor / wpml / core-api / README.md
woocommerce-multilingual / addons / wpml-dependencies / vendor / wpml / core-api Last commit date
core 1 month ago vendor-bin 2 months ago README.md 4 years ago
README.md
480 lines
1 # WPML Core API
2
3 ## Table of Contents
4
5 * [IfOriginalPost](#iforiginalpost)
6 * [getTranslations](#gettranslations)
7 * [getTranslationIds](#gettranslationids)
8 * [Languages](#languages)
9 * [getActive](#getactive)
10 * [getFlagUrl](#getflagurl)
11 * [withFlags](#withflags)
12 * [getAll](#getall)
13 * [PostTranslations](#posttranslations)
14 * [setAsSource](#setassource)
15 * [setAsTranslationOf](#setastranslationof)
16 * [get](#get)
17 * [getIfOriginal](#getiforiginal)
18 * [Translations](#translations)
19 * [setLanguage](#setlanguage)
20 * [setAsSource](#setassource-1)
21 * [setAsTranslationOf](#setastranslationof-1)
22 * [get](#get-1)
23 * [getIfOriginal](#getiforiginal-1)
24 * [isOriginal](#isoriginal)
25
26 ## IfOriginalPost
27
28
29
30
31
32 * Full name: \WPML\Element\API\IfOriginalPost
33
34
35 ### getTranslations
36
37 Gets the element details for the translations of the given post id.
38
39 ```php
40 IfOriginalPost::getTranslations( integer $id = null ): \WPML\Collect\Support\Collection|callable
41 ```
42
43 Returns an empty array if the id is not an original post.
44
45 element details structure:
46 ```php
47 (object) [
48 'original' => false, // bool True if the element is the original, false if a translation
49 'element_id' => 123, // int The element id
50 'source_language_code' => 'en', // string The source language code
51 'language_code' => 'de', // string The language of the element
52 'trid' => 456, // int The translation id that links translations to source.
53 ]
54 ```
55
56 * This method is **static**.
57 **Parameters:**
58
59 | Parameter | Type | Description |
60 |-----------|------|-------------|
61 | `$id` | **integer** | The post id. Optional. If missing then returns a callable waiting for the id. |
62
63
64
65
66 ---
67
68 ### getTranslationIds
69
70 Get the element ids for the translations of the given post id.
71
72 ```php
73 IfOriginalPost::getTranslationIds( integer $id = null ): \WPML\Collect\Support\Collection|callable
74 ```
75
76 Returns an empty array if the id is not an original post.
77
78 * This method is **static**.
79 **Parameters:**
80
81 | Parameter | Type | Description |
82 |-----------|------|-------------|
83 | `$id` | **integer** | The post id. Optional. If missing then returns a callable waiting for the id. |
84
85
86
87
88 ---
89
90 ## Languages
91
92
93
94
95
96 * Full name: \WPML\Element\API\Languages
97
98
99 ### getActive
100
101
102
103 ```php
104 Languages::getActive( ): array
105 ```
106
107 It returns an array of the active languages.
108
109 The returned array is indexed by language code and every element has the following structure:
110 ```
111 'fr' => [
112 'code' => 'fr',
113 'id' => 3,
114 'english_name' => 'French',
115 'native_name' => 'Français',
116 'major' => 1,
117 'default_locale' => 'fr_FR',
118 'encode_url' => 0,
119 'tag' => 'fr ,
120 'display_name' => 'French
121 ]
122 ```
123
124 * This method is **static**.
125
126
127
128 ---
129
130 ### getFlagUrl
131
132
133
134 ```php
135 Languages::getFlagUrl( mixed $...$code ): callable|string
136 ```
137
138 - Curried :: string → string
139
140 Gets the flag url for the given language code.
141
142 * This method is **static**.
143 **Parameters:**
144
145 | Parameter | Type | Description |
146 |-----------|------|-------------|
147 | `$...$code` | **mixed** | |
148
149
150
151
152 ---
153
154 ### withFlags
155
156
157
158 ```php
159 Languages::withFlags( mixed $...$langs ): callable|array
160 ```
161
162 - Curried :: [code => lang] → [code => lang]
163
164 Adds the language flag url to the array of languages.
165
166 * This method is **static**.
167 **Parameters:**
168
169 | Parameter | Type | Description |
170 |-----------|------|-------------|
171 | `$...$langs` | **mixed** | |
172
173
174
175
176 ---
177
178 ### getAll
179
180
181
182 ```php
183 Languages::getAll( ): callable|array
184 ```
185
186 void → [lang]
187
188 It returns an array of the all the languages.
189
190 The returned array is indexed by language code and every element has the following structure:
191 ```
192 'fr' => [
193 'code' => 'fr',
194 'id' => 3,
195 'english_name' => 'French',
196 'native_name' => 'Français',
197 'major' => 1,
198 'default_locale' => 'fr_FR',
199 'encode_url' => 0,
200 'tag' => 'fr ,
201 'display_name' => 'French
202 ]
203 ```
204
205 * This method is **static**.
206
207
208
209 ---
210
211 ## PostTranslations
212
213 Class PostTranslations
214
215
216
217 * Full name: \WPML\Element\API\PostTranslations
218
219
220 ### setAsSource
221
222
223
224 ```php
225 PostTranslations::setAsSource( mixed $...$el_id, mixed $...$language_code ): callable|integer
226 ```
227
228 - Curried :: int → string → void
229
230 * This method is **static**.
231 **Parameters:**
232
233 | Parameter | Type | Description |
234 |-----------|------|-------------|
235 | `$...$el_id` | **mixed** | |
236 | `$...$language_code` | **mixed** | |
237
238
239
240
241 ---
242
243 ### setAsTranslationOf
244
245
246
247 ```php
248 PostTranslations::setAsTranslationOf( mixed $...$el_id, mixed $...$translated_id, mixed $...$language_code ): callable|integer
249 ```
250
251
252
253 * This method is **static**.
254 **Parameters:**
255
256 | Parameter | Type | Description |
257 |-----------|------|-------------|
258 | `$...$el_id` | **mixed** | |
259 | `$...$translated_id` | **mixed** | |
260 | `$...$language_code` | **mixed** | |
261
262
263
264
265 ---
266
267 ### get
268
269
270
271 ```php
272 PostTranslations::get( mixed $...$el_id ): callable|array
273 ```
274
275 - Curried :: int → [object]
276
277 * This method is **static**.
278 **Parameters:**
279
280 | Parameter | Type | Description |
281 |-----------|------|-------------|
282 | `$...$el_id` | **mixed** | |
283
284
285
286
287 ---
288
289 ### getIfOriginal
290
291
292
293 ```php
294 PostTranslations::getIfOriginal( mixed $...$el_id ): callable|array
295 ```
296
297 - Curried :: int → [object]
298
299 * This method is **static**.
300 **Parameters:**
301
302 | Parameter | Type | Description |
303 |-----------|------|-------------|
304 | `$...$el_id` | **mixed** | |
305
306
307
308
309 ---
310
311 ## Translations
312
313 Class Translations
314
315
316
317 * Full name: \WPML\Element\API\Translations
318
319
320 ### setLanguage
321
322
323
324 ```php
325 Translations::setLanguage( mixed $...$el_id, mixed $...$el_type, mixed $...$trid, mixed $...$language_code, mixed $...$src_language_code, mixed $...$check_duplicates ): callable|integer
326 ```
327
328 - Curried :: int → string → int|null → string → string → string|null → bool → bool|int|null|string
329
330 Wrapper function for SitePress::set_element_language_details
331
332 - int $el_id the element's ID (for terms we use the `term_taxonomy_id`)
333 - string $el_type
334 - int $trid
335 - string $language_code
336 - null|string $src_language_code
337 - bool $check_duplicates
338
339 returns bool|int|null|string
340
341 * This method is **static**.
342 **Parameters:**
343
344 | Parameter | Type | Description |
345 |-----------|------|-------------|
346 | `$...$el_id` | **mixed** | |
347 | `$...$el_type` | **mixed** | |
348 | `$...$trid` | **mixed** | |
349 | `$...$language_code` | **mixed** | |
350 | `$...$src_language_code` | **mixed** | |
351 | `$...$check_duplicates` | **mixed** | |
352
353
354
355
356 ---
357
358 ### setAsSource
359
360
361
362 ```php
363 Translations::setAsSource( mixed $...$el_id, mixed $...$el_type, mixed $...$language_code ): callable|integer
364 ```
365
366
367
368 * This method is **static**.
369 **Parameters:**
370
371 | Parameter | Type | Description |
372 |-----------|------|-------------|
373 | `$...$el_id` | **mixed** | |
374 | `$...$el_type` | **mixed** | |
375 | `$...$language_code` | **mixed** | |
376
377
378
379
380 ---
381
382 ### setAsTranslationOf
383
384
385
386 ```php
387 Translations::setAsTranslationOf( mixed $...$el_id, mixed $...$el_type, mixed $...$translated_id, mixed $...$language_code ): callable|integer
388 ```
389
390
391
392 * This method is **static**.
393 **Parameters:**
394
395 | Parameter | Type | Description |
396 |-----------|------|-------------|
397 | `$...$el_id` | **mixed** | |
398 | `$...$el_type` | **mixed** | |
399 | `$...$translated_id` | **mixed** | |
400 | `$...$language_code` | **mixed** | |
401
402
403
404
405 ---
406
407 ### get
408
409
410
411 ```php
412 Translations::get( mixed $...$el_id, mixed $...$el_type ): callable|array
413 ```
414
415
416
417 * This method is **static**.
418 **Parameters:**
419
420 | Parameter | Type | Description |
421 |-----------|------|-------------|
422 | `$...$el_id` | **mixed** | |
423 | `$...$el_type` | **mixed** | |
424
425
426
427
428 ---
429
430 ### getIfOriginal
431
432
433
434 ```php
435 Translations::getIfOriginal( mixed $...$el_id, mixed $...$el_type ): callable|array
436 ```
437
438
439
440 * This method is **static**.
441 **Parameters:**
442
443 | Parameter | Type | Description |
444 |-----------|------|-------------|
445 | `$...$el_id` | **mixed** | |
446 | `$...$el_type` | **mixed** | |
447
448
449
450
451 ---
452
453 ### isOriginal
454
455
456
457 ```php
458 Translations::isOriginal( mixed $...$el_id, mixed $...$translations ): callable|boolean
459 ```
460
461
462
463 * This method is **static**.
464 **Parameters:**
465
466 | Parameter | Type | Description |
467 |-----------|------|-------------|
468 | `$...$el_id` | **mixed** | |
469 | `$...$translations` | **mixed** | |
470
471
472
473
474 ---
475
476
477
478 --------
479 > This document was automatically generated from source code comments on 2020-06-28 using [phpDocumentor](http://www.phpdoc.org/) and [cvuorinen/phpdoc-markdown-public](https://github.com/cvuorinen/phpdoc-markdown-public)
480