Skip to content

Commit

Permalink
Added efn_reset short code for manually resetting plug
Browse files Browse the repository at this point in the history
Added efn_reset short code for manually resetting plug, which resolves the issue of references duplicating with certain plug-ins.

See jasonyingling#9 for more information.
  • Loading branch information
ericraider33 committed Sep 24, 2021
1 parent 3c71d7c commit 0e4bfd6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions easy-footnotes.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public function __construct() {
add_option( 'easy_footnotes_options', $this->footnoteSettings );
add_shortcode( 'note', array( $this, 'easy_footnote_shortcode' ) );
add_shortcode( 'efn_note', array( $this, 'easy_footnote_shortcode' ) );
add_shortcode( 'efn_reset', array( $this, 'short_code_reset' ) );
add_filter( 'the_content', array( $this, 'easy_footnote_after_content' ), 20 );
add_filter( 'the_content', array( $this, 'easy_footnote_reset' ), 999 );
add_action( 'wp_enqueue_scripts', array( $this, 'register_qtip_scripts' ) );
Expand Down Expand Up @@ -241,6 +242,15 @@ public function easy_footnotes_admin_scripts() {
wp_enqueue_style( 'easy-footnotes-admin-styles', plugins_url( '/assets/easy-footnotes-admin.css', __FILE__ ), '', '1.0.13' );
wp_enqueue_script( 'easy-footnotes-admin-scripts', plugins_url( '/assets/js/easy-footnotes-admin.js', __FILE__ ), array( 'jquery' ), '1.0.1', true );
}

/**
* Manually reset footnotes and counter
*/
public function short_code_reset() {
$this->footnoteCount = 0;
$this->footnotes = array();
return "";
}
}

$easyFootnotes = new easyFootnotes();

0 comments on commit 0e4bfd6

Please sign in to comment.