Jetpack_RelatedPosts::_enqueue_assets PHP Method

_enqueue_assets() protected method

Enqueues assets needed to do async loading of related posts.
protected _enqueue_assets ( $script, $style ) : null
return null
    protected function _enqueue_assets($script, $style)
    {
        if ($script) {
            wp_enqueue_script('jetpack_related-posts', plugins_url('related-posts.js', __FILE__), array('jquery'), self::VERSION);
            $related_posts_js_options = array('post_heading' => apply_filters('jetpack_relatedposts_filter_post_heading', esc_attr('h4')));
            wp_localize_script('jetpack_related-posts', 'related_posts_js_options', $related_posts_js_options);
        }
        if ($style) {
            if (is_rtl()) {
                wp_enqueue_style('jetpack_related-posts', plugins_url('rtl/related-posts-rtl.css', __FILE__), array(), self::VERSION);
            } else {
                wp_enqueue_style('jetpack_related-posts', plugins_url('related-posts.css', __FILE__), array(), self::VERSION);
            }
        }
    }