entries as $entry ) { if ( '' !== $entry->singular ) { $strings[] = wp_slash( array( $entry->singular, $this->translate( $entry->singular ) ) ); } } update_term_meta( $lang->term_id, '_pll_strings_translations', $strings ); } /** * Reads a PLL_MO object from the term meta. * * @since 1.2 * @since 3.4 Reads a PLL_MO from the term meta. * * @param PLL_Language $lang The language in which we want to get strings. * @return void */ public function import_from_db( $lang ) { $this->set_header( 'Language', $lang->slug ); $strings = get_term_meta( $lang->term_id, '_pll_strings_translations', true ); if ( empty( $strings ) || ! is_array( $strings ) ) { return; } foreach ( $strings as $msg ) { $entry = $this->make_entry( $msg[0], $msg[1] ); if ( '' !== $entry->singular ) { $this->add_entry( $entry ); } } } /** * Deletes a string * * @since 2.9 * * @param string $string The source string to remove from the translations. * @return void */ public function delete_entry( $string ) { unset( $this->entries[ $string ] ); } }