/
var
/
www
/
vhosts
/
ihelp.ro
/
ajutam.ro
/
wp-content
/
plugins
/
give
/
includes
/
/var/www/vhosts/ihelp.ro/ajutam.ro/wp-content/plugins/give/includes
mkdir
upload
Name
Size
Mode
Actions
admin/
-
0755
rm
api/
-
0755
rm
database/
-
0755
rm
deprecated/
-
0755
rm
donors/
-
0755
rm
emails/
-
0755
rm
forms/
-
0755
rm
frontend/
-
0755
rm
gateways/
-
0755
rm
libraries/
-
0755
rm
payments/
-
0755
rm
actions.php
9723
0644
edit
dl
rm
ajax-functions.php
20842
0644
edit
dl
rm
class-give-async-process.php
1177
0644
edit
dl
rm
class-give-background-updater.php
13110
0644
edit
dl
rm
class-give-cache-setting.php
6402
0644
edit
dl
rm
class-give-cache.php
18186
0644
edit
dl
rm
class-give-cli-commands.php
33154
0644
edit
dl
rm
class-give-comment.php
17386
0644
edit
dl
rm
class-give-cron.php
5157
0644
edit
dl
rm
class-give-donate-form.php
24078
0644
edit
dl
rm
class-give-donor.php
41007
0644
edit
dl
rm
class-give-email-access.php
8503
0644
edit
dl
rm
class-give-license-handler.php
27610
0644
edit
dl
rm
class-give-logging.php
7492
0644
edit
dl
rm
class-give-readme-parser.php
1259
0644
edit
dl
rm
class-give-roles.php
10783
0644
edit
dl
rm
class-give-scripts.php
25159
0644
edit
dl
rm
class-give-session.php
15164
0644
edit
dl
rm
class-give-stats.php
12049
0644
edit
dl
rm
class-give-template-loader.php
3638
0644
edit
dl
rm
class-give-tooltips.php
4670
0644
edit
dl
rm
class-give-translation.php
8466
0644
edit
dl
rm
class-notices.php
19401
0644
edit
dl
rm
country-functions.php
77972
0644
edit
dl
rm
currencies-list.php
48937
0644
edit
dl
rm
currency-functions.php
11784
0644
edit
dl
rm
error-tracking.php
2996
0644
edit
dl
rm
filters.php
8946
0644
edit
dl
rm
formatting.php
25206
0644
edit
dl
rm
install.php
16535
0644
edit
dl
rm
login-register.php
10578
0644
edit
dl
rm
misc-functions.php
113297
0644
edit
dl
rm
plugin-compatibility.php
3247
0644
edit
dl
rm
post-types.php
18224
0644
edit
dl
rm
price-functions.php
2895
0644
edit
dl
rm
process-donation.php
47979
0644
edit
dl
rm
setting-functions.php
4461
0644
edit
dl
rm
shortcodes.php
29823
0644
edit
dl
rm
template-functions.php
13292
0644
edit
dl
rm
user-functions.php
16145
0644
edit
dl
rm
Edit:
/var/www/vhosts/ihelp.ro/ajutam.ro/wp-content/plugins/give/includes/class-give-translation.php
(8466B)
<?php use Give\Log\Log; /** * Translations * * @package Give * @subpackage Classes/Give_Stats * @copyright Copyright (c) 2017, Give * @license https://opensource.org/licenses/gpl-license GNU Public License * @since 2.0 */ class Give_Translations { /** * Instance. * * @since 2.0 * @access private * @var */ private static $instance; /** * Text config. * * @since 2.0 * @access private * @var */ private static $text_configs = array(); /** * Translated texts. * * @since 2.0 * @access private * @var */ private static $text_translations = array(); /** * Singleton pattern. * * @since 2.0 * @access private */ private function __construct() { } /** * Get instance. * * @since 2.0 * @access public * @return static */ public static function get_instance() { if ( null === static::$instance ) { self::$instance = new static(); } return self::$instance; } /** * Setup * * @since 2.0 * @access public */ public function setup() { self::setup_hooks(); } /** * Setup hooks * * @since 2.0 * @access public */ public function setup_hooks() { add_action( 'init', array( $this, 'load_translated_texts' ), 999 ); } /** * Load translated texts. * * @since 2.0 * @access public */ public function load_translated_texts() { /** * Filter the translated texts. * * @since 2.0 */ self::$text_translations = apply_filters( 'give_translated_texts', self::$text_translations ); } /** * Add text by group ( if any ) * * @since 2.0 * @access public * * @param array $args * * @return bool|WP_Error false on success otherwise WP_Error object */ public static function add_text( $args = array() ) { $error = false; // Set text params. $args = wp_parse_args( $args, array( 'text' => '', 'id' => '', 'group' => '', 'type' => 'text', ) ); try { // Check for errors. if ( empty( $args['text'] ) ) { /* @var WP_Error $error */ $error = new WP_Error( 'EMPTY_TEXT', __( 'Empty string is not allowed.', 'give' ), $args ); throw new Exception( $error->get_error_message( 'EMPTY_TEXT' ) ); } elseif ( empty( $args['id'] ) ) { /* @var WP_Error $error */ $error = new WP_Error( 'EMPTY_ID', __( 'Empty ID is not allowed.', 'give' ), $args ); throw new Exception( $error->get_error_message( 'EMPTY_ID' ) ); } elseif ( empty( $args['group'] ) && array_key_exists( $args['id'], self::$text_configs ) ) { /* @var WP_Error $error */ $error = new WP_Error( 'TEXT_ID_ALREADY_EXIST', __( 'Text ID without a group already exists.', 'give' ), $args ); throw new Exception( $error->get_error_message( 'TEXT_ID_ALREADY_EXIST' ) ); } elseif ( ! empty( $args['group'] ) && ! empty( self::$text_configs[ $args['group'] ] ) && array_key_exists( $args['id'], self::$text_configs[ $args['group'] ] ) ) { /* @var WP_Error $error */ $error = new WP_Error( 'TEXT_ID_WITHIN_GROUP_ALREADY_EXIST', __( 'Text ID within a group already exists.', 'give' ), $args ); throw new Exception( $error->get_error_message( 'TEXT_ID_WITHIN_GROUP_ALREADY_EXIST' ) ); } // Add text. if ( ! empty( $args['group'] ) ) { self::$text_configs[ $args['group'] ][ $args['id'] ] = $args; } else { self::$text_configs[ $args['id'] ] = $args; } } catch ( Exception $e ) { Log::error( $e->getMessage() ); }// End try(). /** * Filter the texts * * @since 2.0 */ self::$text_configs = apply_filters( 'give_texts', self::$text_configs ); return $error; } /** * Add label by group ( if any ) * * @since 2.0 * @access public * * @param array $args * * @return string */ public static function add_label( $args = array() ) { // Set text params. $args = wp_parse_args( $args, array( 'text' => '', 'id' => '', 'group' => '', ) ); $args['type'] = 'label'; $args['id'] = "{$args['id']}_label"; return self::add_text( $args ); } /** * Add tooltip by group ( if any ) * * @since 2.0 * @access public * * @param array $args * * @return string */ public static function add_tooltip( $args = array() ) { // Set text params. $args = wp_parse_args( $args, array( 'text' => '', 'id' => '', 'group' => '', ) ); $args['type'] = 'tooltip'; $args['id'] = "{$args['id']}_tooltip"; return self::add_text( $args ); } /** * Add translation by group ( if any ) * * @since 2.0 * @access public * * @param array 4args * * @return string */ public static function add_translation( $args = array() ) { $args = wp_parse_args( $args, array( 'id' => '', 'group' => '', 'text' => '', ) ); // Bailout. if ( empty( $args['id'] ) ) { return; } if ( ! empty( $args['group'] ) ) { self::$text_translations[ $args['group'] ][ $args['id'] ] = $args['text']; } else { self::$text_translations[ $args['id'] ] = $args['text']; } } /** * Get label translation by group ( if any ) * * @since 2.0 * @access public * * @param string $id * @param string $group * @param string $text * * @return string */ public static function add_label_translation( $id, $group = '', $text = '' ) { return self::get_text( array( 'id' => "{$id}_label", 'group' => $group, 'text' => $text, ) ); } /** * Get tooltip translation by group ( if any ) * * @since 2.0 * @access public * * @param string $id * @param string $group * @param string $text * * @return string */ public static function add_tooltip_translation( $id, $group = '', $text = '' ) { return self::get_text( array( 'id' => "{$id}_label", 'group' => $group, 'text' => $text, ) ); } /** * Get label by group ( if any ) * * @since 2.0 * @access public * * @param string $id * @param string $group * * @return string */ public static function get_label( $id, $group = '' ) { return self::get_text( array( 'id' => "{$id}_label", 'group' => $group, 'type' => 'label', ) ); } /** * Get tooltip by group ( if any ) * * @since 2.0 * @access public * * @param string $id * @param string $group * * @return string */ public static function get_tooltip( $id, $group = '' ) { return self::get_text( array( 'id' => "{$id}_tooltip", 'group' => $group, 'type' => 'tooltip', ) ); } /** * Get text by group * * @since 2.0 * @access public * * @param array $args * * @return string */ public static function get_text( $args = array() ) { $text = ''; // Bailout. if ( empty( $args ) ) { return $text; } // Setup args. $args = wp_parse_args( $args, array( 'id' => '', 'group' => '', 'type' => 'text', ) ); // Check if text exist. if ( empty( $args['id'] ) || ( empty( $args['group'] ) && ! array_key_exists( $args['id'], self::$text_configs ) ) || ( ! empty( $args['group'] ) && ! empty( self::$text_configs[ $args['group'] ] ) && ! array_key_exists( $args['id'], self::$text_configs[ $args['group'] ] ) ) ) { return $text; } // Get text value. if ( ! empty( $args['group'] ) && array_key_exists( $args['group'], self::$text_configs ) ) { $text = self::$text_configs[ $args['group'] ][ $args['id'] ]['text']; // Get translated text if exist. if ( ! empty( self::$text_translations ) && ! empty( self::$text_translations[ $args['group'] ] ) && array_key_exists( $args['id'], self::$text_translations[ $args['group'] ] ) ) { $text = self::$text_translations[ $args['group'] ][ $args['id'] ]; } } elseif ( empty( $args['group'] ) && array_key_exists( $args['id'], self::$text_configs ) ) { $text = self::$text_configs[ $args['id'] ]['text']; // Get translated text if exist. if ( ! empty( self::$text_translations ) && array_key_exists( $args['id'], self::$text_translations ) ) { $text = self::$text_translations[ $args['id'] ]; } } /** * Filter the give text * * @since 2.0 */ $text = apply_filters( 'give_text', $text, $args, self::$text_configs, self::$text_translations ); return $text; } } // Setup translations. Give_Translations::get_instance()->setup();
Save
cmd:
run