/admin/banner/class-admin-banner-spot-renderer.php

  1. <?php 
  2. /** 
  3. * @package WPSEO\Admin\Banner 
  4. */ 
  5.  
  6. /** 
  7. * Represents the render object for generating the html for the given banner spot. 
  8. */ 
  9. class WPSEO_Admin_Banner_Spot_Renderer { 
  10.  
  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.  
  32. return $output; 
.