Documentation

ajax_add_term_transl.php

\file \brief Add a translation to term.

Call: inc/ajax_add_term_transl.php

Tags
author

LWT Project lwt-project@hotmail.com

license

Unlicense http://unlicense.org/

link
https://hugofara.github.io/lwt/docs/php/files/inc-ajax-add-term-transl.html
since
1.5.0

Table of Contents

Functions

add_new_term_transl()  : array<string|int, int|string>|string
Add the translation for a new term.
edit_term_transl()  : string
Edit the translation for an existing term.
do_ajax_check_update_translation()  : string
Edit term translation if it exists.
do_ajax_add_term_transl()  : string
Add or edit a term translation.

Functions

add_new_term_transl()

Add the translation for a new term.

add_new_term_transl(string $text, int $lang, string $data) : array<string|int, int|string>|string
Parameters
$text : string

Associated text

$lang : int

Language ID

$data : string

Translation

Tags
global

string $tbpref Database table prefix

since
2.9.0

Error messages are much more explicit

since
2.9.0

Return an array

psalm-return

list{int, string}|string

Return values
array<string|int, int|string>|string

[new word ID, lowercase $text] if success, error message otherwise

edit_term_transl()

Edit the translation for an existing term.

edit_term_transl(int $wid, string $new_trans) : string
Parameters
$wid : int

Word ID

$new_trans : string

New translation

Tags
global

string $tbpref Database table prefix

Return values
string

WoTextLC, lowercase version of the word

do_ajax_check_update_translation()

Edit term translation if it exists.

do_ajax_check_update_translation(int $wid, string $new_trans) : string
Parameters
$wid : int

Word ID

$new_trans : string

New translation

Tags
global

string $tbpref

Return values
string

Term in lower case, or error message if term does not exist

do_ajax_add_term_transl()

Add or edit a term translation.

do_ajax_add_term_transl(int $wid, string $data) : string
Parameters
$wid : int

Word ID

$data : string

Translation

Tags
deprecated

Deprecated in 2.9.0 in favor to the REST API.

Return values
string

Database alteration message


        
On this page

Search results