bugfixes
This commit is contained in:
parent
0e4080919a
commit
f28deedf38
|
@ -3,7 +3,7 @@
|
||||||
Plugin Name: Extended Table of Contents (with nextpage support)
|
Plugin Name: Extended Table of Contents (with nextpage support)
|
||||||
Plugin URI: http://www.happybooking.de/wordpress/plugins/extended-toc
|
Plugin URI: http://www.happybooking.de/wordpress/plugins/extended-toc
|
||||||
Description: This plugin automatically generates and inserts a table of contents (ToC) to your pages and posts, based on tags h1-h6. Whenever the plugin discovers more than a certain amount of headings (default: 3) the ToC is inserted at the top of the page. This plugin also can handle posts that are divided into pages by the nextpage-wordpress-tag. Any feedback or suggestions are welcome.
|
Description: This plugin automatically generates and inserts a table of contents (ToC) to your pages and posts, based on tags h1-h6. Whenever the plugin discovers more than a certain amount of headings (default: 3) the ToC is inserted at the top of the page. This plugin also can handle posts that are divided into pages by the nextpage-wordpress-tag. Any feedback or suggestions are welcome.
|
||||||
Version: 0.9.1
|
Version: 0.9.2
|
||||||
Author: Daniel Boldura, HappyBooking UG
|
Author: Daniel Boldura, HappyBooking UG
|
||||||
Author URI: http://www.happybooking.de/
|
Author URI: http://www.happybooking.de/
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ Author URI: http://www.happybooking.de/
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define( 'EXTENDED_TOC_VERSION', '0.9.1' );
|
define( 'EXTENDED_TOC_VERSION', '0.9.2' );
|
||||||
define( 'EXTENDED_TOC_ID', 'extended_toc' );
|
define( 'EXTENDED_TOC_ID', 'extended_toc' );
|
||||||
define( 'EXTENDED_TOC_NAME', 'Extended-ToC' );
|
define( 'EXTENDED_TOC_NAME', 'Extended-ToC' );
|
||||||
define( 'TOC_MIN_START', 2 );
|
define( 'TOC_MIN_START', 2 );
|
||||||
|
@ -317,7 +317,7 @@ if( !class_exists('ExToC') ) {
|
||||||
if( isset($atts[0]['notitle']) )
|
if( isset($atts[0]['notitle']) )
|
||||||
$this->options['show_heading_text'] = false;
|
$this->options['show_heading_text'] = false;
|
||||||
|
|
||||||
if( is_single() ) // !is_search() && !is_archive() && !is_feed() )
|
if( !is_search() && !is_archive() && !is_feed() && !is_front_page() )
|
||||||
return '[extoc]';
|
return '[extoc]';
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
|
@ -333,10 +333,7 @@ if( !class_exists('ExToC') ) {
|
||||||
// Reset the counter
|
// Reset the counter
|
||||||
$this->counter = array();
|
$this->counter = array();
|
||||||
|
|
||||||
if ( is_feed() )
|
if( is_search() || is_archive() || is_front_page() || is_feed() )
|
||||||
return $content;
|
|
||||||
|
|
||||||
if( is_search() || is_archive() || is_front_page() )
|
|
||||||
return $content;
|
return $content;
|
||||||
|
|
||||||
/** Extract the content, and extract the part content if <!--nextpage--> was used **/
|
/** Extract the content, and extract the part content if <!--nextpage--> was used **/
|
||||||
|
@ -430,8 +427,6 @@ if( !class_exists('ExToC') ) {
|
||||||
$matches = $new_matches;
|
$matches = $new_matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
// echo "<pre>"; print_r($matches); echo "</pre>";
|
|
||||||
|
|
||||||
$items = "";
|
$items = "";
|
||||||
|
|
||||||
/** Take first h-level as baseline */
|
/** Take first h-level as baseline */
|
||||||
|
@ -475,7 +470,7 @@ if( !class_exists('ExToC') ) {
|
||||||
$items .= '<li class="header-level-' . ($currentLevel - $this->minLevel + 1) . '">';
|
$items .= '<li class="header-level-' . ($currentLevel - $this->minLevel + 1) . '">';
|
||||||
// echo $currentLevel . ' - ' . $this->minLevel . ' <br>';
|
// echo $currentLevel . ' - ' . $this->minLevel . ' <br>';
|
||||||
global $page;
|
global $page;
|
||||||
if( $pagenum == $page )
|
if( $pagenum == $page && is_single() )
|
||||||
$items .= '<a href="#' . $anchor . '">';
|
$items .= '<a href="#' . $anchor . '">';
|
||||||
else {
|
else {
|
||||||
if( $pagenum == 1 )
|
if( $pagenum == 1 )
|
||||||
|
@ -484,8 +479,6 @@ if( !class_exists('ExToC') ) {
|
||||||
$items .= '<a href="?p='.$this->ID.($pagenum>1?'&page='.$pagenum:'').'#' . $anchor . '">';
|
$items .= '<a href="?p='.$this->ID.($pagenum>1?'&page='.$pagenum:'').'#' . $anchor . '">';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Show numbers only if user wants it
|
// Show numbers only if user wants it
|
||||||
if( $this->options['number_list_items'] ) {
|
if( $this->options['number_list_items'] ) {
|
||||||
$items .= "<span class=\"toc-np-number\">";
|
$items .= "<span class=\"toc-np-number\">";
|
||||||
|
|
|
@ -40,6 +40,9 @@ You can change the default settings and more under Plugins > Extended-ToC
|
||||||
If you have any questions or suggestions please contact us at any time: support@happybooking.de or http://www.happybooking.de/
|
If you have any questions or suggestions please contact us at any time: support@happybooking.de or http://www.happybooking.de/
|
||||||
|
|
||||||
== Changelog ==
|
== Changelog ==
|
||||||
|
= 0.9.2 =
|
||||||
|
* little bugfix within markup
|
||||||
|
|
||||||
= 0.9.1 =
|
= 0.9.1 =
|
||||||
* little bugfix within markup
|
* little bugfix within markup
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue