/home/techb158/primomovers.ca/wp-content/plugins/polylang-pro/modules/Machine_Translation
NameSizeModeActions
Clients/-0755rm
css/-0755rm
js/-0755rm
Services/-0755rm
Settings/-0755rm
Action.php53050644editdlrm
Button.php19080644editdlrm
Button_REST.php24740644editdlrm
Data.php28520644editdlrm
error_log144900644editdlrm
Factory.php29410644editdlrm
load.php14540644editdlrm
Module_Settings.php40470644editdlrm
Processor.php35310644editdlrm
uninstall.php1560644editdlrm
Edit: /home/techb158/primomovers.ca/wp-content/plugins/polylang-pro/modules/Machine_Translation/Data.php (2852B)
> */ private $translations = array(); /** * Adds a source string to exported data and optionally a pre-existing translated one. * * @todo What should we do for encoding? * * @since 3.6 * * @param array $ref { * Array containing the content type and optionally the corresponding object ID. * * @type string $object_type Object type to be exported (e.g. `post` or `term`). * @type string $field_type Field type to be exported (e.g. `post_content`, `post_title`...). * @type int $object_id A unique identifier to retrieve the corresponding object from the database. * @type string $field_id Optional, a unique identifier to retrieve the corresponding field from the database. * @type string $encoding Optional, encoding format for the field group. * } * @param string $source The source to be translated. * @param string $target Optional, a preexisting translation, if any. * @return void * * @phpstan-param translationEntryRef $ref * @phpstan-param non-empty-string $source */ public function add_translation_entry( array $ref, string $source, string $target = '' ) { if ( ! $this->are_entry_parameters_valid( $ref, $source ) ) { return; } if ( ! isset( $this->translations[ $ref['object_type'] ] ) ) { $this->translations[ $ref['object_type'] ] = array(); } if ( ! isset( $this->translations[ $ref['object_type'] ][ $ref['object_id'] ] ) ) { $this->translations[ $ref['object_type'] ][ $ref['object_id'] ] = new Translations(); } $context = Context::to_string( array( Context::FIELD => $ref['field_type'], Context::ID => isset( $ref['field_id'] ) ? $ref['field_id'] : '', Context::ENCODING => isset( $ref['encoding'] ) ? $ref['encoding'] : '', ) ); $this->translations[ $ref['object_type'] ][ $ref['object_id'] ]->add_entry( array( 'singular' => $source, 'translations' => array( $target ), 'context' => $context, ) ); } /** * Returns translated data. * * @since 3.6 * * @return array * * @phpstan-return array> */ public function get(): array { return $this->translations; } }