
Tag: roofer


ync_Settings::is_sync_enabled() ) { $should_initialize = false; } } // Check if the site supports Blaze. if ( is_numeric( $site_id ) && ! self::site_supports_blaze( $site_id ) ) { $should_initialize = false; } /** * Filter to disable all Blaze functionality. * * @since 0.3.0 * * @param bool $should_initialize Whether Blaze should be enabled. Default to true. */ return apply_filters( 'jetpack_blaze_enabled', $should_initialize ); } /** * Adds the Promote link to the posts list row action. * * @param array $post_actions The current array of post actions. * @param WP_Post $post The current post in the post list table. * * @return array */ public static function jetpack_blaze_row_action( $post_actions, $post ) { $post_id = $post->ID; // Bail if we are not looking at one of the supported post types (post, page, or product). if ( ! in_array( $post->post_type, array( 'post', 'page', 'product' ), true ) ) { return $post_actions; } // Bail if the post is not published. if ( $post->post_status !== 'publish' ) { return $post_actions; } // Bail if the post has a password. if ( '' !== $post->post_password ) { return $post_actions; } // Might be useful to wrap in a method call for general use without post_id. $blaze_url = Redirect::get_url( 'jetpack-blaze', array( 'query' => 'blazepress-widget=post-' . esc_attr( $post_id ), ) ); // Add the link, make sure to tooltip hover. $text = _x( 'Blaze', 'Verb', 'jetpack-blaze' ); $title = _draft_or_post_title( $post ); /* translators: post title */ $label = sprintf( __( 'Blaze “%s” to Tumblr and WordPress.com audiences.', 'jetpack-blaze' ), $title ); $post_actions['blaze'] = sprintf( '%3$s', esc_url( $blaze_url ), esc_attr( $label ), esc_html( $text ) ); return $post_actions; } /** * Enqueue block editor assets. */ public static function enqueue_block_editor_assets() { /* * We do not want (nor need) Blaze in the site editor, or the widget editor, or the classic editor. * We only want it in the post editor. * Enqueueing the script in those editors would cause a fatal error. * See #20357 for more info. */ if ( ! function_exists( 'get_current_screen' ) ) { // When Gutenberg is loaded in the frontend. return; } $current_screen = get_current_screen(); if ( empty( $current_screen ) || $current_screen->base !== 'post' || ! $current_screen->is_block_editor() ) { return; } // Bail if criteria is not met to enable Blaze features. if ( ! self::should_initialize() ) { return; } Assets::register_script( self::SCRIPT_HANDLE, self::$script_path, __FILE__, array( 'enqueue' => true, 'in_footer' => true, 'textdomain' => 'jetpack-blaze', ) ); // Adds Connection package initial state. wp_add_inline_script( self::SCRIPT_HANDLE, Connection_Initial_State::render(), 'before' ); } }