| @@ -14,10 +14,8 @@ | ||
| 14 | 14 | */ |
| 15 | 15 | |
| 16 | 16 | namespace FloatMenuLite\Publish; |
| 17 | 17 | |
| 18 | -use FloatMenuLite\WOWP_Plugin; | |
| 19 | - | |
| 20 | 18 | defined( 'ABSPATH' ) || exit; |
| 21 | 19 | |
| 22 | 20 | class Display { |
| 23 | 21 | |
| @@ -27,12 +25,8 @@ | ||
| 27 | 25 | if ( self::can_abort_early( $id, $param ) ) { |
| 28 | 26 | return false; |
| 29 | 27 | } |
| 30 | 28 | |
| 31 | - if ( ! isset( $param['show'] ) ) { | |
| 32 | - return false; | |
| 33 | - } | |
| 34 | - | |
| 35 | 29 | return self::check_shows( $param['show'], $param ); |
| 36 | 30 | } |
| 37 | 31 | |
| 38 | 32 | private static function can_abort_early( $id, $param ): bool { |
| @@ -40,9 +34,8 @@ | ||
| 40 | 34 | } |
| 41 | 35 | |
| 42 | 36 | private static function check_shows( $showParams, $param ): bool { |
| 43 | 37 | |
| 44 | - | |
| 45 | 38 | foreach ( $showParams as $i => $show ) { |
| 46 | 39 | |
| 47 | 40 | if ( self::is_match( $show, $i, $param ) ) { |
| 48 | 41 | return true; |
| @@ -57,11 +50,8 @@ | ||
| 57 | 50 | $cases = [ |
| 58 | 51 | 'everywhere' => 'check_everywhere', |
| 59 | 52 | ]; |
| 60 | 53 | |
| 61 | - $cases = apply_filters( WOWP_Plugin::PREFIX . '_pro_match_cases', $cases ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound | |
| 62 | - | |
| 63 | - | |
| 64 | 54 | if ( ! isset( $cases[ $show ] ) ) { |
| 65 | 55 | return false; |
| 66 | 56 | } |
| 67 | 57 | |
| @@ -66,18 +56,13 @@ | ||
| 66 | 56 | } |
| 67 | 57 | |
| 68 | 58 | $function = $cases[ $show ]; |
| 69 | 59 | |
| 70 | - if ( method_exists( __CLASS__, $function ) ) { | |
| 71 | - return self::$function( $i, $param ); | |
| 72 | - } | |
| 60 | + return self::$function( $i, $param ); | |
| 73 | 61 | |
| 74 | - return apply_filters( WOWP_Plugin::PREFIX . "_pro_match_callback_{$function}", false, $i, $param ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound | |
| 75 | - | |
| 76 | 62 | } |
| 77 | 63 | |
| 78 | 64 | private static function check_everywhere(): bool { |
| 79 | 65 | return true; |
| 80 | 66 | } |
| 81 | - | |
| 82 | 67 | |
| 83 | 68 | } |