Skip to content

Commit

Permalink
Fixes #58
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitpokhrel committed Aug 15, 2017
1 parent 9d1627b commit 99ae583
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dynamic-featured-image.php
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ public function save_meta( $post_id ) {

// Check permission before saving data.
if ( current_user_can( 'edit_posts', $post_id ) && isset( $_POST['dfiFeatured'] ) ) { // WPCS: CSRF ok.
$featured_images = is_array( $_POST['dfiFeatured'] ) ? $_POST['dfiFeatured'] : []; // WPCS: sanitization ok, CSRF ok.
$featured_images = is_array( $_POST['dfiFeatured'] ) ? $_POST['dfiFeatured'] : array(); // WPCS: sanitization ok, CSRF ok.

update_post_meta( $post_id, 'dfiFeatured', $this->sanitize_array( $featured_images ) );
}
Expand All @@ -560,7 +560,7 @@ public function save_meta( $post_id ) {
* @return array
*/
protected function sanitize_array( $input_array ) {
$sanitized = [];
$sanitized = array();

foreach ( $input_array as $value ) {
$sanitized[] = sanitize_text_field( wp_unslash( $value ) );
Expand Down Expand Up @@ -861,7 +861,7 @@ public function get_post_attachment_ids( $post_id ) {
if ( ! empty( $dfi_images ) && is_array( $dfi_images ) ) {
foreach ( $dfi_images as $dfi_image ) {
$dfi_image_full = $this->separate( $dfi_image, 'full' );
$ret_val[] = (int) $this->get_image_id( $this->upload_url . $dfi_image_full );
$ret_val[] = (int) $this->get_image_id( $this->upload_url . $dfi_image_full );
}
}

Expand Down

0 comments on commit 99ae583

Please sign in to comment.