content-copyright.php 982 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * Template part for displaying the content footer.
  4. *
  5. * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
  6. *
  7. * @package Pen
  8. */
  9. ob_start( 'trim' );
  10. if ( pen_option_get( 'footer_copyright_display' ) ) {
  11. ?>
  12. <div class="site-info">
  13. <?php
  14. $copyright = pen_option_get( 'footer_copyright_text' );
  15. /* Translators: Please refer to the PHP documentation for the date() function. */
  16. $copyright = str_ireplace( '%YEAR%', date_i18n( esc_html__( 'Y', 'pen' ) ), $copyright );
  17. $copyright = str_ireplace( '%SITE_NAME%', get_bloginfo( 'name' ), $copyright );
  18. $site_url = home_url();
  19. $copyright = str_ireplace( '%SITE_URL%', $site_url, $copyright );
  20. if ( $copyright ) {
  21. echo wp_kses( $copyright, wp_kses_allowed_html( 'post' ) );
  22. } else {
  23. printf(
  24. '&copy; %1$s. %2$s',
  25. esc_html( get_bloginfo( 'name' ) ),
  26. esc_html__( 'All rights reserved.', 'pen' )
  27. );
  28. }
  29. ?>
  30. </div><!-- .site-info -->
  31. <?php
  32. }
  33. echo ob_get_clean(); /* phpcs:ignore */