Code Duplication    Length = 21-24 lines in 2 locations

modules/shortcodes.php 1 location

@@ 41-64 (lines=24) @@
38
	return str_replace( array( '&', '&' ), '&', $str );
39
}
40
41
function jetpack_load_shortcodes() {
42
	global $wp_version;
43
44
	$shortcode_includes = array();
45
46
	foreach ( Jetpack::glob_php( dirname( __FILE__ ) . '/shortcodes' ) as $file ) {
47
		$shortcode_includes[] = $file;
48
	}
49
50
/**
51
 * This filter allows other plugins to override which shortcodes Jetpack loads.
52
 *
53
 * @module shortcodes
54
 *
55
 * @since 2.2.1
56
 *
57
 * @param array $shortcode_includes An array of which shortcodes to include.
58
 */
59
	$shortcode_includes = apply_filters( 'jetpack_shortcodes_to_include', $shortcode_includes );
60
61
	foreach ( $shortcode_includes as $include ) {
62
		include $include;
63
	}
64
}
65
66
/**
67
 * Runs preg_replace so that replacements don't happen within open tags.

modules/widgets.php 1 location

@@ 13-33 (lines=21) @@
10
 * Additional Search Queries: widget, widgets, facebook, gallery, twitter, gravatar, image, rss
11
 */
12
13
function jetpack_load_widgets() {
14
	$widgets_include = array();
15
16
	foreach ( Jetpack::glob_php( dirname( __FILE__ ) . '/widgets' ) as $file ) {
17
		$widgets_include[] = $file;
18
	}
19
	/**
20
	 * Modify which Jetpack Widgets to register.
21
	 *
22
	 * @module widgets
23
	 *
24
	 * @since 2.2.1
25
	 *
26
	 * @param array $widgets_include An array of widgets to be registered.
27
	 */
28
	$widgets_include = apply_filters( 'jetpack_widgets_to_include', $widgets_include );
29
30
	foreach( $widgets_include as $include ) {
31
		include $include;
32
	}
33
}
34
35
add_action( 'jetpack_modules_loaded', 'jetpack_widgets_loaded' );
36