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...