Skip to content

Instantly share code, notes, and snippets.

@pippinsplugins
Created October 5, 2012 23:50
Show Gist options
  • Save pippinsplugins/3843128 to your computer and use it in GitHub Desktop.
Save pippinsplugins/3843128 to your computer and use it in GitHub Desktop.
//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;
}
@remkus
Copy link

remkus commented Oct 6, 2012

At least they to the nesting part right..

@remkus
Copy link

remkus commented Oct 6, 2012

Just like I got the spelling right. -> At least they got the nesting part right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment