PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-a.1
Jetpack – WP Security, Backup, Speed, & Growth v16.3-a.1
16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 13.9.2 14.0.1 14.1.1 All 503 releases
jetpack / extensions / blocks / instagram-gallery / instagram-gallery.php

instagram-gallery.php in Jetpack – WP Security, Backup, Speed, & Growth 16.3-a.1, at extensions/blocks/instagram-gallery/instagram-gallery.php

63 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Instagram Gallery Block.
4 *
5 * @since 8.5.0
6 *
7 * @package automattic/jetpack
8 */
9
10 namespace Automattic\Jetpack\Extensions\Instagram_Gallery;
11
12 use Automattic\Jetpack\Blocks;
13 use Automattic\Jetpack\External_Connections;
14 use Jetpack;
15
16 if ( ! defined( 'ABSPATH' ) ) {
17 exit( 0 );
18 }
19
20 /**
21 * Registers the block for use in Gutenberg
22 * This is done via an action so that we can disable
23 * registration if we need to.
24 */
25 function register_block() {
26 if ( ( defined( 'IS_WPCOM' ) && IS_WPCOM ) || Jetpack::is_connection_ready() ) {
27 Blocks::jetpack_register_block(
28 __DIR__,
29 array( 'render_callback' => __NAMESPACE__ . '\render_block' )
30 );
31
32 External_Connections::add_settings_for_service(
33 'writing',
34 array(
35 'service' => 'instagram-basic-display',
36 'title' => __( 'Instagram', 'jetpack' ),
37 'description' => __( 'Display your more recent images from Instagram.', 'jetpack' ),
38 'support_link' => array(
39 'wpcom' => 'https://wordpress.com/support/latest-instagram-posts/',
40 'jetpack' => 'latest-instagram-posts-block',
41 ),
42 )
43 );
44 }
45 }
46 add_action( 'init', __NAMESPACE__ . '\register_block' );
47
48 /**
49 * Instagram Gallery block render callback.
50 *
51 * The render implementation lives in render.php and is only loaded when the
52 * block is actually rendered, keeping it out of the eager front-end path.
53 *
54 * @param array $attributes Array containing the Instagram Gallery block attributes.
55 * @param string $content The Instagram Gallery block content.
56 *
57 * @return string
58 */
59 function render_block( $attributes, $content ) {
60 require_once __DIR__ . '/render.php';
61 return render_block_implementation( $attributes, $content );
62 }
63