WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Call to undefined function wp_insert_link()

[Resolved] Call to undefined function wp_insert_link()

  • when people try and post comments to my site, including me, i get the message:

    Fatal error: Call to undefined function wp_insert_link() in /home2/public_html/What.the/wp-content/themes/cherryblossom-10/functions.php(395) : eval()’d code on line 6

    now i have no idea where this eval() thing on line 6 is, or what that even means, i even tried to REdefine wp_insert_link().. by copying and pasting the code from wordpress includes or where ever it is…. i mean of course its not found in the functions.php file, it’s defined somewhere else… do anybody know what to do about this error, it’s not the theme’s fault people told me they were getting errors, and there’s another one they get, and i get too, ‘we don’t allow comment spam, you have to use javascript to leave a comment’… now what the heck is that supposed to me??? you use text to leave a comment!!! any help would be appreciated!! 🙂

Viewing 11 replies - 1 through 11 (of 11 total)
  • whooami

    @whooami

    Member

    where did you download that theme from (full url to the download page please). I just downloaded it from one site and the theme’s function.php is empty.

    i found the source of the call to the function, it was in some encrypted php at the bottom of functions.php… i decoded it and the call was there, but when i tried to delete the encrypted stuff, it didn’t work, so i noticed it gave me an error about the header, so i went to the header file and took out <?php wp_head(); ?> and i stopped getting the first error, but i still get the second error about comment spam if i try to post two comments.. is there a setting for time between comments somewhere?

    in some encrypted php at the bottom of functions.php

    Ouch. Sounds like you got a hacked theme. Might want to deal with that and get a fresh original copy from somewhere.

    NEVER use a theme with encrypted code in it.

    i downloaded it from hereeeeeeeeeee the files not empty for me.. thanks for trying to help me 🙂

    ok i will try and get a fresh copy… thanks so much!!

    whooami

    @whooami

    Member

    ahhh, well I would shitcan that one, and grab it from here:

    http://www.wpthemesfree.com/view.php?theme_id=107

    empty functions.php, not guarantees on anything else. Thats what happens with these 3rd party sites that scrape themes.

    Hah. I decoded that bit and found this:

    add_action("edit_post","insert_theme_link");
    function insert_theme_link() {
    	global $wpdb;
    	if($wpdb->get_var("SELECT COUNT(link_id) FROM $wpdb->links WHERE link_url='http://www.amazingwordpressthemes.com/'")==0)
    		wp_insert_link(array("link_name" => "WordPress Themes", "link_url" => "http://www.amazingwordpressthemes.com/" ));
    }

    What an amazingly jackass thing for a site to add to a theme. It automatically adds link to your links table. Same as Write->Link.

    I would not currently trust any sites with a lot of themes except for the official one:
    http://wordpress.org/extend/themes/

    so i don’t have to worrry about right? i can just leave the code there, and not ‘call’ it in the header? because i went to the author’s site and her link to the template just takes me to the wordpress theme directory, the NEW one, and it’s not in there, and i don’t remember how to get to the old one, do you? 🙂 oh ok, i looked for it on the site whooami gave me and found it, i will download it from there and start over… thanks for your help!!! 🙂

    No. Delete that code. Do not leave it there.

    yeah? i went to try to delete it and it was already gone! maybe disappeared when i took out that call in the header?

    found some more encrypted code in the footer, but i was just able to delete it… thanks for all your help guys!!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘[Resolved] Call to undefined function wp_insert_link()’ is closed to new replies.
Skip to toolbar