get_template(); } } return $block_template; } /** * Returns a custom template for the floating Subscribe button. * * @return WP_Block_Template */ public function get_template() { $template = new WP_Block_Template(); $template->theme = get_stylesheet(); $template->slug = self::BLOCK_TEMPLATE_PART_SLUG; $template->id = self::get_block_template_part_id(); $template->area = 'uncategorized'; $template->content = $this->get_floating_subscribe_button_template_content(); $template->source = 'plugin'; $template->type = 'wp_template_part'; $template->title = __( 'Jetpack Subscribe floating button', 'jetpack' ); $template->status = 'publish'; $template->has_theme_file = false; $template->is_custom = true; $template->description = __( 'A floating subscribe button that shows up when someone visits your site.', 'jetpack' ); return $template; } /** * Returns the initial content of the floating Subscribe button template. * This can then be edited by the user. * * @return string */ public function get_floating_subscribe_button_template_content() { $block_name = esc_attr__( 'Floating subscribe button', 'jetpack' ); return ''; } /** * Enqueues styles. * * @return void */ public function enqueue_assets() { if ( $this->should_user_see_floating_button() ) { wp_enqueue_style( 'subscribe-floating-button-css', plugins_url( 'subscribe-floating-button.css', __FILE__ ), array(), JETPACK__VERSION ); // Disables WP.com action bar as the features collide/overlap add_filter( 'wpcom_disable_logged_out_follow', '__return_true', 10, 1 ); } } /** * Adds floating Subscribe button HTML wrapper * * @return void */ public function add_subscribe_floating_button_to_frontend() { if ( $this->should_user_see_floating_button() ) { ?>