Title: why this plugin doesn&#8217;t work ???
Last modified: August 18, 2016

---

# why this plugin doesn’t work ???

 *  [Marcomail](https://wordpress.org/support/users/marcomail/)
 * (@marcomail)
 * [19 years, 4 months ago](https://wordpress.org/support/topic/why-this-plugin-doesnt-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)

 *  Thread Starter [Marcomail](https://wordpress.org/support/users/marcomail/)
 * (@marcomail)
 * [19 years, 4 months ago](https://wordpress.org/support/topic/why-this-plugin-doesnt-work/#post-494583)
 * Now it works, how can i return the content of the meta data in the wp loop, i
   try to use return in the bottom of the function but did’nt return anything….
 *  `function updatersslink() {`
 *  global $post;
 *  preg_match('#Original link <a href="(.*)">#', $post->post_content, $rect);
 *  $current = get_post_meta($post->ID, 'rsslink');
 *  if (!isset($current) || (sizeof($current)==0)) {
    add_post_meta($post->ID, '
   rsslink', $rect[1]); } else { update_post_meta($post->ID, 'rsslink', $rect[1]);}}
 *  return 'sda79fa7fdfa95taf' ;
 * ?>

Viewing 1 replies (of 1 total)

The topic ‘why this plugin doesn’t work ???’ is closed to new replies.

## Tags

 * [WPadvanced](https://wordpress.org/support/topic-tag/wpadvanced/)

 * 1 reply
 * 1 participant
 * Last reply from: [Marcomail](https://wordpress.org/support/users/marcomail/)
 * Last activity: [19 years, 4 months ago](https://wordpress.org/support/topic/why-this-plugin-doesnt-work/#post-494583)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
