/
home
/
vianto5
/
.trash
/
cititower.mx
/
wp-content
/
plugins
/
wpml-string-translation
/
classes
/
/home/vianto5/.trash/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-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
translations-file-scan/
-
0755
rm
Troubleshooting/
-
0755
rm
upgrade/
-
0755
rm
utilities/
-
0755
rm
wpml-tm/
-
0755
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
1179
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
9377
0644
edit
dl
rm
class-wpml-st-strings.php
10591
0644
edit
dl
rm
class-wpml-st-user-fields.php
5458
0644
edit
dl
rm
class-wpml-st-verify-dependencies.php
1142
0644
edit
dl
rm
Shortcode.php
2113
0644
edit
dl
rm
TranslateWpmlString.php
5564
0644
edit
dl
rm
Edit:
/home/vianto5/.trash/cititower.mx/wp-content/plugins/wpml-string-translation/classes/Shortcode.php
(2113B)
<?php namespace WPML\ST; class Shortcode { const STRING_DOMAIN = 'wpml-shortcode'; private $context; private $name; /** * @var \wpdb */ private $wpdb; public function __construct( \wpdb $wpdb ) { $this->wpdb = $wpdb; } function init_hooks() { add_shortcode( 'wpml-string', [ $this, 'render' ] ); } /** * @param array $attributes * @param string $value * * @return string */ function render( $attributes, $value ) { $this->parse_attributes( $attributes, $value ); $this->maybe_register_string( $value ); return do_shortcode( icl_t( $this->context, $this->name, $value ) ); } /** * @param string $value */ private function maybe_register_string( $value ) { $string = $this->get_registered_string(); if ( ! $string || $string->value !== $value ) { icl_register_string( $this->context, $this->name, $value ); } } /** * @param array $attributes * @param string $value */ private function parse_attributes( $attributes, $value ) { $pairs = array( 'context' => self::STRING_DOMAIN, 'name' => 'wpml-shortcode-' . md5( $value ), ); $attributes = shortcode_atts( $pairs, $attributes ); $this->context = $attributes['context']; $this->name = $attributes['name']; } /** * @return \stdClass */ private function get_registered_string() { $strings = $this->get_strings_registered_in_context(); if ( $strings && array_key_exists( $this->name, $strings ) ) { return $strings[ $this->name ]; } return null; } /** * @return \stdClass[] */ private function get_strings_registered_in_context() { $cache_key = $this->context; $cache_group = 'wpml-string-shortcode'; $cache_found = false; $string = wp_cache_get( $cache_key, $cache_group, false, $cache_found ); if ( ! $cache_found ) { $query = 'SELECT name, id, value, status FROM ' . $this->wpdb->prefix . 'icl_strings WHERE context=%s'; $sql = $this->wpdb->prepare( $query, $this->context ); $string = $this->wpdb->get_results( $sql, OBJECT_K ); wp_cache_set( $cache_key, $string, $cache_group ); } return $string; } }
Save
cmd:
run