Beispiel #1
0
 function P2_Mentions()
 {
     p2_maybe_define('P2_MENTIONS_TAXONOMY', 'mentions', 'p2_mentions_taxonomy');
     p2_maybe_define('P2_MENTIONS_SLUG', 'mentions', 'p2_mentions_slug');
     // Hooks
     add_action('init', array(&$this, 'init'), 0);
     add_filter('the_content', array(&$this, 'mention_links'), 5);
     add_filter('comment_text', array(&$this, 'mention_links'), 5);
     add_filter('p2_found_mentions', array(&$this, 'filter_mentions'), 5);
     parent::P2_Terms_In_Comments(P2_MENTIONS_TAXONOMY);
 }
Beispiel #2
0
<?php
/**
 * @package P2
 */

require_once( get_template_directory() . '/inc/utils.php' );

p2_maybe_define( 'P2_INC_PATH', get_template_directory()     . '/inc' );
p2_maybe_define( 'P2_INC_URL',  get_template_directory_uri() . '/inc' );
p2_maybe_define( 'P2_JS_PATH',  get_template_directory()     . '/js'  );
p2_maybe_define( 'P2_JS_URL',   get_template_directory_uri() . '/js'  );

class P2 {
	/**
	 * DB version.
	 *
	 * @var int
	 */
	var $db_version = 1;

	/**
	 * Options.
	 *
	 * @var array
	 */
	var $options = array();

	/**
	 * Option name in DB.
	 *
	 * @var string