$default_style ), $annie_attributes ) ); $hilight_text = ''. $annieText .''; $this->highlightText[] = $annieText; // Take care of any nested shortcodes $hilight_text = do_shortcode($hilight_text); $this->showToolbox = true; return $hilight_text; } public function footnote_shortcode($annie_attributes, $annieText = '') { global $post, $tippy; // Store the text in our array $this->footnoteText[$this->footcount] = $annieText; // No markup for footnotes; just the text. $annieShortcodeText = do_shortcode($annieText); $annie_cleanText = $annieShortcodeText; // $annie_cleanText = str_replace('[', '{', $annie_cleanText); // Format the footnote reference if (is_object($tippy) && get_option('annie_footnoteDisplay', 'link') == 'tooltip') { $annie_footnoteLink = get_permalink($post->ID) ."#foot_text_". $post->ID . "_". $this->footcount; $annie_tippyValues = array( 'header' => 'off', 'title' => $this->footcount, 'href' => $annie_footnoteLink, 'text' => $annie_cleanText, 'class' => 'annie_footnoteRef annie_custom', 'item' => 'foot_tip_'. $post->ID . "_". $this->footcount, 'useDiv' => true ); $annie_returnLink = $tippy->getLink($annie_tippyValues); $annie_returnLink = str_replace('ID . '_'. $this->footcount .'" class="annie_footnoteRef annie_custom" title="'. $annie_cleanText .'" href="'. get_permalink($post->ID) .'#foot_text_'. $post->ID . '_'. $this->footcount .'">'. $this->footcount .''; } $this->footcount++; $this->showToolbox = true; return $annie_returnLink; } public function footnote_display_shortcode($annie_attributes = '', $annie_text = '') { $annie_returnText = $this->process_content(''); $this->footnotesShowing = true; return $annie_returnText; } public // Handle extras when showing content function process_content($content) { global $post, $is_page_val; if (!$this->footnotesShowing && (is_single() || $is_page_val) && get_option('annie_footnoteShowNotes', 'show') == 'show' && sizeof($this->footnoteText) > 0) { $footnoteHeader = get_option('annie_footnoteNotesHeader', 'Notes:'); $content .= '
'. $footnoteHeader .'
'; foreach ($this->footnoteText as $footnoteIndex => $footnoteText) { $content .= "\n"; $content .= '
'. $footnoteIndex .'. '. $footnoteText .'
'; $content .= "\n"; } $content .= '
'; } $this->footnoteText = array(); $this->footcount = 1; return $content; } public function toolbox() { if (sizeof($this->highlightText) > 0) { $this->show_toolbox(); echo '
'; // Output the div with highlights foreach ($this->highlightText as $discard => $annie_text) { echo $annie_text ."

"; } echo '
'; } } public function show_toolbox() { if (!$this->toolboxShowing && get_option('annie_showToolbox', 'true') == "true") { // Toolbox code $annie_toolboxMarkup = '
Hide Highlights Read Highlighted Text
«
'; echo $annie_toolboxMarkup; $this->toolboxShowing = true; } } public function load_scripts() { // Load jQuery, if not already present wp_enqueue_script('jquery'); // Load the Tippy script wp_register_script('Annie', plugins_url() .'/annie/annie.js', array('jquery')); wp_enqueue_script('Annie'); } public function load_styles() { wp_register_style('Annie', plugins_url() .'/annie/annie.css'); wp_enqueue_style('Annie'); } public function load_for_admin() { echo ''; } public function load_globals() { $this->is_page_val = is_page(); } } $annie = new Annie(); ?>