Skip to content

Commit

Permalink
Merge pull request #24 from jasonyingling/release/1.1.9
Browse files Browse the repository at this point in the history
Release/1.1.9
  • Loading branch information
jasonyingling authored Nov 12, 2024
2 parents 73a09eb + 2be9c96 commit dc15a5d
Show file tree
Hide file tree
Showing 2 changed files with 17 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 @@ -63,6 +63,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 );

Expand Down Expand Up @@ -300,6 +301,15 @@ public function easy_footnotes_admin_scripts() {
public function efn_load_textdomain() {
load_plugin_textdomain( 'easy-footnotes', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
}

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

$easyFootnotes = new easyFootnotes();
7 changes: 7 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ Place the following code in your functions.php file to disable the qTip features
add_action( 'wp_enqueue_scripts', 'efn_deregister_scripts' );</code>
</pre>

= How can I reset the footnote count? =

Use on the beginning of your page with the short code: `[efn_reset][/efn_reset]`

This is a hard reset to fix a bug with themes/plugins using `do_shortcode( get_the_content() )` outside the main loop and causing duplicate footnotes. 1.1.9 should have updates to not require this.

== Screenshots ==

1. Displaying a footnote on hover.
Expand All @@ -74,6 +80,7 @@ add_action( 'wp_enqueue_scripts', 'efn_deregister_scripts' );</code>
* Adds support for duplicate footnotes using the same number
* Fixes a bug with multiple footnotes showing at the bottom when do_shortcode() is run on the_content outside the main loop.
* Add better i18n support for the plugin
* Adds [efn_reset] shortcode to reset the footnote count

= 1.1.8 =
* WordPress 6.6 support
Expand Down

0 comments on commit dc15a5d

Please sign in to comment.