Skip to content
Browse files

validate $post_parent later, after check to see if current page

  • Loading branch information...
1 parent 4330858 commit e62554fd123eab5c457b3110cb006ce823e46a5e @billerickson committed Oct 8, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 display-posts-shortcode.php
View
4 display-posts-shortcode.php
@@ -72,7 +72,7 @@ function be_display_posts_shortcode( $atts ) {
$include_excerpt = (bool)$atts['include_excerpt'];
$order = sanitize_key( $atts['order'] );
$orderby = sanitize_key( $atts['orderby'] );
- $post_parent = intval( $atts['post_parent'] );
+ $post_parent = $atts['post_parent']; // Validated later, after check for 'current'
$post_type = sanitize_text_field( $atts['post_type'] );
$posts_per_page = intval( $atts['posts_per_page'] );
$tag = sanitize_text_field( $atts['tag'] );
@@ -128,7 +128,7 @@ function be_display_posts_shortcode( $atts ) {
global $post;
$post_parent = $post->ID;
}
- $args['post_parent'] = $post_parent;
+ $args['post_parent'] = intval( $post_parent );
}
// Set up html elements used to wrap the posts.

0 comments on commit e62554f

Please sign in to comment.
Something went wrong with that request. Please try again.