accounts.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <?php
  2. /**
  3. * WPSEO plugin file.
  4. *
  5. * @package WPSEO\Admin\Views
  6. *
  7. * @uses Yoast_Form $yform Form object.
  8. */
  9. if ( ! defined( 'WPSEO_VERSION' ) ) {
  10. header( 'Status: 403 Forbidden' );
  11. header( 'HTTP/1.1 403 Forbidden' );
  12. exit();
  13. }
  14. $social_profiles_help = new WPSEO_Admin_Help_Panel(
  15. 'social-accounts',
  16. __( 'Learn more about your social profiles settings', 'wordpress-seo' ),
  17. __( 'To let search engines know which social profiles are associated to this site, enter your site social profiles data below.', 'wordpress-seo' ) . ' ' .
  18. __( 'If a Wikipedia page for you or your organization exists, add it too.', 'wordpress-seo' ),
  19. 'has-wrapper'
  20. );
  21. $company_or_person = WPSEO_Options::get( 'company_or_person', '' );
  22. $organization_social_fields = [
  23. [
  24. 'id' => 'facebook_site',
  25. 'label' => __( 'Facebook Page URL', 'wordpress-seo' ),
  26. ],
  27. [
  28. 'id' => 'twitter_site',
  29. 'label' => __( 'Twitter Username', 'wordpress-seo' ),
  30. ],
  31. [
  32. 'id' => 'instagram_url',
  33. 'label' => __( 'Instagram URL', 'wordpress-seo' ),
  34. ],
  35. [
  36. 'id' => 'linkedin_url',
  37. 'label' => __( 'LinkedIn URL', 'wordpress-seo' ),
  38. ],
  39. [
  40. 'id' => 'myspace_url',
  41. 'label' => __( 'MySpace URL', 'wordpress-seo' ),
  42. ],
  43. [
  44. 'id' => 'pinterest_url',
  45. 'label' => __( 'Pinterest URL', 'wordpress-seo' ),
  46. ],
  47. [
  48. 'id' => 'youtube_url',
  49. 'label' => __( 'YouTube URL', 'wordpress-seo' ),
  50. ],
  51. [
  52. 'id' => 'wikipedia_url',
  53. 'label' => __( 'Wikipedia URL', 'wordpress-seo' ),
  54. ],
  55. ];
  56. $yform = Yoast_Form::get_instance();
  57. if ( $company_or_person === 'person' ) {
  58. echo '<div class="paper tab-block">';
  59. echo '<h2><span class="dashicons dashicons-warning"></span> ' . esc_html__( 'Your website is currently configured to represent a Person', 'wordpress-seo' ) . '</h2>';
  60. echo '<p><em>';
  61. esc_html_e( 'That means that the form and information below is disabled, and not used.', 'wordpress-seo' );
  62. echo '</em></p>';
  63. echo '<p>';
  64. $user_id = WPSEO_Options::get( 'company_or_person_user_id', '' );
  65. $person = get_userdata( $user_id );
  66. printf(
  67. /* translators: 1: link to edit user page. */
  68. esc_html__( 'To change the social accounts used for your site, update the details for %1$s.', 'wordpress-seo' ),
  69. '<a href="' . esc_url( admin_url( 'user-edit.php?user_id=' . $user_id ) ) . '">' . esc_html( $person->display_name ) . '</a>'
  70. );
  71. echo ' ';
  72. printf(
  73. /* translators: 1: link tag to the relevant WPSEO admin page; 2: link close tag. */
  74. 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' ),
  75. '<a href="' . esc_url( admin_url( 'admin.php?page=wpseo_titles' ) ) . '">',
  76. '</a>'
  77. );
  78. echo '</p></div>';
  79. // Organization social fields should still be rendered, because other wise the values are lost on save.
  80. foreach ( $organization_social_fields as $organization ) {
  81. $yform->hidden( $organization['id'] );
  82. }
  83. }
  84. if ( $company_or_person === 'company' ) {
  85. echo '<h2 class="help-button-inline">' . esc_html__( 'Organization social profiles', 'wordpress-seo' ) . $social_profiles_help->get_button_html() . '</h2>';
  86. echo $social_profiles_help->get_panel_html();
  87. foreach ( $organization_social_fields as $organization ) {
  88. $yform->textinput( $organization['id'], $organization['label'] );
  89. }
  90. }
  91. do_action( 'wpseo_admin_other_section' );