why this plugin doesn’t work ???
-
function updatelink($id) {
preg_match('#See the link <a href=(.*)>#', $_POST['content'], $rect);
$current = get_post_meta($id, 'link');
if (!isset($current) || (sizeof($current)==0)) {
add_post_meta($id, 'link', $rect[1]);
}
else {
update_post_meta($id, 'link', $rect[1]);
}
}add_action('save_post', 'updatersslink');
i would capture a link when post is saved….but the preg match didn’t work good.
if i use in preg_match “a href=(.*)>” i capture the link with \”…if i use “a href=\”(.*)\”>” the script doesn’t capture anything…
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘why this plugin doesn’t work ???’ is closed to new replies.