Getting the following php error when trying to add a new post:
Warning: array_pop() expects parameter 1 to be array, boolean given in
/home/mysite/public_html/blog/wp-content/themes/mytheme/functions.php
on line 675
Here is the function:
function glossary_term_permalink($post_link, $post, $leavename, $sample) {
if (false !== strpos($post_link, '%recipe_cat%')) {
$glossary_letter = get_the_terms($post->ID, 'recipe_cat');
$post_link = str_replace('%recipe_cat%', array_pop($glossary_letter)->slug, $post_link);
}
return $post_link;
}
Any idea what the issue is and how to resolve?