/** * __construct function. * * @access public * @return void */ function __construct() { self::$instance = $this; add_action('init', array($this, 'init')); // set the default wiki embed value if the once from the Options are not set $this->options = shortcode_atts($this->default_settings(), get_option('wikiembed_options')); $this->wikiembeds = get_option('wikiembeds'); // we might not need to load this here at all... $this->content_count = 0; $this->version = WIKI_EMBED_VERSION; // display a page when you are clicked from a wiki page add_action('template_redirect', array($this, 'load_page')); add_filter('posts_join', array($this, 'search_metadata_join')); add_filter('posts_where', array($this, 'search_metadata_where')); add_filter('sf_posts_query', array($this, 'search_metadata_ajaxy')); }
/** * This is the callback function for ubcar-map-view.js's display_point() * AJAX request, retrieving a wiki page's html if UBC CTLT's Wiki Embed * plugin is enabled or the wiki page's URL if it is not. * * @access public * @return void */ function ubcar_get_wiki_page() { $ubcar_media_id = $_POST['ubcar_wiki_id']; $ubcar_media_meta = get_post_meta($ubcar_media_id, 'ubcar_media_meta', true); $ubcar_media_url = html_entity_decode($ubcar_media_meta["url"]); if (class_exists('Wiki_Embed')) { $wiki_html = new Wiki_Embed(); echo $wiki_html->shortcode(array('url' => $ubcar_media_url)); } else { $no_wiki_html = array('url' => $ubcar_media_url); wp_send_json($no_wiki_html); } die; }