PageRenderTime 20ms CodeModel.GetById 16ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/wp-content/plugins/wordpress-seo/admin/views/tabs/social/facebook.php

https://bitbucket.org/carloskikea/helpet
PHP | 84 lines | 57 code | 17 blank | 10 comment | 3 complexity | b90869aaa01e9c855283f27667cdca23 MD5 | raw file
 1<?php
 2/**
 3 * WPSEO plugin file.
 4 *
 5 * @package WPSEO\Admin\Views
 6 */
 7
 8/**
 9 * @var Yoast_Form $yform
10 */
11
12if ( ! defined( 'WPSEO_VERSION' ) ) {
13	header( 'Status: 403 Forbidden' );
14	header( 'HTTP/1.1 403 Forbidden' );
15	exit();
16}
17
18echo '<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<?php
30
31$yform->textinput( 'fbadminapp', __( 'Facebook App ID', 'wordpress-seo' ) );
32
33if ( 'posts' === get_option( 'show_on_front' ) ) {
34	$social_facebook_frontpage_help = new WPSEO_Admin_Help_Panel(
35		'social-facebook-frontpage',
36		esc_html__( 'Learn more about the title separator setting', 'wordpress-seo' ),
37		esc_html__( 'These are the title, description and image used in the Open Graph meta tags on the front page of your site.', 'wordpress-seo' ),
38		'has-wrapper'
39	);
40	echo '<h2 class="help-button-inline">' . esc_html__( 'Frontpage settings', 'wordpress-seo' ) . $social_facebook_frontpage_help->get_button_html() . '</h2>';
41	echo $social_facebook_frontpage_help->get_panel_html();
42
43	$yform->media_input( 'og_frontpage_image', __( 'Image URL', 'wordpress-seo' ) );
44	$yform->textinput( 'og_frontpage_title', __( 'Title', 'wordpress-seo' ) );
45	$yform->textinput( 'og_frontpage_desc', __( 'Description', 'wordpress-seo' ) );
46
47	$copy_home_description_button_label = esc_html__( 'Copy home meta description', 'wordpress-seo' );
48
49	// Offer copying of meta description.
50	$homepage_meta_description = WPSEO_Options::get( 'metadesc-home-wpseo' );
51	if ( ! empty( $homepage_meta_description ) ) {
52		$copy_home_meta_desc_help = new WPSEO_Admin_Help_Panel(
53			'copy-home-meda-desc',
54			esc_html__( 'Help on copying the home meta description', 'wordpress-seo' ),
55			sprintf(
56				/* translators: 1: link open tag; 2: link close tag., 3: the translated label of the button */
57				esc_html__( 'Click the "%3$s" button to use the meta description already set in the %1$sSearch Appearance Homepage%2$s setting.', 'wordpress-seo' ),
58				'<a href="' . esc_url( admin_url( 'admin.php?page=wpseo_titles' ) ) . '">',
59				'</a>',
60				$copy_home_description_button_label
61			)
62		);
63
64		echo '<input type="hidden" id="meta_description" value="', $homepage_meta_description, '" />';
65		echo '<div class="label desc copy-home-meta-description">' .
66				'<button type="button" id="copy-home-meta-description" class="button">', $copy_home_description_button_label, '</button>' .
67				$copy_home_meta_desc_help->get_button_html() .
68				$copy_home_meta_desc_help->get_panel_html() .
69			'</div>';
70	}
71}
72
73echo '<h2>' . esc_html__( 'Default settings', 'wordpress-seo' ) . '</h2>';
74
75$yform->media_input( 'og_default_image', __( 'Image URL', 'wordpress-seo' ) );
76
77?>
78	<p class="desc label">
79		<?php esc_html_e( 'This image is used if the post/page being shared does not contain any images.', 'wordpress-seo' ); ?>
80	</p>
81
82<?php
83
84do_action( 'wpseo_admin_opengraph_section' );