Cannot redeclare has_shortcode WP 3.6.1
-
Hi there,
I’ve read some topics here about function has_shortcode creating an error once updating to wordpress 3.6.1 ,.. i’ve found the piece of code causing it in functions.php of my theme.
However i need this code so i can’t just comment it out i decide it’s redundant. Can someone tell me how it should be rewritten?Here it is:
// check the current post for the existence of a short code function has_shortcode($shortcode = '') { $post_to_check = get_post(get_the_ID()); // false because we have to search through the post content first $found = false; // if no short code was provided, return false if (!$shortcode) { return $found; } // check the post content for the short code if ( stripos($post_to_check->post_content, '[' . $shortcode) !== false ) { // we have found the short code $found = true; } // return our final results return $found; }?>Thanks a lot!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘Cannot redeclare has_shortcode WP 3.6.1’ is closed to new replies.