fix sanitization
This commit is contained in:
parent
f3d2243afb
commit
9559a089be
1 changed files with 3 additions and 2 deletions
|
@ -107,7 +107,7 @@ class Followers {
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'single' => true,
|
'single' => true,
|
||||||
'sanitize_callback' => function( $value ) {
|
'sanitize_callback' => function( $value ) {
|
||||||
return esc_sql( $value );
|
return sanitize_text_field( $value );
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@ -315,9 +315,10 @@ class Followers {
|
||||||
|
|
||||||
$args = wp_parse_args( $args, $defaults );
|
$args = wp_parse_args( $args, $defaults );
|
||||||
$query = new WP_Query( $args );
|
$query = new WP_Query( $args );
|
||||||
|
$posts = $query->get_posts();
|
||||||
$items = array();
|
$items = array();
|
||||||
|
|
||||||
foreach ( $query->get_posts() as $post ) {
|
foreach ( $posts as $post ) {
|
||||||
$items[] = Follower::init_from_cpt( $post ); // phpcs:ignore
|
$items[] = Follower::init_from_cpt( $post ); // phpcs:ignore
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue