Function returning: Warning: Missing argument 1
-
Hey there guys!
I wrote this couple of functions, that alternate a exploded Custom Field string with the post permalink:(where the Custom Field should look like this: ex. Google++https://google.com”)
// Custom Permalink function custom_permalink($url){ global $post; $link = get_post_meta($post->ID,'link',true); if ($link) { $pieces = explode("++", $link); $url = $pieces[1]; } else { $url = the_permalink(); } return $url; } // Via Text function via_text($url){ global $post; $link = get_post_meta($post->ID,'link',true); if ($link) { $pieces = explode("++", $link); $url = ' <span><a href="'.$pieces[1].'">Via '.$pieces[0].'</a></span>'; } else { $url = ' '; } return $url; }
… which work all right when tested on a MAMP server, but when deployed they return:
“Warning: Missing argument 1 …”
Any idea why this might be happening?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Function returning: Warning: Missing argument 1’ is closed to new replies.