Yoast\WP\SEO\Presenters\Admin
Badge_Presenter::present()
Presents the New Badge. If a link has been passed, the badge is presented with the link. Otherwise a static badge is presented.
Метод класса: Badge_Presenter{}
Хуков нет.
Возвращает
Строку
. The styled New Badge.
Использование
$Badge_Presenter = new Badge_Presenter(); $Badge_Presenter->present();
Код Badge_Presenter::present() Badge Presenter::present Yoast 24.1
public function present() { if ( ! $this->is_group_still_new() ) { return ''; } if ( $this->link !== '' ) { return \sprintf( '<a class="yoast-badge yoast-badge__is-link yoast-new-badge" id="%1$s-new-badge" href="%2$s">%3$s</a>', \esc_attr( $this->id ), \esc_url( $this->link ), \esc_html__( 'New', 'wordpress-seo' ) ); } return \sprintf( '<span class="yoast-badge yoast-new-badge" id="%1$s-new-badge">%2$s</span>', \esc_attr( $this->id ), \esc_html__( 'New', 'wordpress-seo' ) ); }