• We are working on an Image Injection plugin that allows the WordPress CMS owner to attach an image to a page that is simultaneously added to a gallery page. While attaching the image to the page we are trying to attache the permalink to the image as well so you can go from the gallery directly to the page in question. Somehow this is not working. This is part of the code we use to grab the page link:

    $sql=" SELECT id,imglink,pagelink,description FROM wp_plugin_x";
    $links=mysql_query($sql) or die(mysql_error()); //outer query to get the images
    while($link=mysql_fetch_object($links)) {
    list($buklug, $page_name ) = explode(".com", $link->pagelink);
    $page_name= str_replace("/", "", $page_name);
    $page_name= str_replace("_", " ", $page_name);

    Are there any WordPress variables or is there a way to grab the permalink from the database?

  • The topic ‘Image Injection plugin : Howto grab permalink?’ is closed to new replies.