PluginProbe ʕ •ᴥ•ʔ
WP Popular Posts / 4.1.1
WP Popular Posts v4.1.1
4.0.8 4.0.9 4.1.0 4.1.1 4.1.2 4.2.0 4.2.1 4.2.2 5.0.0 5.0.1 5.0.2 5.1.0 5.2.0 5.2.1 5.2.2 5.2.3 5.2.4 5.3.0 5.3.1 5.3.2 5.3.3 5.3.4 5.3.5 5.3.6 5.4.0 5.4.1 5.4.2 5.5.0 5.5.1 6.0.0 6.0.1 6.0.2 6.0.3 6.0.4 6.0.5 6.1.0 6.1.1 6.1.2 6.1.3 6.1.4 6.2.0 6.2.1 6.3.0 6.3.1 6.3.2 6.3.3 6.3.4 6.4.0 6.4.1 6.4.2 7.0.0 7.0.1 7.1.0 7.2.0 7.3.0 7.3.1 7.3.2 7.3.3 7.3.4 7.3.5 7.3.6 7.3.7 7.3.8 7.4.0 trunk 2.3.7 3.0.0 3.0.1 3.0.2 3.0.3 3.1.0 3.1.1 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 4.0.0 4.0.1 4.0.10 4.0.11 4.0.12 4.0.13 4.0.2 4.0.3 4.0.5 4.0.6
wordpress-popular-posts / includes / class-wordpress-popular-posts-translate.php
wordpress-popular-posts / includes Last commit date
class-wordpress-popular-posts-activator.php 8 years ago class-wordpress-popular-posts-deactivator.php 8 years ago class-wordpress-popular-posts-helper.php 8 years ago class-wordpress-popular-posts-i18n.php 8 years ago class-wordpress-popular-posts-image.php 8 years ago class-wordpress-popular-posts-loader.php 8 years ago class-wordpress-popular-posts-output.php 8 years ago class-wordpress-popular-posts-query.php 8 years ago class-wordpress-popular-posts-rest-controller.php 8 years ago class-wordpress-popular-posts-settings.php 8 years ago class-wordpress-popular-posts-template.php 8 years ago class-wordpress-popular-posts-translate.php 8 years ago class-wordpress-popular-posts-widget.php 8 years ago class-wordpress-popular-posts.php 8 years ago widget-form.php 8 years ago
class-wordpress-popular-posts-translate.php
142 lines
1 <?php
2 /**
3 * Obtains translation data from objects.
4 *
5 * @link http://cabrerahector.com
6 * @since 4.0.0
7 *
8 * @package WordPressPopularPosts
9 * @subpackage WordPressPopularPosts/includes
10 */
11 /**
12 * Obtains translation data from objects.
13 *
14 * @since 4.0.0
15 * @package WordPressPopularPosts
16 * @subpackage WordPressPopularPosts/includes
17 * @author Hector Cabrera <me@cabrerahector.com>
18 */
19
20 class WPP_translate {
21
22 /**
23 * Class instance.
24 *
25 * @since 4.0.0
26 * @access private
27 * @var object|WPP_translate
28 */
29 private static $instance;
30
31 /**
32 * Default language code.
33 *
34 * @since 4.0.0
35 * @access private
36 * @var string
37 */
38 private $default_language;
39
40 /**
41 * Current language code.
42 *
43 * @since 4.0.0
44 * @access private
45 * @var string
46 */
47 private $current_language;
48
49 /**
50 * Initialize the collections used to maintain the actions and filters.
51 *
52 * @since 4.0.0
53 * @access private
54 */
55 private function __construct() {
56
57 $this->default_language = apply_filters( 'wpml_default_language', NULL );
58 $this->current_language = apply_filters( 'wpml_current_language', NULL );
59
60 }
61
62 /**
63 * Get an instance of this class.
64 *
65 * @since 4.0.0
66 * @return object|\WPP_translate
67 */
68 public static function get_instance() {
69
70 if ( is_null(self::$instance) ) {
71 self::$instance = new WPP_translate();
72 }
73
74 return self::$instance;
75
76 }
77
78 /*
79 * Retrieves the code of the default language.
80 *
81 * @since 4.0.0
82 * @return string|null
83 */
84 public function get_default_language() {
85 return $this->default_language;
86 }
87
88 /*
89 * Retrieves the code of the currently active language.
90 *
91 * @since 4.0.0
92 * @return string|null
93 */
94 public function get_current_language() {
95 return $this->current_language;
96 }
97
98 /*
99 * Retrieves the ID of an object.
100 *
101 * @since 4.0.0
102 * @param integer $object_id
103 * @param string $object_type
104 * @param boolean $return_original_if_missing
105 * @param string $lang_code
106 * @return integer
107 */
108 public function get_object_id( $object_id = null, $object_type = 'post', $return_original_if_missing = true, $lang_code = null ) {
109
110 return apply_filters(
111 'wpml_object_id',
112 $object_id,
113 $object_type,
114 $return_original_if_missing,
115 $lang_code
116 );
117
118 }
119
120 /*
121 * Retrieves the language code of an object.
122 *
123 * @since 4.0.0
124 * @param integer $object_id
125 * @param string $object_type
126 * @return string|null
127 */
128 public function get_object_lang_code( $object_id = null, $object_type = 'post' ) {
129
130 return apply_filters(
131 'wpml_element_language_code',
132 null,
133 array(
134 'element_id' => $object_id,
135 'element_type' => $object_type
136 )
137 );
138
139 }
140
141 } // End WPP_translate class
142