| @@ -36,9 +36,9 @@ | ||
| 36 | 36 | add_action( 'pre_get_posts', [ $this, 'sortable_columns_query' ] ); |
| 37 | 37 | add_filter( 'template_include', [ $this, 'builder_template' ], 99 ); |
| 38 | 38 | |
| 39 | 39 | add_filter( 'parse_query', [ $this, 'query_filter' ] ); |
| 40 | - // add filter for search | |
| 40 | + // add filter for search. | |
| 41 | 41 | add_action( 'restrict_manage_posts', [ $this, 'add_filter' ] ); |
| 42 | 42 | |
| 43 | 43 | add_action( 'in_admin_header', [ $this, 'remove_all_notices' ], 1000 ); |
| 44 | 44 | |
| @@ -54,12 +54,12 @@ | ||
| 54 | 54 | public function add_filter() { |
| 55 | 55 | |
| 56 | 56 | global $typenow; |
| 57 | 57 | |
| 58 | - if ( $typenow != BuilderFns::$post_type_tb ) { | |
| 58 | + if ( BuilderFns::$post_type_tb != $typenow ) { | |
| 59 | 59 | return; |
| 60 | 60 | } |
| 61 | - // phpcs:ignore WordPress.Security.NonceVerification.Recommended. No need nonce. | |
| 61 | + // phpcs:ignore WordPress.Security.NonceVerification.Recommended | |
| 62 | 62 | $selected = isset( $_GET['type'] ) ? sanitize_key( $_GET['type'] ) : ''; |
| 63 | 63 | $builder_page_types = BuilderFns::builder_page_types(); |
| 64 | 64 | ?> |
| 65 | 65 | <select name="template_type" id="type"> |
| @@ -196,9 +196,9 @@ | ||
| 196 | 196 | |
| 197 | 197 | switch ( $column ) { |
| 198 | 198 | case 'type': |
| 199 | 199 | $the_type = ! empty( $types[ $type ] ) ? esc_html( ucwords( $types[ $type ] ) ) : ''; |
| 200 | - echo apply_filters( 'rtsb/columns/template/types/text', $the_type, $type, $post_id ); | |
| 200 | + Fns::print_html( apply_filters( 'rtsb/columns/template/types/text', $the_type, $type, $post_id ) ); | |
| 201 | 201 | break; |
| 202 | 202 | case 'edit_with': |
| 203 | 203 | $edit_by = Fns::page_edit_with( $post_id ); |
| 204 | 204 | echo esc_html( ucfirst( $edit_by ) ); |
| @@ -291,13 +291,14 @@ | ||
| 291 | 291 | |
| 292 | 292 | if ( ! is_admin() || ! $this->is_current_screen() || ! empty( $query->query_vars['meta_key'] ) ) { |
| 293 | 293 | return; |
| 294 | 294 | } |
| 295 | + // phpcs:ignore WordPress.Security.NonceVerification.Recommended | |
| 295 | 296 | $type = isset( $_GET['template_type'] ) ? sanitize_key( $_GET['template_type'] ) : ''; |
| 296 | 297 | |
| 297 | 298 | if ( '' != $type && 'all' != $type ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 298 | 299 | $query->query_vars['meta_key'] = BuilderFns::template_type_meta_key(); // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_key |
| 299 | - $query->query_vars['meta_value'] = $type; | |
| 300 | + $query->query_vars['meta_value'] = $type; // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_value | |
| 300 | 301 | $query->query_vars['meta_compare'] = '='; |
| 301 | 302 | } |
| 302 | 303 | } |
| 303 | 304 | |