/wp-content/plugins/wordpress-seo/admin/banner/class-admin-banner-spot-renderer.php

https://bitbucket.org/carloskikea/helpet · PHP · 39 lines · 18 code · 6 blank · 15 comment · 3 complexity · f33bff4fe027aebd3eec1610dfabf394 MD5 · raw file

  1. <?php
  2. /**
  3. * WPSEO plugin file.
  4. *
  5. * @package WPSEO\Admin\Banner
  6. */
  7. /**
  8. * Represents the render object for generating the html for the given banner spot.
  9. */
  10. class WPSEO_Admin_Banner_Spot_Renderer {
  11. /**
  12. * Renders the admin banner spot.
  13. *
  14. * @param WPSEO_Admin_Banner_Spot $banner_spot The spot to render.
  15. *
  16. * @return string
  17. */
  18. public function render( WPSEO_Admin_Banner_Spot $banner_spot ) {
  19. $output = '<div class="yoast-sidebar__spot">';
  20. if ( $banner_spot->get_title() !== '' ) {
  21. $output .= '<strong>' . $banner_spot->get_title() . '</strong>';
  22. }
  23. if ( $banner_spot->get_extra() !== '' ) {
  24. $output .= $banner_spot->get_extra();
  25. }
  26. if ( $banner_spot->get_description() !== '' ) {
  27. $output .= '<p>' . $banner_spot->get_description() . '</p>';
  28. }
  29. $output .= $banner_spot->render_banner();
  30. $output .= '</div>';
  31. return $output;
  32. }
  33. }