/
home
/
vianto5
/
cititower.mx
/
wp-content
/
plugins
/
wpml-string-translation
/
classes
/
/home/vianto5/cititower.mx/wp-content/plugins/wpml-string-translation/classes
mkdir
upload
Name
Size
Mode
Actions
actions/
-
0755
rm
admin-texts/
-
0755
rm
API/
-
0755
rm
basket/
-
0755
rm
batch-action/
-
0755
rm
batch-translation/
-
0755
rm
container/
-
0755
rm
db-mappers/
-
0755
rm
filters/
-
0755
rm
gettext-hooks/
-
0755
rm
menus/
-
0755
rm
MO/
-
0755
rm
package/
-
0755
rm
package-translation/
-
0755
rm
po-import/
-
0755
rm
privacy/
-
0755
rm
records/
-
0755
rm
shortcode/
-
0755
rm
slug-translation/
-
0755
rm
Storage/
-
0755
rm
string-tracking/
-
0755
rm
string-translation/
-
0755
rm
string-translation-ui/
-
0755
rm
strings-cleanup/
-
0755
rm
strings-scanning/
-
0755
rm
support/
-
0755
rm
translation-files/
-
0755
rm
translation-memory/
-
0755
rm
TranslationJob/
-
0755
rm
translations-file-scan/
-
0755
rm
Troubleshooting/
-
0755
rm
upgrade/
-
0755
rm
utilities/
-
0755
rm
wpml-tm/
-
0755
rm
WpSettings/
-
0755
rm
AutoRegisterStringsNotice.php
1737
0644
edit
dl
rm
class-wpml-admin-notifier.php
270
0644
edit
dl
rm
class-wpml-language-of-domain.php
986
0644
edit
dl
rm
class-wpml-st-admin-string.php
752
0644
edit
dl
rm
class-wpml-st-initialize.php
1078
0644
edit
dl
rm
class-wpml-st-reset.php
1618
0644
edit
dl
rm
class-wpml-st-settings.php
1301
0644
edit
dl
rm
class-wpml-st-string-factory.php
2997
0644
edit
dl
rm
class-wpml-st-string-statuses.php
808
0644
edit
dl
rm
class-wpml-st-string.php
11857
0644
edit
dl
rm
class-wpml-st-strings.php
14835
0644
edit
dl
rm
class-wpml-st-user-fields.php
5458
0644
edit
dl
rm
class-wpml-st-verify-dependencies.php
1351
0644
edit
dl
rm
SendStringsForTranslationNotice.php
1106
0644
edit
dl
rm
Shortcode.php
2113
0644
edit
dl
rm
StringsRepository.php
4065
0644
edit
dl
rm
TranslateWpmlString.php
6521
0644
edit
dl
rm
Edit:
/home/vianto5/cititower.mx/wp-content/plugins/wpml-string-translation/classes/StringsRepository.php
(4065B)
<?php namespace WPML\ST; use WPML\FP\Fns; class StringsRepository { /** @var \SitePress $sitepress */ private $sitepress; /** @var \wpdb */ private $wpdb; public function __construct( \SitePress $sitepress, \wpdb $wpdb ) { $this->sitepress = $sitepress; $this->wpdb = $wpdb; } /** * @param string[] $langs * * @return string */ private function getLanguagesSql( $langs = [] ) { return ' AND language IN (' . wpml_prepare_in( $langs, '%s' ) . ')'; } /** * @param string[] $notPriorities * * @return string */ private function getNotPrioritiesSql( $notPriorities = [] ) { return ' AND translation_priority NOT IN (' . wpml_prepare_in( $notPriorities, '%s' ) . ')'; } /** * @param string[] $domains * @param string $extraSql * * @return int */ private function execGetCountInDomains( $domains = [], $extraSql = '' ) { if ( ! $domains ) { return 0; } return (int) $this->wpdb->get_var( $this->wpdb->prepare( "SELECT count(id) FROM {$this->wpdb->prefix}icl_strings WHERE 1=%d AND context IN (" . wpml_prepare_in( $domains, '%s' ) . ')' . $extraSql, 1 ) ); } /** * @param string[] $domains * * @return int */ public function getCountInDomains( $domains = [] ) { return $this->execGetCountInDomains( $domains ); } /** * @param string[] $domains * @param string[] $langs * * @return int */ public function getCountInDomainsByLangs( $domains = [], $langs = [] ) { return $this->execGetCountInDomains( $domains, $this->getLanguagesSql( $langs ) ); } /** * @param string[] $domains * @param string[] $notPriorities * * @return int */ public function getCountInDomainsByNotPriorities( $domains = [], $notPriorities = [] ) { return $this->execGetCountInDomains( $domains, $this->getNotPrioritiesSql( $notPriorities ) ); } /** * @param string[] $domains * @param int $limit * @param string $extraSql * * @return array */ private function execGetFromDomains( $domains = [], $limit = 20, $extraSql = '' ) { if ( ! $domains ) { return []; } return $this->wpdb->get_col( $this->wpdb->prepare( "SELECT id FROM {$this->wpdb->prefix}icl_strings WHERE context IN (" . wpml_prepare_in( $domains, '%s' ) . ')' . $extraSql . ' LIMIT 0, %d', $limit ) ); } /** * @param string[] $domains * @param int $limit * * @return array */ public function getFromDomains( $domains = [], $limit = 20 ) { return $this->execGetFromDomains( $domains, $limit ); } /** * @param string[] $domains * @param string[] $langs * @param int $limit * * @return array */ public function getStringIdFromDomainsByLangs( $domains = [], $langs = [], $limit = 20 ) { return $this->execGetFromDomains( $domains, $limit, $this->getLanguagesSql( $langs ) ); } /** * @param string[] $domains * @param string[] $notPriorities * @param int $limit * * @return array */ public function getStringIdsFromDomainsWithExcludedPriorities( $domains = [], $notPriorities = [], $limit = 20 ) { return $this->execGetFromDomains( $domains, $limit, $this->getNotPrioritiesSql( $notPriorities ) ); } /** * @param string[] $domains * @param string[] $ignoreLangs * * @return array */ public function getLanguagesUsedInDomains( $domains = [], $ignoreLangs = [] ) { if ( ! $domains ) { return []; } $allLanguages = array_keys( $this->sitepress->get_languages( $this->sitepress->get_admin_language() ) ); $allLanguages = Fns::filter( function( $language ) use ( $ignoreLangs ) { return ! in_array( $language, $ignoreLangs ); }, $allLanguages ); $results = $this->wpdb->get_results( $this->wpdb->prepare( "SELECT DISTINCT(language) FROM {$this->wpdb->prefix}icl_strings s" . " WHERE 1=%d AND context IN (" . wpml_prepare_in( $domains ) . ") AND language IN (" . wpml_prepare_in( $allLanguages ) . ')', 1 ), ARRAY_A ); return Fns::map( function( $data ) { return $data['language']; }, $results ); } }
Save
cmd:
run