summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/extensions/blocks/pinterest/pinterest.php')
-rw-r--r--plugins/jetpack/extensions/blocks/pinterest/pinterest.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/plugins/jetpack/extensions/blocks/pinterest/pinterest.php b/plugins/jetpack/extensions/blocks/pinterest/pinterest.php
new file mode 100644
index 00000000..a3b6e616
--- /dev/null
+++ b/plugins/jetpack/extensions/blocks/pinterest/pinterest.php
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Pinterest Block.
+ *
+ * @since 8.0.0
+ *
+ * @package Jetpack
+ */
+
+jetpack_register_block(
+ 'jetpack/pinterest',
+ array( 'render_callback' => 'jetpack_pinterest_block_load_assets' )
+);
+
+/**
+ * Pinterest block registration/dependency declaration.
+ *
+ * @param array $attr Array containing the Pinterest block attributes.
+ * @param string $content String containing the Pinterest block content.
+ *
+ * @return string
+ */
+function jetpack_pinterest_block_load_assets( $attr, $content ) {
+ wp_enqueue_script( 'pinterest-pinit', 'https://assets.pinterest.com/js/pinit.js', array(), JETPACK__VERSION, true );
+ return $content;
+}