khaihihi
This commit is contained in:
@@ -0,0 +1,101 @@
|
||||
<?php
|
||||
/**
|
||||
* WPSEO plugin file.
|
||||
*
|
||||
* @package WPSEO\Admin\Views
|
||||
*
|
||||
* @uses Yoast_Form $yform Form object.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPSEO_VERSION' ) ) {
|
||||
header( 'Status: 403 Forbidden' );
|
||||
header( 'HTTP/1.1 403 Forbidden' );
|
||||
exit();
|
||||
}
|
||||
|
||||
$social_profiles_help = new WPSEO_Admin_Help_Panel(
|
||||
'social-accounts',
|
||||
__( 'Learn more about your social profiles settings', 'wordpress-seo' ),
|
||||
__( 'To let search engines know which social profiles are associated to this site, enter your site social profiles data below.', 'wordpress-seo' ) . ' ' .
|
||||
__( 'If a Wikipedia page for you or your organization exists, add it too.', 'wordpress-seo' ),
|
||||
'has-wrapper'
|
||||
);
|
||||
|
||||
$company_or_person = WPSEO_Options::get( 'company_or_person', '' );
|
||||
|
||||
$organization_social_fields = [
|
||||
[
|
||||
'id' => 'facebook_site',
|
||||
'label' => __( 'Facebook Page URL', 'wordpress-seo' ),
|
||||
],
|
||||
[
|
||||
'id' => 'twitter_site',
|
||||
'label' => __( 'Twitter Username', 'wordpress-seo' ),
|
||||
],
|
||||
[
|
||||
'id' => 'instagram_url',
|
||||
'label' => __( 'Instagram URL', 'wordpress-seo' ),
|
||||
],
|
||||
[
|
||||
'id' => 'linkedin_url',
|
||||
'label' => __( 'LinkedIn URL', 'wordpress-seo' ),
|
||||
],
|
||||
[
|
||||
'id' => 'myspace_url',
|
||||
'label' => __( 'MySpace URL', 'wordpress-seo' ),
|
||||
],
|
||||
[
|
||||
'id' => 'pinterest_url',
|
||||
'label' => __( 'Pinterest URL', 'wordpress-seo' ),
|
||||
],
|
||||
[
|
||||
'id' => 'youtube_url',
|
||||
'label' => __( 'YouTube URL', 'wordpress-seo' ),
|
||||
],
|
||||
[
|
||||
'id' => 'wikipedia_url',
|
||||
'label' => __( 'Wikipedia URL', 'wordpress-seo' ),
|
||||
],
|
||||
];
|
||||
|
||||
$yform = Yoast_Form::get_instance();
|
||||
|
||||
if ( $company_or_person === 'person' ) {
|
||||
echo '<div class="paper tab-block">';
|
||||
echo '<h2><span class="dashicons dashicons-warning"></span> ' . esc_html__( 'Your website is currently configured to represent a Person', 'wordpress-seo' ) . '</h2>';
|
||||
echo '<p><em>';
|
||||
esc_html_e( 'That means that the form and information below is disabled, and not used.', 'wordpress-seo' );
|
||||
echo '</em></p>';
|
||||
echo '<p>';
|
||||
$user_id = WPSEO_Options::get( 'company_or_person_user_id', '' );
|
||||
$person = get_userdata( $user_id );
|
||||
printf(
|
||||
/* translators: 1: link to edit user page. */
|
||||
esc_html__( 'To change the social accounts used for your site, update the details for %1$s.', 'wordpress-seo' ),
|
||||
'<a href="' . esc_url( admin_url( 'user-edit.php?user_id=' . $user_id ) ) . '">' . esc_html( $person->display_name ) . '</a>'
|
||||
);
|
||||
echo ' ';
|
||||
printf(
|
||||
/* translators: 1: link tag to the relevant WPSEO admin page; 2: link close tag. */
|
||||
esc_html__( 'To make your site represent a Company or Organization go to %1$sSearch Appearance%2$s and set Organization or Person to "Organization".', 'wordpress-seo' ),
|
||||
'<a href="' . esc_url( admin_url( 'admin.php?page=wpseo_titles' ) ) . '">',
|
||||
'</a>'
|
||||
);
|
||||
echo '</p></div>';
|
||||
|
||||
// Organization social fields should still be rendered, because other wise the values are lost on save.
|
||||
foreach ( $organization_social_fields as $organization ) {
|
||||
$yform->hidden( $organization['id'] );
|
||||
}
|
||||
}
|
||||
|
||||
if ( $company_or_person === 'company' ) {
|
||||
echo '<h2 class="help-button-inline">' . esc_html__( 'Organization social profiles', 'wordpress-seo' ) . $social_profiles_help->get_button_html() . '</h2>';
|
||||
echo $social_profiles_help->get_panel_html();
|
||||
|
||||
foreach ( $organization_social_fields as $organization ) {
|
||||
$yform->textinput( $organization['id'], $organization['label'] );
|
||||
}
|
||||
}
|
||||
|
||||
do_action( 'wpseo_admin_other_section' );
|
||||
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
/**
|
||||
* WPSEO plugin file.
|
||||
*
|
||||
* @package WPSEO\Admin\Views
|
||||
*
|
||||
* @uses Yoast_Form $yform Form object.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPSEO_VERSION' ) ) {
|
||||
header( 'Status: 403 Forbidden' );
|
||||
header( 'HTTP/1.1 403 Forbidden' );
|
||||
exit();
|
||||
}
|
||||
|
||||
echo '<h2>' . esc_html__( 'Facebook settings', 'wordpress-seo' ) . '</h2>';
|
||||
|
||||
$yform->light_switch( 'opengraph', __( 'Add Open Graph meta data', 'wordpress-seo' ) );
|
||||
|
||||
?>
|
||||
<p>
|
||||
<?php
|
||||
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' );
|
||||
?>
|
||||
</p>
|
||||
|
||||
<div id="wpseo-opengraph-settings" style="display: none;">
|
||||
<?php
|
||||
|
||||
$yform->textinput( 'fbadminapp', __( 'Facebook App ID', 'wordpress-seo' ) );
|
||||
|
||||
if ( get_option( 'show_on_front' ) === 'posts' ) {
|
||||
$social_facebook_frontpage_help = new WPSEO_Admin_Help_Panel(
|
||||
'social-facebook-frontpage',
|
||||
esc_html__( 'Learn more about the title separator setting', 'wordpress-seo' ),
|
||||
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' ),
|
||||
'has-wrapper'
|
||||
);
|
||||
echo '<h2 class="help-button-inline">' . esc_html__( 'Frontpage settings', 'wordpress-seo' ) . $social_facebook_frontpage_help->get_button_html() . '</h2>';
|
||||
echo $social_facebook_frontpage_help->get_panel_html();
|
||||
|
||||
$yform->media_input( 'og_frontpage_image', __( 'Image URL', 'wordpress-seo' ) );
|
||||
$yform->textinput( 'og_frontpage_title', __( 'Title', 'wordpress-seo' ) );
|
||||
$yform->textinput( 'og_frontpage_desc', __( 'Description', 'wordpress-seo' ) );
|
||||
|
||||
$copy_home_description_button_label = esc_html__( 'Copy home meta description', 'wordpress-seo' );
|
||||
|
||||
// Offer copying of meta description.
|
||||
$homepage_meta_description = WPSEO_Options::get( 'metadesc-home-wpseo' );
|
||||
if ( ! empty( $homepage_meta_description ) ) {
|
||||
$copy_home_meta_desc_help = new WPSEO_Admin_Help_Panel(
|
||||
'copy-home-meda-desc',
|
||||
esc_html__( 'Help on copying the home meta description', 'wordpress-seo' ),
|
||||
sprintf(
|
||||
/* translators: 1: link open tag; 2: link close tag., 3: the translated label of the button */
|
||||
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' ),
|
||||
'<a href="' . esc_url( admin_url( 'admin.php?page=wpseo_titles' ) ) . '">',
|
||||
'</a>',
|
||||
$copy_home_description_button_label
|
||||
)
|
||||
);
|
||||
|
||||
echo '<input type="hidden" id="meta_description" value="', esc_attr( $homepage_meta_description ), '" />';
|
||||
echo '<div class="label desc copy-home-meta-description">' .
|
||||
'<button type="button" id="copy-home-meta-description" class="button">', $copy_home_description_button_label, '</button>' .
|
||||
$copy_home_meta_desc_help->get_button_html() .
|
||||
$copy_home_meta_desc_help->get_panel_html() .
|
||||
'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
echo '<h2>' . esc_html__( 'Default settings', 'wordpress-seo' ) . '</h2>';
|
||||
|
||||
$yform->media_input( 'og_default_image', __( 'Image URL', 'wordpress-seo' ) );
|
||||
|
||||
?>
|
||||
<p class="desc label">
|
||||
<?php esc_html_e( 'This image is used if the post/page being shared does not contain any images.', 'wordpress-seo' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
do_action( 'wpseo_admin_opengraph_section' );
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* WPSEO plugin file.
|
||||
*
|
||||
* @package WPSEO\Admin\Views
|
||||
*
|
||||
* @uses Yoast_Form $yform Form object.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPSEO_VERSION' ) ) {
|
||||
header( 'Status: 403 Forbidden' );
|
||||
header( 'HTTP/1.1 403 Forbidden' );
|
||||
exit();
|
||||
}
|
||||
|
||||
echo '<h2>' . esc_html__( 'Pinterest settings', 'wordpress-seo' ) . '</h2>';
|
||||
|
||||
printf(
|
||||
'<p>%s</p>',
|
||||
esc_html__( 'Pinterest uses Open Graph metadata just like Facebook, so be sure to keep the "Add Open Graph meta data" setting on the Facebook tab enabled if you want to optimize your site for Pinterest.', 'wordpress-seo' )
|
||||
);
|
||||
printf(
|
||||
'<p>%s</p>',
|
||||
esc_html__( 'If you have already confirmed your website with Pinterest, you can skip the step below.', 'wordpress-seo' )
|
||||
);
|
||||
|
||||
echo '<p>';
|
||||
printf(
|
||||
/* translators: %1$s / %2$s expands to a link to pinterest.com's help page. */
|
||||
esc_html__( 'To %1$sconfirm your site with Pinterest%2$s, add the meta tag here:', 'wordpress-seo' ),
|
||||
'<a target="_blank" href="https://www.pinterest.com/settings/claim">',
|
||||
'</a>'
|
||||
);
|
||||
echo '</p>';
|
||||
|
||||
$yform->textinput( 'pinterestverify', __( 'Pinterest confirmation', 'wordpress-seo' ) );
|
||||
|
||||
do_action( 'wpseo_admin_pinterest_section' );
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* WPSEO plugin file.
|
||||
*
|
||||
* @package WPSEO\Admin\Views
|
||||
*
|
||||
* @uses Yoast_Form $yform Form object.
|
||||
* @uses array WPSEO_Option_Social::$twitter_card_types
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPSEO_VERSION' ) ) {
|
||||
header( 'Status: 403 Forbidden' );
|
||||
header( 'HTTP/1.1 403 Forbidden' );
|
||||
exit();
|
||||
}
|
||||
|
||||
echo '<h2>' . esc_html__( 'Twitter settings', 'wordpress-seo' ) . '</h2>';
|
||||
|
||||
printf(
|
||||
'<p>%s</p>',
|
||||
esc_html__( 'Twitter uses Open Graph metadata just like Facebook, so be sure to keep the "Add Open Graph meta data" setting on the Facebook tab enabled if you want to optimize your site for Twitter.', 'wordpress-seo' )
|
||||
);
|
||||
|
||||
$yform->light_switch( 'twitter', __( 'Add Twitter card meta data', 'wordpress-seo' ), [], true, '', true );
|
||||
|
||||
echo '<p>';
|
||||
esc_html_e( 'Enable this feature if you want Twitter to display a preview with images and a text excerpt when a link to your site is shared.', 'wordpress-seo' );
|
||||
echo '</p>';
|
||||
|
||||
echo '<br />';
|
||||
|
||||
$yform->select( 'twitter_card_type', __( 'The default card type to use', 'wordpress-seo' ), WPSEO_Option_Social::$twitter_card_types );
|
||||
|
||||
do_action( 'wpseo_admin_twitter_section' );
|
||||
Reference in New Issue
Block a user