| 1 |
<?php |
| 2 |
|
| 3 |
namespace Yoast\WP\SEO\Presenters\Admin; |
| 4 |
|
| 5 |
use Yoast\WP\SEO\Helpers\Short_Link_Helper; |
| 6 |
use Yoast\WP\SEO\Presenters\Abstract_Presenter; |
| 7 |
|
| 8 |
/** |
| 9 |
* Class Woocommerce_Beta_Editor_Presenter. |
| 10 |
*/ |
| 11 |
class Woocommerce_Beta_Editor_Presenter extends Abstract_Presenter { |
| 12 |
|
| 13 |
/** |
| 14 |
* The short link helper. |
| 15 |
* |
| 16 |
* @var Short_Link_Helper |
| 17 |
*/ |
| 18 |
protected $short_link_helper; |
| 19 |
|
| 20 |
/** |
| 21 |
* Woocommerce_Beta_Editor_Presenter constructor. |
| 22 |
* |
| 23 |
* @param Short_Link_Helper $short_link_helper The short link helper. |
| 24 |
*/ |
| 25 |
public function __construct( Short_Link_Helper $short_link_helper ) { |
| 26 |
$this->short_link_helper = $short_link_helper; |
| 27 |
} |
| 28 |
|
| 29 |
/** |
| 30 |
* Returns the notification as an HTML string. |
| 31 |
* |
| 32 |
* @return string The notification in an HTML string representation. |
| 33 |
*/ |
| 34 |
public function present() { |
| 35 |
$notification_text = '<p>'; |
| 36 |
$notification_text .= $this->get_message(); |
| 37 |
$notification_text .= '</p>'; |
| 38 |
|
| 39 |
return $notification_text; |
| 40 |
} |
| 41 |
|
| 42 |
/** |
| 43 |
* Returns the message to show. |
| 44 |
* |
| 45 |
* @return string The message. |
| 46 |
*/ |
| 47 |
protected function get_message() { |
| 48 |
return \sprintf( |
| 49 |
'<strong>%1$s</strong> %2$s', |
| 50 |
\esc_html__( 'Compatibility issue: Yoast SEO is incompatible with the beta WooCommerce product editor.', 'wordpress-seo' ), |
| 51 |
\sprintf( |
| 52 |
/* translators: 1: Yoast SEO, 2: Link start tag to the Learn more link, 3: Link closing tag. */ |
| 53 |
\esc_html__( 'The %1$s interface is currently unavailable in the beta WooCommerce product editor. To resolve any issues, please disable the beta editor. %2$sLearn how to disable the beta WooCommerce product editor.%3$s', 'wordpress-seo' ), |
| 54 |
'Yoast SEO', |
| 55 |
'<a href="' . \esc_url( $this->short_link_helper->get( 'https://yoa.st/learn-how-disable-beta-woocommerce-product-editor' ) ) . '" target="_blank">', |
| 56 |
'</a>', |
| 57 |
), |
| 58 |
); |
| 59 |
} |
| 60 |
} |
| 61 |
|