Changeset 3024987
- Timestamp:
- 01/22/2024 09:12:23 AM (2 years ago)
- Location:
- footnotes-made-easy/trunk
- Files:
-
- 7 edited
-
classes/class-footnotes-made-easy.php (modified) (1 diff)
-
classes/controllers/class-footnotes-formatter.php (modified) (6 diffs)
-
classes/helpers/class-settings.php (modified) (3 diffs)
-
classes/migration/class-abstract-migration.php (modified) (1 diff)
-
classes/migration/class-migration.php (modified) (1 diff)
-
footnotes-made-easy.php (modified) (4 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
footnotes-made-easy/trunk/classes/class-footnotes-made-easy.php
r3019096 r3024987 4 4 * 5 5 * @package fme 6 * @copyright 2024Footnotes6 * @copyright %%YEAR%% Footnotes 7 7 * @license https://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 8 8 * @link https://wordpress.org/plugins/footnotes-made-easy/ -
footnotes-made-easy/trunk/classes/controllers/class-footnotes-formatter.php
r3017293 r3024987 271 271 272 272 $filters = (array) $wp_current_filter; 273 274 $excerpt_call = false; 273 275 // Lets check filters, and if that call comes from excerpt function, we have to remove ourselves. 274 276 foreach ( $filters as $filter ) { 275 277 if ( false !== \strpos( $filter, 'excerpt' ) ) { 276 $display = false; 278 $display = false; 279 $excerpt_call = true; 277 280 278 281 break; … … 294 297 $data = \str_replace( self::SHORT_CODE_POSITION_HOLDER, '', $data ); 295 298 299 if ( $excerpt_call ) { 300 if ( isset( self::$identifiers[ $post->ID ] ) ) { 301 unset( self::$identifiers[ $post->ID ] ); 302 } 303 } 304 296 305 return $data; 297 306 } … … 300 309 $start_number = ( 1 === preg_match( '|<!\-\-startnum=(\d+)\-\->|', $data, $start_number_array ) ) ? $start_number_array[1] : 1; 301 310 302 // // Regex extraction of all footnotes (or return if there are none). 303 // if ( ! preg_match_all( '/(' . preg_quote( Settings::get_current_options()['footnotes_open'], '/' ) . ')(.*)(' . preg_quote( Settings::get_current_options()['footnotes_close'], '/' ) . ')/Us', $data, $identifiers, PREG_SET_ORDER ) ) { 304 // return $data; 305 // } 306 307 $processed_data = self::get_footnotes( $data, $post->ID ); 308 309 $footnotes = $processed_data['footnotes']; 310 $identifiers = $processed_data['identifiers']; 311 $processed_data = self::get_footnotes( $data, $post->ID ); 312 313 $footnotes = $processed_data['footnotes']; 314 $identifiers = $processed_data['identifiers']; 311 315 312 316 $style = self::get_style( $post ); … … 436 440 } 437 441 438 return ['footnotes'=>$footnotes,'identifiers'=>$identifiers]; 442 return array( 443 'footnotes' => $footnotes, 444 'identifiers' => $identifiers, 445 ); 439 446 } 440 447 … … 517 524 } 518 525 519 $footnotes_markup = $footnotes_markup . Settings::get_current_options()['pre_backlink'] . '<a href="' . ( ( $use_full_link ) ? get_permalink( $post->ID ) : '' ) . '#identifier_' . $identifier . '_' . $post->ID . '" class="footnote-link footnote-back-link" title="' . $back_link_title_footnote . '" aria-label="' . $back_link_title . '">' . Settings::get_current_options()['backlink'] . '</a>' . Settings::get_current_options()['post_backlink'];526 $footnotes_markup = $footnotes_markup . '<span class="fme-pre-backlink">' . Settings::get_current_options()['pre_backlink'] . '</span><a href="' . ( ( $use_full_link ) ? get_permalink( $post->ID ) : '' ) . '#identifier_' . $identifier . '_' . $post->ID . '" class="footnote-link footnote-back-link" title="' . $back_link_title_footnote . '" aria-label="' . $back_link_title . '">' . Settings::get_current_options()['backlink'] . '</a><span class="fme-pre-backlink">' . Settings::get_current_options()['post_backlink'] . '</span>'; 520 527 } 521 528 $footnotes_markup .= '</span>'; … … 525 532 $footnotes_markup .= '</ol>'; 526 533 527 if ( ! empty( $footnotes_footer = Settings::get_current_options()['post_footnotes'] ) ) { // phpcs:ignore Squiz.PHP.DisallowMultipleAssignments.FoundInControlStructure 534 if ( ! empty( $footnotes_footer = Settings::get_current_options()['post_footnotes'] ) ) { // phpcs:ignore Squiz.PHP.DisallowMultipleAssignments.FoundInControlStructure, Generic.CodeAnalysis.AssignmentInCondition.Found 528 535 if ( ! Settings::get_current_options()['no_tags_header_footer'] ) { 529 536 $footnotes_footer = -
footnotes-made-easy/trunk/classes/helpers/class-settings.php
r3016317 r3024987 29 29 class Settings { 30 30 31 public const OPTIONS_VERSION = ' 8'; // Incremented when the options array changes.31 public const OPTIONS_VERSION = '9'; // Incremented when the options array changes. 32 32 33 33 public const MENU_SLUG = 'fme_settings'; … … 258 258 self::$default_options = array( 259 259 'superscript' => true, 260 'pre_backlink' => ' [',260 'pre_backlink' => '[', 261 261 'backlink' => '↩', 262 262 'post_backlink' => ']', … … 278 278 'combine_identical_notes' => true, 279 279 'priority' => 11, 280 'footnotes_open' => ' ((',280 'footnotes_open' => '((', 281 281 'footnotes_close' => '))', 282 282 'pretty_tooltips' => false, -
footnotes-made-easy/trunk/classes/migration/class-abstract-migration.php
r3019096 r3024987 5 5 * @package fme 6 6 * @subpackage migration 7 * @copyright 2024Footnotes made easy7 * @copyright %%YEAR%% Footnotes made easy 8 8 * @license https://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 9 9 */ -
footnotes-made-easy/trunk/classes/migration/class-migration.php
r3019096 r3024987 5 5 * @package fme 6 6 * @subpackage migration 7 * @copyright 20247 * @copyright %%YEAR%% 8 8 * @license https://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 9 9 */ -
footnotes-made-easy/trunk/footnotes-made-easy.php
r3019102 r3024987 7 7 * @package footnotes 8 8 * @author sdobreff 9 * @copyright Copyright (C) 2023- 2024, Footnotes9 * @copyright Copyright (C) 2023-%%YEAR%%, Footnotes 10 10 * @license GPL v3 11 11 * @link https://wordpress.org/plugins/footnotes-made-easy/ … … 14 14 * Plugin URI: https://github.com/sdobreff/footnotes-made-easy 15 15 * Description: Allows post authors to easily add and manage footnotes in posts. 16 * Version: 2. 4.516 * Version: 2.5.0 17 17 * Author: Footnotes 18 18 * Author URI: https://github.com/sdobreff … … 30 30 } 31 31 32 define( 'FME_VERSION', '2. 4.5' );32 define( 'FME_VERSION', '2.5.0' ); 33 33 define( 'FME_TEXTDOMAIN', 'footnotes-made-easy' ); 34 34 define( 'FME_NAME', 'Footnotes Made Easy' ); … … 58 58 // translators: the minimum version of the PHP required by the plugin. 59 59 __( 60 '"%1$s" requires PHP %2$s or newer . ', 60 '"%1$s" requires PHP %2$s or newer. Plugin is automatically deactivated.', 61 'footnotes-made-easy' 62 ), 63 FME_NAME, 64 FME_MIN_PHP_VERSION 65 ) 66 ) 67 ); 68 } 69 ); 70 71 // Return early to prevent loading the plugin. 72 return; 73 } 74 75 if ( ! extension_loaded( 'mbstring' ) ) { 76 add_action( 77 'admin_init', 78 static function () { 79 deactivate_plugins( plugin_basename( __FILE__ ) ); 80 } 81 ); 82 add_action( 83 'admin_notices', 84 static function () { 85 echo wp_kses_post( 86 sprintf( 87 '<div class="notice notice-error"><p>%s</p></div>', 88 sprintf( 89 // translators: the mbstring extensions is required by the plugin. 90 __( 91 '"%1$s" requires multi byte string extension loaded. Plugin is automatically deactivated.', 61 92 'footnotes-made-easy' 62 93 ) 63 ), 64 FME_NAME, 65 FME_TEXTDOMAIN 94 ) 66 95 ) 67 96 ); -
footnotes-made-easy/trunk/readme.txt
r3019102 r3024987 4 4 Tested up to: 6.4.2 5 5 Requires PHP: 7.4 6 Stable tag: 2. 4.56 Stable tag: 2.5.0 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 14 14 Footnotes Made Easy is a simple, but powerful, method of adding footnotes into your posts and pages. 15 15 16 Key features include...16 ## Key features include... 17 17 18 18 * Simple footnote insertion via markup of choice (default - double parentheses) … … 25 25 * And much, much more! 26 26 27 Technical specification... 27 ### [You can try the plugin in WordPress Playground!](https://playground.wordpress.net/?plugin=footnotes-made-easy&url=%2Fwp-admin%2Fpost-new.php&wp=6.4&php-extension-bundle=kitchen-sink) 28 29 ## Technical specification... 28 30 29 31 * Licensed under [GPLv2 (or later)](http://wordpress.org/about/gpl/ "GNU General Public License")
Note: See TracChangeset
for help on using the changeset viewer.