| 1 |
<?php |
| 2 |
/** |
| 3 |
* WPSEO plugin file. |
| 4 |
* |
| 5 |
* @package WPSEO\Admin\Views |
| 6 |
* |
| 7 |
* @uses Yoast_Form $yform Form object. |
| 8 |
*/ |
| 9 |
|
| 10 |
use Yoast\WP\SEO\Presenters\Admin\Alert_Presenter; |
| 11 |
|
| 12 |
if ( ! defined( 'WPSEO_VERSION' ) ) { |
| 13 |
header( 'Status: 403 Forbidden' ); |
| 14 |
header( 'HTTP/1.1 403 Forbidden' ); |
| 15 |
exit(); |
| 16 |
} |
| 17 |
|
| 18 |
echo '<h2>' . esc_html__( 'Facebook settings', 'wordpress-seo' ) . '</h2>'; |
| 19 |
|
| 20 |
$yform->light_switch( 'opengraph', __( 'Add Open Graph meta data', 'wordpress-seo' ) ); |
| 21 |
|
| 22 |
?> |
| 23 |
<p> |
| 24 |
<?php |
| 25 |
esc_html_e( 'Enable this feature if you want Facebook and other social media to display a preview with images and a text excerpt when a link to your site is shared.', 'wordpress-seo' ); |
| 26 |
?> |
| 27 |
</p> |
| 28 |
|
| 29 |
<div id="wpseo-opengraph-settings" style="display: none;"> |
| 30 |
<?php |
| 31 |
$frontpage_settings_message = sprintf( |
| 32 |
/* translators: 1: link open tag; 2: link close tag. */ |
| 33 |
esc_html__( 'The social homepage settings have been moved to the %1$s‘Search appearance’ settings under the ‘General’ tab%2$s.', 'wordpress-seo' ), |
| 34 |
'<a href="' . esc_url( admin_url( 'admin.php?page=wpseo_titles#top#general' ) ) . '">', |
| 35 |
'</a>' |
| 36 |
); |
| 37 |
|
| 38 |
$frontpage_settings_alert = new Alert_Presenter( $frontpage_settings_message, 'info' ); |
| 39 |
|
| 40 |
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Output from present() is considered safe. |
| 41 |
echo '<div class="yoast-measure">' . $frontpage_settings_alert->present() . '</div>'; |
| 42 |
|
| 43 |
$yform->hidden( 'og_frontpage_title', 'og_frontpage_title' ); |
| 44 |
$yform->hidden( 'og_frontpage_desc', 'og_frontpage_desc' ); |
| 45 |
$yform->hidden( 'og_frontpage_image', 'og_frontpage_image' ); |
| 46 |
$yform->hidden( 'og_frontpage_image_id', 'og_frontpage_image_id' ); |
| 47 |
|
| 48 |
echo '<h3>' . esc_html__( 'Default image', 'wordpress-seo' ) . '</h3>'; |
| 49 |
|
| 50 |
$yform->hidden( 'og_default_image', 'og_default_image' ); |
| 51 |
$yform->hidden( 'og_default_image_id', 'og_default_image_id' ); |
| 52 |
?> |
| 53 |
<p> |
| 54 |
<?php esc_html_e( 'This image is used if the post/page being shared does not contain any images.', 'wordpress-seo' ); ?> |
| 55 |
</p> |
| 56 |
<div id="yoast-og-default-image-select" class="yoast-measure"></div> |
| 57 |
</div> |
| 58 |
<?php |
| 59 |
|
| 60 |
do_action( 'wpseo_admin_opengraph_section' ); |
| 61 |
|