media-content.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /**
  3. * WPSEO plugin file.
  4. *
  5. * @package WPSEO\Admin\Views\Media
  6. *
  7. * @var Yoast_Form $yform
  8. */
  9. $wpseo_post_type = get_post_type_object( 'attachment' );
  10. $recommended_replace_vars = new WPSEO_Admin_Recommended_Replace_Vars();
  11. $editor_specific_replace_vars = new WPSEO_Admin_Editor_Specific_Replace_Vars();
  12. $view_utils = new Yoast_View_Utils();
  13. ?>
  14. <p><strong><?php esc_html_e( 'We recommend you set this to Yes.', 'wordpress-seo' ); ?></strong></p>
  15. <?php
  16. $yform->toggle_switch(
  17. 'disable-attachment',
  18. array(
  19. 'on' => __( 'Yes', 'wordpress-seo' ),
  20. 'off' => __( 'No', 'wordpress-seo' ),
  21. ),
  22. __( 'Redirect attachment URLs to the attachment itself?', 'wordpress-seo' )
  23. );
  24. ?>
  25. <div id="media_settings">
  26. <br/>
  27. <br/>
  28. <?php
  29. $noindex_option_name = 'noindex-' . $wpseo_post_type->name;
  30. if ( WPSEO_Options::get( 'is-media-purge-relevant' ) && WPSEO_Options::get( $noindex_option_name ) === false ) {
  31. $description = sprintf(
  32. /* translators: %1$s expands to the link to the article, %2$s closes the link to the article */
  33. esc_html( __( 'By enabling this option, attachment URLs become visible to both your visitors and Google.
  34. To add value to your website, they should contain useful information, or they might have a
  35. negative impact on your ranking. Please carefully consider this and %1$sread this post%2$s if
  36. you want more information about the impact of showing media in search results.', 'wordpress-seo'
  37. ) ),
  38. '<a href="' . esc_url( WPSEO_Shortlinker::get( 'https://yoa.st/2r8' ) ) . '" rel="noopener noreferrer" target="_blank">',
  39. '</a>'
  40. );
  41. echo '<div style="clear:both; background-color: #ffeb3b; color: #000000; padding: 16px; max-width: 450px; margin-bottom: 32px;">' . $description . '</div>';
  42. }
  43. require dirname( __FILE__ ) . '/post_type/post-type.php';
  44. ?>
  45. </div>