WPSEO_Admin_Banner_Spot_Renderer

Represents the render object for generating the html for the given banner spot.

Defined (1)

The class is defined in the following location(s).

/admin/banner/class-admin-banner-spot-renderer.php  
  1. class WPSEO_Admin_Banner_Spot_Renderer { 
  2.  
  3. /** 
  4. * Renders the admin banner spot. 
  5. * @param WPSEO_Admin_Banner_Spot $banner_spot The spot to render. 
  6. * @return string 
  7. */ 
  8. public function render( WPSEO_Admin_Banner_Spot $banner_spot ) { 
  9. $output = '<div class="yoast-sidebar__spot">'; 
  10. if ( $banner_spot->get_title() !== '' ) { 
  11. $output .= '<strong>' . $banner_spot->get_title() . '</strong>'; 
  12.  
  13. if ( $banner_spot->get_extra() !== '' ) { 
  14. $output .= $banner_spot->get_extra(); 
  15.  
  16. if ( $banner_spot->get_description() !== '' ) { 
  17. $output .= '<p>' . $banner_spot->get_description() . '</p>'; 
  18.  
  19. $output .= $banner_spot->render_banner(); 
  20. $output .= '</div>'; 
  21.  
  22. return $output;