Skip to content

Commit

Permalink
Rename the shortcode to smartframe
Browse files Browse the repository at this point in the history
  • Loading branch information
alshakero committed Sep 21, 2021
1 parent b5fa482 commit 7719df8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions projects/plugins/jetpack/modules/shortcodes/smartframe.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}

/**
* Register smartframe as oembed provider. Add filter to reverse iframes to shortcode. Register [jetpack_smartframe] shortcode.
* Register smartframe as oembed provider. Add filter to reverse iframes to shortcode. Register [smartframe] shortcode.
*
* @since 10.2.0
*/
Expand All @@ -27,7 +27,7 @@ function jetpack_smartframe_enable_embeds() {
add_filter( 'pre_kses', 'jetpack_shortcodereverse_smartframe' );

// Actually display the smartframe Embed.
add_shortcode( 'jetpack_smartframe', 'jetpack_smartframe_shortcode' );
add_shortcode( 'smartframe', 'jetpack_smartframe_shortcode' );
}

/**
Expand Down Expand Up @@ -59,7 +59,7 @@ function jetpack_shortcodereverse_smartframe( $content ) {
continue;
}
$shortcode = sprintf(
'[jetpack_smartframe script-id="%1$s" image-id="%2$s"%3$s]',
'[smartframe script-id="%1$s" image-id="%2$s"%3$s]',
esc_attr( $match[1] ),
esc_attr( $match[2] ),
! empty( $match[3] ) ? ' max-width="' . esc_attr( $match[3] ) . '"' : ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class WP_Test_Jetpack_Shortcodes_SmartFrame extends WP_UnitTestCase {
const SMARTFRAME_IDENTIFIER = 'mantymetsa_1630927773870';
const SMARTFRAME_SCRIPT_ID = '6ae67829d1264ee0ea6071a788940eae';

const SMARTFRAME_SHORTCODE = '[jetpack_smartframe script-id="6ae67829d1264ee0ea6071a788940eae" image-id="mantymetsa_1630927773870" max-width="1412px"]';
const SMARTFRAME_SHORTCODE = '[smartframe script-id="6ae67829d1264ee0ea6071a788940eae" image-id="mantymetsa_1630927773870" max-width="1412px"]';
// phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript
const SMARTFRAME_EMBED = '<script src="https://embed.smartframe.io/6ae67829d1264ee0ea6071a788940eae.js" data-image-id="mantymetsa_1630927773870" data-width="100%" data-max-width="1412px"></script>';

Expand Down Expand Up @@ -62,12 +62,12 @@ public function smartframe_oembed_response( $html, $url ) {
}

/**
* Verify that [jetpack_smartframe] exists.
* Verify that [smartframe] exists.
*
* @since 10.2.0
*/
public function test_shortcodes_smartframe_exists() {
$this->assertEquals( shortcode_exists( 'jetpack_smartframe' ), true );
$this->assertEquals( shortcode_exists( 'smartframe' ), true );
}

/**
Expand Down Expand Up @@ -111,7 +111,7 @@ public function test_smartframe_reverse_shortcode() {
public function test_shortcodes_smartframe_image_via_oembed_http_request() {
$image_id = self::SMARTFRAME_IDENTIFIER;
$script_id = self::SMARTFRAME_SCRIPT_ID;
$content = "[jetpack_smartframe script-id='$script_id' image-id='$image_id']";
$content = "[smartframe script-id='$script_id' image-id='$image_id']";
$shortcode_content = do_shortcode( $content );

$this->assertContains( $image_id, $shortcode_content );
Expand Down

0 comments on commit 7719df8

Please sign in to comment.