Completed
Push — master ( b3d566...cca2a2 )
by
unknown
06:29
created
public/includes/wrap-shortcodes.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@  discard block
 block discarded – undo
3 3
  * Wraps shortcodes of other Plugins in prep for later replacement on save to preserve the shortcodes
4 4
  */
5 5
 
6
-if ( lasso_user_can( 'edit_posts' ) && ! is_admin() ) {
7
-	add_filter( 'the_content', 'lasso_wrap_shortcodes', 9 );
6
+if (lasso_user_can('edit_posts') && !is_admin()) {
7
+	add_filter('the_content', 'lasso_wrap_shortcodes', 9);
8 8
 }
9 9
 
10 10
 /**
@@ -17,33 +17,33 @@  discard block
 block discarded – undo
17 17
  *
18 18
  * @return string
19 19
  */
20
-function lasso_wrap_shortcodes( $content ) {
20
+function lasso_wrap_shortcodes($content) {
21 21
 	global $shortcode_tags;
22 22
 
23
-	if ( false === strpos( $content, '[' ) ) {
23
+	if (false === strpos($content, '[')) {
24 24
 		return $content;
25 25
 	}
26 26
 
27
-	if ( empty( $shortcode_tags ) || ! is_array( $shortcode_tags ) ) {
27
+	if (empty($shortcode_tags) || !is_array($shortcode_tags)) {
28 28
 		return $content;
29 29
 	}
30 30
 
31
-	$tagnames  = array_keys( $shortcode_tags );
32
-	$tagregexp = join( '|', array_map( 'preg_quote', $tagnames ) );
31
+	$tagnames  = array_keys($shortcode_tags);
32
+	$tagregexp = join('|', array_map('preg_quote', $tagnames));
33 33
 	$pattern   = "/\\[($tagregexp)/s";
34 34
 
35
-	if ( 1 !== preg_match( $pattern, $content ) ) {
35
+	if (1 !== preg_match($pattern, $content)) {
36 36
 		// Avoids parsing HTML when there are no shortcodes or embeds anyway.
37 37
 		return $content;
38 38
 	}
39 39
 
40
-	$content = do_shortcodes_in_html_tags( $content, true ,$tagnames);
40
+	$content = do_shortcodes_in_html_tags($content, true, $tagnames);
41 41
 
42 42
 	$pattern = get_shortcode_regex();
43
-	$content = preg_replace_callback( "/$pattern/s", 'lasso_wrap_shortcode_tag', $content );
43
+	$content = preg_replace_callback("/$pattern/s", 'lasso_wrap_shortcode_tag', $content);
44 44
 
45 45
 	// Always restore square braces so we don't break things like <!--[if IE ]>
46
-	$content = unescape_invalid_shortcodes( $content );
46
+	$content = unescape_invalid_shortcodes($content);
47 47
 
48 48
 	return $content;
49 49
 }
@@ -57,15 +57,15 @@  discard block
 block discarded – undo
57 57
  *
58 58
  * @return string
59 59
  */
60
-function lasso_wrap_shortcode_tag( $m ) {
60
+function lasso_wrap_shortcode_tag($m) {
61 61
 	// allow [[foo]] syntax for escaping a tag
62
-	if ( $m[1] == '[' && $m[6] == ']' ) {
63
-		return substr( $m[0], 1, - 1 );
62
+	if ($m[1] == '[' && $m[6] == ']') {
63
+		return substr($m[0], 1, - 1);
64 64
 	}
65 65
 
66
-	if ( strpos( $m[2], 'aesop_' ) === 0 ) {
66
+	if (strpos($m[2], 'aesop_') === 0) {
67 67
 		return $m[0];
68 68
 	}
69 69
 
70
-	return '<!--EDITUS_OTHER_SHORTCODE_START|[' . $m[0] . ']-->' . $m[0] . '<!--EDITUS_OTHER_SHORTCODE_END-->';
70
+	return '<!--EDITUS_OTHER_SHORTCODE_START|['.$m[0].']-->'.$m[0].'<!--EDITUS_OTHER_SHORTCODE_END-->';
71 71
 }
72 72
\ No newline at end of file
Please login to merge, or discard this patch.