WordPress.org

Forums

Snoopy-Class (4 posts)

  1. notame
    Member
    Posted 8 years ago #

    In ./wp-includes/class-snoopy.php
    you guys put the original Snoopy-Class into

    if ( !in_array('Snoopy', get_declared_classes() ) ) :
    class Snoopy() {}
    endif;

    I think putting this "enclosure" directly into the rss-functions.php would be way more convinient, because when you write a plugin and want to use Snoopy-Class, one has to upload a "clean" version of Snoopy-Class additionally, because even though PHP knows that the class is not included yet (checked the if statement), it won't initialize the class...

    don't ask me why, it just does not.

    thanks,
    Notame

  2. Michael Bishop

    Posted 8 years ago #

    I've tagged this post for advanced users, but you may find this discussion getting more traction on the wp-hackers mail list.

    http://lists.automattic.com/mailman/listinfo/wp-hackers

  3. Brian Layman
    Member
    Posted 8 years ago #

    Yes, this is a perfect WP-(core)Hackers question

  4. Michael_
    Member
    Posted 8 years ago #

    notame, I use the Snoopy class in my plugin Simple Trackback Validition and use the following function to load the Snoopy class:

    function stbv_loadSnoopy() {
    if ( !class_exists('Snoopy') ) {

    if (@include_once( ABSPATH . WPINC . '/class-snoopy.php' )) {
    return true;
    } else {
    return false;
    }
    } else {
    return true;
    }
    }

    This works perfect and no problem arised so far.

Topic Closed

This topic has been closed to new replies.

About this Topic