Bug fixed for short php echo <?= ... ?>

This commit is contained in:
happybooking 2013-08-18 06:48:23 +00:00
parent d6d98abe31
commit 09c7fc0401
2 changed files with 29 additions and 15 deletions

View File

@ -3,7 +3,7 @@
Plugin Name: Extended Table of Contents (with nextpage support)
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. By using the markups [extoc] you can decide where to insert the ToC. Also you can use a whitelist by disable general ToC insertion and insert the ToC to special pages/subpages/posts by [extoc]. Otherwise you can use a blacklist and disable the ToC only on special pages/subpages/posts by using the [noextoc] markup. Any feedback or suggestions are welcome.
Version: 0.8.4
Version: 0.8.5
Author: Daniel Boldura, HappyBooking UG
Author URI: http://www.happybooking.de/
@ -34,7 +34,7 @@ Author URI: http://www.happybooking.de/
* 4. Config the ToC within a markup e.g. [extoc start=5 headers=1,2,3 title="My table of contents"] oder [extoc start=5 headers=1,2,3 notitle]
*/
define( 'EXTENDED_TOC_VERSION', '0.8.4' );
define( 'EXTENDED_TOC_VERSION', '0.8.5' );
define( 'EXTENDED_TOC_ID', 'extended_toc' );
define( 'EXTENDED_TOC_NAME', 'Extended-ToC' );
define( 'TOC_MIN_START', 2 );
@ -72,6 +72,9 @@ if( !class_exists('ExToC') ) {
add_action( 'plugins_loaded', array(&$this, 'plugins_loaded') );
if( is_admin() ) {
//Additional links on the plugin page
add_filter('plugin_row_meta', array(&$this, 'register_plugin_links'), 10, 2);
add_action('admin_init', array(&$this, 'admin_init'));
add_action('admin_menu', array(&$this, 'admin_menu'));
}
@ -85,6 +88,15 @@ if( !class_exists('ExToC') ) {
public function __destruct() {
}
public function register_plugin_links($links, $file) {
if( $file == plugin_basename(__FILE__) ) {
$links[] = '<a href="http://www.happybooking.de/wordpress/plugins/extended-toc/donate">' . __('Donate', EXTENDED_TOC_ID) . '</a>';
}
return $links;
}
public function admin_init() {
wp_register_style( EXTENDED_TOC_ID, $this->path . '/admin-style.css', array(), EXTENDED_TOC_VERSION );
wp_enqueue_style(EXTENDED_TOC_ID);
@ -138,9 +150,9 @@ if( !class_exists('ExToC') ) {
<br />
</div>
<h2><?=__("Extended Table of Contents", EXTENDED_TOC_ID)?></h2>
<h2><?php echo __("Extended Table of Contents", EXTENDED_TOC_ID)?></h2>
<?=$msg?>
<?php echo $msg; ?>
<form method="post" action="<?php echo htmlentities('?page=' . $_GET['page'] . '&update'); ?>">
<?php wp_nonce_field( plugin_basename(__FILE__), EXTENDED_TOC_ID ); ?>
@ -149,31 +161,31 @@ if( !class_exists('ExToC') ) {
<table class="form-table">
<tbody>
<tr>
<th><label for="show_heading_text"><?=__('Show heading text', EXTENDED_TOC_ID); ?></label></th>
<th><label for="show_heading_text"><?php echo __('Show heading text', EXTENDED_TOC_ID); ?></label></th>
<td>
<input id="show_heading_text" type="checkbox" name="show_heading_text" <?php if ( $this->options['show_heading_text'] ) echo ' checked="checked"'; ?> />
</td>
</tr>
<tr>
<th><label for="heading_text"><?=__('Heading text', EXTENDED_TOC_ID); ?></label></th>
<td><input id="heading_text" type="text" class="regular-text" name="heading_text" value="<?=$this->options['heading_text']?>" /></td>
<th><label for="heading_text"><?php echo __('Heading text', EXTENDED_TOC_ID); ?></label></th>
<td><input id="heading_text" type="text" class="regular-text" name="heading_text" value="<?php echo $this->options['heading_text']; ?>" /></td>
</tr>
<tr>
<th><?=__('Add table of contents to following content types', EXTENDED_TOC_ID); ?></th>
<th><?php echo __('Add table of contents to following content types', EXTENDED_TOC_ID); ?></th>
<td>
<?php foreach( get_post_types() as $post_type ): ?>
<?php if( !in_array($post_type, $this->exclude_post_types) ): ?>
<input type="checkbox" value="<?=$post_type?>" id="auto_insert_post_types_<?=$post_type?>" name="auto_insert_post_types[]"<?=in_array($post_type, $this->options['auto_insert_post_types'])?' checked="checked"':''?> />
<label for="auto_insert_post_types_<?=$post_type?>"><?=$post_type?></label><br />
<input type="checkbox" value="<?php echo $post_type?>" id="auto_insert_post_types_<?php echo $post_type?>" name="auto_insert_post_types[]"<?php echo in_array($post_type, $this->options['auto_insert_post_types'])?' checked="checked"':''?> />
<label for="auto_insert_post_types_<?php echo $post_type?>"><?php echo $post_type?></label><br />
<?php endif; ?>
<?php endforeach; ?>
</td>
</tr>
<tr>
<th><label for="start"><?=__('Show when', EXTENDED_TOC_ID); ?></label></th>
<th><label for="start"><?php echo __('Show when', EXTENDED_TOC_ID); ?></label></th>
<td>
<select name="start" id="start">
<?php
@ -184,19 +196,19 @@ if( !class_exists('ExToC') ) {
}
?>
</select>
<span>><?=__('or more headings are present', EXTENDED_TOC_ID); ?></span>
<span>><?php echo __('or more headings are present', EXTENDED_TOC_ID); ?></span>
</td>
</tr>
<tr>
<th><label for="show_hierarchy"><?=__('Show hierarchy', EXTENDED_TOC_ID); ?></label></th>
<th><label for="show_hierarchy"><?php echo __('Show hierarchy', EXTENDED_TOC_ID); ?></label></th>
<td>
<input id="show_hierarchy" type="checkbox" name="show_hierarchy" <?php if ( $this->options['show_hierarchy'] ) echo ' checked="checked"'; ?> />
</td>
</tr>
<tr>
<th><label for="number_list_items"><?=__('Number list items', EXTENDED_TOC_ID); ?></label></th>
<th><label for="number_list_items"><?php echo __('Number list items', EXTENDED_TOC_ID); ?></label></th>
<td>
<input id="number_list_items" type="checkbox" name="number_list_items" <?php if ( $this->options['number_list_items'] ) echo ' checked="checked"'; ?> />
</td>
@ -205,7 +217,7 @@ if( !class_exists('ExToC') ) {
</table>
</div>
<p class="submit"><input class="button-primary" type="submit" value="<?=__("Save Options", EXTENDED_TOC_ID)?>" name="submit" /></p>
<p class="submit"><input class="button-primary" type="submit" value="<?php echo __("Save Options", EXTENDED_TOC_ID)?>" name="submit" /></p>
</form>
</div>
<?php

View File

@ -40,6 +40,8 @@ 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/
== Changelog ==
= 0.8.5 =
* Bug in display of the HTML content in wordpress 3.5.0 fixed
= 0.8.4 =
* Added tolerance to wrong h1-h6 numeration/hierarchy