• I have in the article a link like this:

    Go to the link

    Go to the link is the same for all the article, only change the link source…is possible extract with a filter or i don’t know the link and insert it in the post-meta ?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Marcomail

    (@marcomail)

    why this code didn’t work ? I’m trying to capture the text between “_”

    function updateAutoMetaData($id) {
    global $autometa;

    $current = get_post_meta($id, $autometa["name"]);

    if (!isset($current) || (sizeof($current)==0)) {
    //prepare the content
    // $article = strip_tags($post->post_content);

    $article = preg_match("#_(.*)_#", $_POST['content'], $article);

    $meta_exists=update_post_meta($id, $autometa["name"], $article);
    if(!$meta_exists) {
    add_post_meta($id, $autometa["name"], $article);
    }
    }
    }

    Thread Starter Marcomail

    (@marcomail)

    ok, i’ve solved….but why when i use doesn’t work:

    preg_match(“#<a href=\”(.*)#”, $_POST[‘content’], $article);

    if i delete \” the script works but it includes also the ” before the url…i would capture only the url

    Thread Starter Marcomail

    (@marcomail)

    bump

    Thread Starter Marcomail

    (@marcomail)

    up

    Thread Starter Marcomail

    (@marcomail)

    bump

    Thread Starter Marcomail

    (@marcomail)

    bump, any idea ?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘extract the link from an article’ is closed to new replies.