PluginProbe
Polylang / 2.8
Polylang v2.8
3.8.9 3.8.8 3.8.7 3.8.6 3.8.5 3.8.4 3.8.3 2.7 2.7.0.1 2.7.1 2.7.2 2.7.3 2.7.4 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.9 2.9.1 2.9.2 3.0 3.0.1 3.0.2 3.0.3 All 233 releases
← All changes | admin/admin-strings.php +16 -0 2.92.8 View file →
@@ -52,12 +52,23 @@
52 52 * @return array list of all registered strings
53 53 */
54 54 public static function &get_strings() {
55 55 self::$default_strings = array(
56 + 'options' => array(
57 + 'blogname' => __( 'Site Title', 'polylang' ),
58 + 'blogdescription' => __( 'Tagline', 'polylang' ),
59 + 'date_format' => __( 'Date Format', 'polylang' ),
60 + 'time_format' => __( 'Time Format', 'polylang' ),
61 + ),
56 62 'widget_title' => __( 'Widget title', 'polylang' ),
57 63 'widget_text' => __( 'Widget text', 'polylang' ),
58 64 );
59 65
66 + // WP strings
67 + foreach ( self::$default_strings['options'] as $option => $string ) {
68 + self::register_string( $string, get_option( $option ), 'WordPress' );
69 + }
70 +
60 71 // Widgets titles
61 72 global $wp_registered_widgets;
62 73 $sidebars = wp_get_sidebars_widgets();
63 74 foreach ( $sidebars as $sidebar => $widgets ) {
@@ -109,8 +120,13 @@
109 120 * @param string $name unique name for the string
110 121 * @return string
111 122 */
112 123 public static function sanitize_string_translation( $translation, $name ) {
124 +
125 + if ( false !== ( $option = array_search( $name, self::$default_strings['options'], true ) ) ) {
126 + $translation = sanitize_option( $option, $translation );
127 + }
128 +
113 129 if ( $name == self::$default_strings['widget_title'] ) {
114 130 $translation = sanitize_text_field( $translation );
115 131 }
116 132