PageRenderTime 14ms CodeModel.GetById 9ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/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/**
 9 * Represents the render object for generating the html for the given banner spot.
10 */
11class WPSEO_Admin_Banner_Spot_Renderer {
12
13	/**
14	 * Renders the admin banner spot.
15	 *
16	 * @param WPSEO_Admin_Banner_Spot $banner_spot The spot to render.
17	 *
18	 * @return string
19	 */
20	public function render( WPSEO_Admin_Banner_Spot $banner_spot ) {
21		$output = '<div class="yoast-sidebar__spot">';
22		if ( $banner_spot->get_title() !== '' ) {
23			$output .= '<strong>' . $banner_spot->get_title() . '</strong>';
24		}
25
26		if ( $banner_spot->get_extra() !== '' ) {
27			$output .= $banner_spot->get_extra();
28		}
29
30		if ( $banner_spot->get_description() !== '' ) {
31			$output .= '<p>' . $banner_spot->get_description() . '</p>';
32		}
33
34		$output .= $banner_spot->render_banner();
35		$output .= '</div>';
36
37		return $output;
38	}
39}