WordPress.org

Ready to get started?Download WordPress

Forums

Feature removal request: self-pingbacks (8 posts)

  1. Glowing Face Man
    Member
    Posted 4 years ago #

    Hi,

    It would be nice if we could turn off self-pingback. I'm constantly linking to my own articles. At least make it optional, controllable somewhere from wp-admin.

    Yes, there's a plugin to stop self-pinging, but I looked at how the plugin works and it seems it doesn't actually remove the pingbacks, just hides them (assuming I read the php correctly), which is obviously pretty suboptimal performance-wise!

    Thanks :)
    -Glowing Face Man

  2. I put this in my functions.php for the same effect:

    <?php
    /* No Frakin' Self Pings
    */
    function no_self_ping( &$links ) {
            $home = get_option( 'home' );
            foreach ( $links as $l => $link )
                    if ( 0 === strpos( $link, $home ) )
                            unset($links[$l]);
    }
    
    add_action( 'pre_ping', 'no_self_ping' );
    ?>
  3. Glowing Face Man
    Member
    Posted 4 years ago #

    Thanks. Is add_action also a non-standard addition? I added that at the end of functions.php and got a PHP error that add_action was undefined.

    -Glowing Face Man

  4. No, add_action is default to WP.

    http://codex.wordpress.org/Function_Reference/add_action

    What else is in your functions.php? Do you mind sharing?

  5. Glowing Face Man
    Member
    Posted 4 years ago #

    I haven't touched my functions.php. It's standard WordPress 2.8.5 (or whatever the latest release is).

    Fatal error: Call to undefined function add_action() in /home4/glowingf/public_html/blog/wp-includes/functions.php on line 3350

    Now I'm a little worried, if you're saying your snippet should work. Is something wrong with my intall..

    -Glowing Face Man

  6. Your functions.php is a theme file, not a 'standard wordpress' file :) I mean, it's standard but it's an optional file.

    About the theme functions file

    Remove the code from wp-includes/functions.php

    Put it in a NEW functions.php file in your THEME.

  7. ians
    Member
    Posted 4 years ago #

    somebody help me..

    when I activate my themes I got and error message

    Fatal error: Call to undefined function add_action() in /home/friendko/public_html/GRABANDDEV.COM/wordpress-themes/skincare/wp-includes/functions.php on line 3725

    tnx.

  8. ians, please make a new post for this problem, preferably in this forum: http://wordpress.org/support/forum/5

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.