Jetpack_RelatedPosts::get_target_html PHP Метод

get_target_html() публичный Метод

Returns the HTML for the related posts section.
public get_target_html ( )
    public function get_target_html()
    {
        require_once JETPACK__PLUGIN_DIR . '/sync/class.jetpack-sync-settings.php';
        if (Jetpack_Sync_Settings::is_syncing()) {
            return '';
        }
        $options = $this->get_options();
        if ($options['show_headline']) {
            $headline = sprintf('<h3 class="jp-relatedposts-headline"><em>%s</em></h3>', esc_html__('Related', 'jetpack'));
        } else {
            $headline = '';
        }
        /**
         * Filter the Related Posts headline.
         *
         * @module related-posts
         *
         * @since 3.0.0
         *
         * @param string $headline Related Posts heading.
         */
        $headline = apply_filters('jetpack_relatedposts_filter_headline', $headline);
        if ($this->_previous_post_id) {
            $exclude = "data-exclude='{$this->_previous_post_id}'";
        } else {
            $exclude = "";
        }
        return <<<EOT
<div id='jp-relatedposts' class='jp-relatedposts' {$exclude}>
\t{$headline}
</div>
EOT;
    }