Skip to content

Instantly share code, notes, and snippets.

@weskoop
Forked from pippinsplugins/gist:3843128
Created October 6, 2012 00:00
Show Gist options
  • Save weskoop/3843153 to your computer and use it in GitHub Desktop.
Save weskoop/3843153 to your computer and use it in GitHub Desktop.
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
Copy link
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