/**
  * Returns an instance.
  *
  * If an instance exists, this returns it.  If not, it creates one and
  * retuns it.
  *
  * @since 1.5.1
  *
  * @return object
  */
 public static function get_instance()
 {
     if (!self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
Exemple #2
0
	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program; if not, write to the Free Software
	Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/
/**
 * Security Note: Blocks direct access to the plugin PHP files.
 */
defined('ABSPATH') or die('No script kiddies please!');
// Define constants.
if (!defined('ZEROSPAM_ROOT ')) {
    define('ZEROSPAM_ROOT', plugin_dir_path(__FILE__));
}
if (!defined('ZEROSPAM_PLUGIN ')) {
    define('ZEROSPAM_PLUGIN', __FILE__);
}
/**
 * Used to detect installed plugins.
 */
include_once ABSPATH . 'wp-admin/includes/plugin.php';
/**
 * Include the Zero Spam class.
 */
require_once ZEROSPAM_ROOT . 'lib/zero-spam.class.php';
// Initialize the Zero Spam class.
$zero_spam = Zero_Spam::get_instance();