| @@ -6,10 +6,8 @@ | ||
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | namespace Timetics\Base; |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; | |
| 11 | - | |
| 12 | 10 | use Timetics\Base\ForwardCalls; |
| 13 | 11 | |
| 14 | 12 | /** |
| 15 | 13 | * Class Post Model |
| @@ -48,9 +46,8 @@ | ||
| 48 | 46 | if ( isset( $this->data[$name] ) ) { |
| 49 | 47 | return $this->data[$name]; |
| 50 | 48 | } |
| 51 | 49 | |
| 52 | - /* translators: %s: Property name */ | |
| 53 | 50 | throw new \Exception( sprintf( esc_html__( 'Undefined property %s', 'timetics' ), esc_attr( $name ) ) ); |
| 54 | 51 | } |
| 55 | 52 | |
| 56 | 53 | /** |
| @@ -62,9 +59,8 @@ | ||
| 62 | 59 | * @return void |
| 63 | 60 | */ |
| 64 | 61 | public function __set( $key, $value ) { |
| 65 | 62 | if ( ! isset( $this->data[$key] ) ) { |
| 66 | - /* translators: %s: Property name */ | |
| 67 | 63 | throw new \Exception( sprintf( esc_html__( 'Undefined property %s', 'timetics' ), esc_attr( $key ) ) ); |
| 68 | 64 | } |
| 69 | 65 | |
| 70 | 66 | $this->data[$key] = $value; |
| @@ -162,9 +158,8 @@ | ||
| 162 | 158 | ]; |
| 163 | 159 | |
| 164 | 160 | if ( $meta ) { |
| 165 | 161 | $meta['relation'] = 'AND'; |
| 166 | - // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query -- Meta query is necessary for filtering posts by meta fields | |
| 167 | 162 | $args['meta_query'] = $meta; |
| 168 | 163 | } |
| 169 | 164 | |
| 170 | 165 | $posts = get_posts( $args ); |