Skip to content

Commit 7e8ae3c

Browse files
committedOct 4, 2014
Bring tests from wpcom and refactor for Jetpack.
Had to pull out the hashtags test because they're strictly disabled in this code. Also fixed audio and wpvideo ids that weren't being included in extract.
1 parent 76465a8 commit 7e8ae3c

File tree

4 files changed

+388
-10
lines changed

4 files changed

+388
-10
lines changed
 

‎class.media-extractor.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ class Jetpack_Media_Meta_Extractor {
2121
private static $KEEPER_SHORTCODES = array(
2222
'youtube',
2323
'vimeo',
24-
'hulu',
2524
'ted',
2625
'wpvideo',
26+
'audio',
2727
);
2828

2929
/**

‎modules/shortcodes.php

+16
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,22 @@ function jetpack_audio_atts_handler( $out, $pairs, $atts ) {
6868

6969
return $out;
7070
}
71+
72+
function jetpack_shortcode_get_audio_id( $atts ) {
73+
if ( isset( $atts[ 0 ] ) )
74+
return $atts[ 0 ];
75+
else
76+
return 0;
77+
}
78+
}
79+
80+
if ( ! function_exists( 'jetpack_shortcode_get_wpvideo_id' ) ) {
81+
function jetpack_shortcode_get_wpvideo_id( $atts ) {
82+
if ( isset( $atts[ 0 ] ) )
83+
return $atts[ 0 ];
84+
else
85+
return 0;
86+
}
7187
}
7288

7389
jetpack_load_shortcodes();

‎modules/videopress/videopress.php

-9
Original file line numberDiff line numberDiff line change
@@ -730,14 +730,5 @@ function videopress_shortcode_options( $options ) {
730730
}
731731
}
732732

733-
if ( !function_exists( 'jetpack_shortcode_get_wpvideo_id' ) ) :
734-
function jetpack_shortcode_get_wpvideo_id( $atts ) {
735-
if ( isset( $atts[0] ) )
736-
return $atts[0];
737-
else
738-
return 0;
739-
}
740-
endif;
741-
742733
// Initialize the module.
743734
Jetpack_VideoPress::init();

0 commit comments

Comments
 (0)