PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 18.2
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v18.2
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
wordpress-seo / src / deprecated / admin / add-keyword-modal.php

add-keyword-modal.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 18.2, at src/deprecated/admin/add-keyword-modal.php

85 lines 2.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * WPSEO plugin file.
4 *
5 * @package WPSEO\Admin
6 */
7
8 // phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound -- Reason: The class is deprecated.
9
10 /**
11 * Class to print out the translatable strings for the Add Keyword modal.
12 *
13 * @deprecated 15.5
14 */
15 class WPSEO_Add_Keyword_Modal {
16
17 /**
18 * Returns the translations for the Add Keyword modal.
19 *
20 * These strings are not escaped because they're meant to be used with React
21 * which already takes care of that. If used in PHP, they should be escaped.
22 *
23 * @deprecated 15.5
24 * @codeCoverageIgnore
25 *
26 * @return array Translated text strings for the Add Keyword modal.
27 */
28 public function get_translations() {
29 _deprecated_function( __METHOD__, 'WPSEO 15.5' );
30
31 return [
32 'title' => __( 'Would you like to add more than one keyphrase?', 'wordpress-seo' ),
33 'intro' => sprintf(
34 /* translators: %s expands to a 'Yoast SEO Premium' text linked to the yoast.com website. */
35 __( 'Great news: you can, with %s!', 'wordpress-seo' ),
36 '{{link}}Yoast SEO Premium{{/link}}'
37 ),
38 'link' => WPSEO_Shortlinker::get( 'https://yoa.st/pe-premium-page' ),
39 'other' => sprintf(
40 /* translators: %s expands to 'Yoast SEO Premium'. */
41 __( 'Other benefits of %s for you:', 'wordpress-seo' ),
42 'Yoast SEO Premium'
43 ),
44 'buylink' => WPSEO_Shortlinker::get( 'https://yoa.st/add-keywords-popup' ),
45 'buy' => sprintf(
46 /* translators: %s expands to 'Yoast SEO Premium'. */
47 __( 'Get %s', 'wordpress-seo' ),
48 'Yoast SEO Premium'
49 ),
50 'small' => __( '1 year free support and updates included!', 'wordpress-seo' ),
51 'a11yNotice.opensInNewTab' => __( '(Opens in a new browser tab)', 'wordpress-seo' ),
52 ];
53 }
54
55 /**
56 * Passes translations to JS for the Add Keyword modal component.
57 *
58 * @deprecated 15.5
59 * @codeCoverageIgnore
60 *
61 * @return array Translated text strings for the Add Keyword modal component.
62 */
63 public function get_translations_for_js() {
64 _deprecated_function( __METHOD__, 'WPSEO 15.5' );
65
66 $translations = $this->get_translations();
67 return [
68 'locale' => get_user_locale(),
69 'intl' => $translations,
70 ];
71 }
72
73 /**
74 * Prints the localized Add Keyword modal translations for JS.
75 *
76 * @deprecated 15.5
77 * @codeCoverageIgnore
78 */
79 public function enqueue_translations() {
80 _deprecated_function( __METHOD__, 'WPSEO 15.5' );
81
82 wp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'admin-global-script', 'yoastAddKeywordModalL10n', $this->get_translations_for_js() );
83 }
84 }
85