Passed
Push — master ( b8b7ed...5ef01f )
by Chris
03:10
created
includes/helpers.php 1 patch
Braces   +23 added lines, -9 removed lines patch added patch discarded remove patch
@@ -844,11 +844,11 @@  discard block
 block discarded – undo
844 844
 	return $countries;
845 845
 }
846 846
 
847
-function monsterinsights_get_api_url(){
847
+function monsterinsights_get_api_url() {
848 848
 	return apply_filters( 'monsterinsights_get_api_url', 'api.monsterinsights.com/v2/' );
849 849
 }
850 850
 
851
-function monsterinsights_get_licensing_url(){
851
+function monsterinsights_get_licensing_url() {
852 852
 	return apply_filters( 'monsterinsights_get_licensing_url', 'https://www.monsterinsights.com' );
853 853
 }
854 854
 
@@ -917,7 +917,9 @@  discard block
 block discarded – undo
917 917
 	function remove_class_filter( $tag, $class_name = '', $method_name = '', $priority = 10 ) {
918 918
 		global $wp_filter;
919 919
 		// Check that filter actually exists first
920
-		if ( ! isset( $wp_filter[ $tag ] ) ) return FALSE;
920
+		if ( ! isset( $wp_filter[ $tag ] ) ) {
921
+			return FALSE;
922
+		}
921 923
 		/**
922 924
 		 * If filter config is an object, means we're using WordPress 4.7+ and the config is no longer
923 925
 		 * a simple array, rather it is an object that implements the ArrayAccess interface.
@@ -932,23 +934,35 @@  discard block
 block discarded – undo
932 934
 			$callbacks = &$wp_filter[ $tag ];
933 935
 		}
934 936
 		// Exit if there aren't any callbacks for specified priority
935
-		if ( ! isset( $callbacks[ $priority ] ) || empty( $callbacks[ $priority ] ) ) return FALSE;
937
+		if ( ! isset( $callbacks[ $priority ] ) || empty( $callbacks[ $priority ] ) ) {
938
+			return FALSE;
939
+		}
936 940
 		// Loop through each filter for the specified priority, looking for our class & method
937 941
 		foreach( (array) $callbacks[ $priority ] as $filter_id => $filter ) {
938 942
 			// Filter should always be an array - array( $this, 'method' ), if not goto next
939
-			if ( ! isset( $filter[ 'function' ] ) || ! is_array( $filter[ 'function' ] ) ) continue;
943
+			if ( ! isset( $filter[ 'function' ] ) || ! is_array( $filter[ 'function' ] ) ) {
944
+				continue;
945
+			}
940 946
 			// If first value in array is not an object, it can't be a class
941
-			if ( ! is_object( $filter[ 'function' ][ 0 ] ) ) continue;
947
+			if ( ! is_object( $filter[ 'function' ][ 0 ] ) ) {
948
+				continue;
949
+			}
942 950
 			// Method doesn't match the one we're looking for, goto next
943
-			if ( $filter[ 'function' ][ 1 ] !== $method_name ) continue;
951
+			if ( $filter[ 'function' ][ 1 ] !== $method_name ) {
952
+				continue;
953
+			}
944 954
 			// Method matched, now let's check the Class
945 955
 			if ( get_class( $filter[ 'function' ][ 0 ] ) === $class_name ) {
946 956
 				// Now let's remove it from the array
947 957
 				unset( $callbacks[ $priority ][ $filter_id ] );
948 958
 				// and if it was the only filter in that priority, unset that priority
949
-				if ( empty( $callbacks[ $priority ] ) ) unset( $callbacks[ $priority ] );
959
+				if ( empty( $callbacks[ $priority ] ) ) {
960
+					unset( $callbacks[ $priority ] );
961
+				}
950 962
 				// and if the only filter for that tag, set the tag to an empty array
951
-				if ( empty( $callbacks ) ) $callbacks = array();
963
+				if ( empty( $callbacks ) ) {
964
+					$callbacks = array();
965
+				}
952 966
 				// If using WordPress older than 4.7
953 967
 				if ( ! is_object( $wp_filter[ $tag ] ) ) {
954 968
 					// Remove this filter from merged_filters, which specifies if filters have been sorted
Please login to merge, or discard this patch.