media-content.php 1.9 KB

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