| @@ -11,9 +11,15 @@ | ||
| 11 | 11 | * |
| 12 | 12 | * @return array |
| 13 | 13 | */ |
| 14 | 14 | function wplng_data_attr_json_to_translate() { |
| 15 | - return apply_filters( | |
| 15 | + global $wplng_data_attr_json_to_translate; | |
| 16 | + | |
| 17 | + if ( null !== $wplng_data_attr_json_to_translate ) { | |
| 18 | + return $wplng_data_attr_json_to_translate; | |
| 19 | + } | |
| 20 | + | |
| 21 | + $wplng_data_attr_json_to_translate = apply_filters( | |
| 16 | 22 | 'wplng_attr_json_to_translate', |
| 17 | 23 | array( |
| 18 | 24 | // Theme: Divi |
| 19 | 25 | array( |
| @@ -55,10 +61,18 @@ | ||
| 55 | 61 | array( |
| 56 | 62 | 'attr' => 'data-events', |
| 57 | 63 | 'selector' => '.eael-event-calendar-cls[data-events]', |
| 58 | 64 | ), |
| 65 | + | |
| 66 | + // Plugin: advanced-post-block | |
| 67 | + array( | |
| 68 | + 'attr' => 'data-attributes', | |
| 69 | + 'selector' => '.wp-block-ap-block-posts[data-attributes]', | |
| 70 | + ), | |
| 59 | 71 | ) |
| 60 | 72 | ); |
| 73 | + | |
| 74 | + return $wplng_data_attr_json_to_translate; | |
| 61 | 75 | } |
| 62 | 76 | |
| 63 | 77 | |
| 64 | 78 | /** |
| @@ -66,9 +80,15 @@ | ||
| 66 | 80 | * |
| 67 | 81 | * @return array |
| 68 | 82 | */ |
| 69 | 83 | function wplng_data_attr_text_to_translate() { |
| 70 | - return apply_filters( | |
| 84 | + global $wplng_data_attr_text_to_translate; | |
| 85 | + | |
| 86 | + if ( null !== $wplng_data_attr_text_to_translate ) { | |
| 87 | + return $wplng_data_attr_text_to_translate; | |
| 88 | + } | |
| 89 | + | |
| 90 | + $wplng_data_attr_text_to_translate = apply_filters( | |
| 71 | 91 | 'wplng_attr_text_to_translate', |
| 72 | 92 | array( |
| 73 | 93 | // Default tags |
| 74 | 94 | array( |
| @@ -211,16 +231,22 @@ | ||
| 211 | 231 | 'attr' => 'data-caption-desc', |
| 212 | 232 | 'selector' => '[data-caption-desc]', |
| 213 | 233 | ), |
| 214 | 234 | |
| 215 | - // Theme: Breaks builder | |
| 235 | + // Theme: Briks builder | |
| 216 | 236 | array( |
| 217 | 237 | 'attr' => 'data-error-message', |
| 218 | 238 | 'selector' => '[data-error-message]', |
| 219 | 239 | ), |
| 240 | + array( | |
| 241 | + 'attr' => 'arialabelledby', | |
| 242 | + 'selector' => '[arialabelledby]', | |
| 243 | + ), | |
| 220 | 244 | |
| 221 | 245 | ) |
| 222 | 246 | ); |
| 247 | + | |
| 248 | + return $wplng_data_attr_text_to_translate; | |
| 223 | 249 | } |
| 224 | 250 | |
| 225 | 251 | |
| 226 | 252 | /** |
| @@ -228,9 +254,15 @@ | ||
| 228 | 254 | * |
| 229 | 255 | * @return array |
| 230 | 256 | */ |
| 231 | 257 | function wplng_data_attr_html_to_translate() { |
| 232 | - return apply_filters( | |
| 258 | + global $wplng_data_attr_html_to_translate; | |
| 259 | + | |
| 260 | + if ( null !== $wplng_data_attr_html_to_translate ) { | |
| 261 | + return $wplng_data_attr_html_to_translate; | |
| 262 | + } | |
| 263 | + | |
| 264 | + $wplng_data_attr_html_to_translate = apply_filters( | |
| 233 | 265 | 'wplng_attr_html_to_translate', |
| 234 | 266 | array( |
| 235 | 267 | array( |
| 236 | 268 | 'attr' => 'data-sub-html', |
| @@ -237,8 +269,10 @@ | ||
| 237 | 269 | 'selector' => '[data-sub-html]', |
| 238 | 270 | ), |
| 239 | 271 | ) |
| 240 | 272 | ); |
| 273 | + | |
| 274 | + return $wplng_data_attr_html_to_translate; | |
| 241 | 275 | } |
| 242 | 276 | |
| 243 | 277 | |
| 244 | 278 | /** |
| @@ -246,9 +280,15 @@ | ||
| 246 | 280 | * |
| 247 | 281 | * @return array |
| 248 | 282 | */ |
| 249 | 283 | function wplng_data_attr_url_to_translate() { |
| 250 | - return apply_filters( | |
| 284 | + global $wplng_data_attr_url_to_translate; | |
| 285 | + | |
| 286 | + if ( null !== $wplng_data_attr_url_to_translate ) { | |
| 287 | + return $wplng_data_attr_url_to_translate; | |
| 288 | + } | |
| 289 | + | |
| 290 | + $wplng_data_attr_url_to_translate = apply_filters( | |
| 251 | 291 | 'wplng_attr_url_to_translate', |
| 252 | 292 | array( |
| 253 | 293 | array( |
| 254 | 294 | 'attr' => 'href', |
| @@ -289,8 +329,10 @@ | ||
| 289 | 329 | 'selector' => '[data-mfp-src]', |
| 290 | 330 | ), |
| 291 | 331 | ) |
| 292 | 332 | ); |
| 333 | + | |
| 334 | + return $wplng_data_attr_url_to_translate; | |
| 293 | 335 | } |
| 294 | 336 | |
| 295 | 337 | |
| 296 | 338 | /** |
| @@ -298,9 +340,15 @@ | ||
| 298 | 340 | * |
| 299 | 341 | * @return array |
| 300 | 342 | */ |
| 301 | 343 | function wplng_data_attr_lang_id_to_replace() { |
| 302 | - return apply_filters( | |
| 344 | + global $wplng_data_attr_lang_id_to_replace; | |
| 345 | + | |
| 346 | + if ( null !== $wplng_data_attr_lang_id_to_replace ) { | |
| 347 | + return $wplng_data_attr_lang_id_to_replace; | |
| 348 | + } | |
| 349 | + | |
| 350 | + $wplng_data_attr_lang_id_to_replace = apply_filters( | |
| 303 | 351 | 'wplng_attr_lang_id_to_replace', |
| 304 | 352 | array( |
| 305 | 353 | array( |
| 306 | 354 | 'attr' => 'lang', |
| @@ -321,5 +369,7 @@ | ||
| 321 | 369 | 'selector' => '.eael-event-calendar-cls[data-locale]', |
| 322 | 370 | ), |
| 323 | 371 | ) |
| 324 | 372 | ); |
| 373 | + | |
| 374 | + return $wplng_data_attr_lang_id_to_replace; | |
| 325 | 375 | } |