| @@ -23,13 +23,9 @@ | ||
| 23 | 23 | if ( $text !== '' ) { |
| 24 | 24 | $atts = shortcode_parse_atts( $text ); |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - if ( ! is_array( $atts ) ) { | |
| 28 | - return array(); | |
| 29 | - } | |
| 30 | - | |
| 31 | - return $atts; | |
| 27 | + return is_array( $atts ) ? $atts : array(); | |
| 32 | 28 | } |
| 33 | 29 | |
| 34 | 30 | /** |
| 35 | 31 | * Returns shortcodes that are shown/hidden based on the context. |
| @@ -72,12 +68,11 @@ | ||
| 72 | 68 | * |
| 73 | 69 | * @return array |
| 74 | 70 | */ |
| 75 | 71 | public static function get_contextual_codes() { |
| 76 | - $contextual_shortcodes = self::get_contextual_shortcodes(); | |
| 77 | - $result = array(); | |
| 72 | + $result = array(); | |
| 78 | 73 | |
| 79 | - foreach ( $contextual_shortcodes as $type => $shortcodes ) { | |
| 74 | + foreach ( self::get_contextual_shortcodes() as $type => $shortcodes ) { | |
| 80 | 75 | $result[ $type ] = array_keys( $shortcodes ); |
| 81 | 76 | } |
| 82 | 77 | |
| 83 | 78 | return $result; |