Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
That's better!
//get the review type based on page custom meta field
function oswc_get_review_meta($postid) {
//try every reasonble conceivable variation that the user my enter to make this as user friendly as possible
$postTypeName = get_post_meta($postid, "Review Type", $single = true);
if(empty($postTypeName)){
$postTypeName = get_post_meta($postid, "review type", $single = true);
if(empty($postTypeName)){
$postTypeName = get_post_meta($postid, "reviewtype", $single = true);
if(empty($postTypeName)){
$postTypeName = get_post_meta($postid, "Reviewtype", $single = true);
if(empty($postTypeName)){
$postTypeName = get_post_meta($postid, "ReviewType", $single = true);
if(empty($postTypeName)){
$postTypeName = get_post_meta($postid, "Review type", $single = true);
if(empty($postTypeName)){
$postTypeName = get_post_meta($postid, "review Type", $single = true);
if(empty($postTypeName)){
$postTypeName = get_post_meta($postid, "Post Type", $single = true);
if(empty($postTypeName)){
$postTypeName = get_post_meta($postid, "post type", $single = true);
if(empty($postTypeName)){
$postTypeName = get_post_meta($postid, "review_type", $single = true);
if(empty($postTypeName)){
$postTypeName = get_post_meta($postid, "Review_Type", $single = true);
if(empty($postTypeName)){
$postTypeName = get_post_meta($postid, "Review_type", $single = true);
if(empty($postTypeName)){
$postTypeName = get_post_meta($postid, "review-type", $single = true);
if(empty($postTypeName)){
$postTypeName = get_post_meta($postid, "Review-Type", $single = true);
if(empty($postTypeName)){
$postTypeName = get_post_meta($postid, "Review-type", $single = true);
if(empty($postTypeName)){
$postTypeName = get_post_meta($postid, "post_type", $single = true);
if(empty($postTypeName)){
$postTypeName = get_post_meta($postid, "Post_Type", $single = true);
if(empty($postTypeName)){
$postTypeName = get_post_meta($postid, "Post_type", $single = true);
if(empty($postTypeName)){
$postTypeName = get_post_meta($postid, "post-type", $single = true);
if(empty($postTypeName)){
$postTypeName = get_post_meta($postid, "Post-Type", $single = true);
if(empty($postTypeName)){
$postTypeName = get_post_meta($postid, "Post-type", $single = true);
if(empty($postTypeName)){
$postTypeName = get_post_meta($postid, "Reviews Type", $single = true);
if(empty($postTypeName)){
$postTypeName = get_post_meta($postid, "reviews type", $single = true);
if(empty($postTypeName)){
$postTypeName = get_post_meta($postid, "Reviews type", $single = true);
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
return $postTypeName;
}
@weskoop

This comment has been minimized.

Copy link
Owner Author

weskoop commented Oct 6, 2012

lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.