示例#1
0
                return;
            }
            // Return early if not on the right feed.
            if (strpos($url, 'planet.wordpress.org') === false) {
                return;
            }
            // Only move forward if this action hasn't been done already.
            if (!$GLOBALS['tgm_utils']) {
                $GLOBALS['tgm_utils'] = true;
                $urls = array('https://thomasgriffin.io/feed/planet/', $url);
                $feed->set_feed_url($urls);
            }
        }
        /**
         * Returns the singleton instance of the class.
         *
         * @since 1.0.0
         *
         * @return object The TGM_Utils object.
         */
        public static function get_instance()
        {
            if (!isset(self::$instance) && !self::$instance instanceof TGM_Utils) {
                self::$instance = new TGM_Utils();
            }
            return self::$instance;
        }
    }
    // Load the utils.
    $tgm_utils_class = TGM_Utils::get_instance();
}