Changeset 962770
- Timestamp:
- 08/08/2014 10:36:53 PM (12 years ago)
- Location:
- search-index-page-content/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (1 diff)
-
search-index-page-content.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
search-index-page-content/trunk/readme.txt
r953044 r962770 61 61 == Changelog == 62 62 63 = 1.2 = 64 * Added Localization and .pot file to enable translations 65 63 66 = 1.1 = 64 67 * Bug fix of scrollTo -
search-index-page-content/trunk/search-index-page-content.php
r953045 r962770 2 2 /* 3 3 Plugin Name: Search & Index Page Content 4 Text Domain: search-index-page-content 4 5 Plugin URI: http://adaldesign.com/2013/09/search-and-index-page-content/ 5 6 Description: Help visitors browse the content of very big pages by providing on-page search and contextual links to jump to the content they are interested in. This plugin allows you to save the trouble of creating anchor links by providing shortcodes and widgets that can be placed on any post or page. 6 Version: 1. 17 Version: 1.2 7 8 Author: ADALDESIGN 8 9 Author URI: http://adaldesign.com … … 82 83 parent::__construct( 83 84 'sipc_links_widget', // Base ID 84 'Search & Index Page Content', // Name85 array( 'description' => __( 'Creates links to headers of a page for easy navigation.', ' text_domain' ), ) // Args85 __('Search & Index Page Content', 'search-index-page-content'), 86 array( 'description' => __( 'Creates links to headers of a page for easy navigation.', 'search-index-page-content' ), ) // Args 86 87 ); 87 88 } … … 91 92 */ 92 93 public function widget( $args, $instance ) { 93 if ( isset( $instance[ 'show_search' ] ) ) { $show_search = $instance[ 'show_search' ]; } else { $show_search = __( 'on', ' text_domain' ); }94 if ( isset( $instance[ 'search_title' ] ) ) { $search_title = $instance[ 'search_title' ]; } else { $search_title = __( 'Search this page', ' text_domain' ); }95 if ( isset( $instance[ 'show_index' ] ) ) { $show_index = $instance[ 'show_index' ]; } else { $show_index = __( 'on', ' text_domain' ); }96 if ( isset( $instance[ 'index_title' ] ) ) { $index_title = $instance[ 'index_title' ]; } else { $index_title = __( 'Page Contents', ' text_domain' ); }94 if ( isset( $instance[ 'show_search' ] ) ) { $show_search = $instance[ 'show_search' ]; } else { $show_search = __( 'on', 'search-index-page-content' ); } 95 if ( isset( $instance[ 'search_title' ] ) ) { $search_title = $instance[ 'search_title' ]; } else { $search_title = __( 'Search this page', 'search-index-page-content' ); } 96 if ( isset( $instance[ 'show_index' ] ) ) { $show_index = $instance[ 'show_index' ]; } else { $show_index = __( 'on', 'search-index-page-content' ); } 97 if ( isset( $instance[ 'index_title' ] ) ) { $index_title = $instance[ 'index_title' ]; } else { $index_title = __( 'Page Contents', 'search-index-page-content' ); } 97 98 98 99 if ( has_shortcode(get_the_content(), 'SIPC_Content') ) { … … 100 101 101 102 if ( $show_search == 'on' ) 102 echo '<input type="text" id="sipc-search" placeholder="'. $search_title .'" /> <button type="button" id="sipc-button">Search</button><br /><br />'; 103 echo '<input type="text" id="sipc-search" placeholder="'. $search_title .'" /> 104 <button type="button" id="sipc-button">' . __('Search', 'search-index-page-content') . '</button><br /><br />'; 103 105 104 106 if ( $show_index == 'on' ) { … … 114 116 */ 115 117 public function form( $instance ) { 116 if ( isset( $instance[ 'show_search' ] ) ) { $show_search = $instance[ 'show_search' ]; } else { $show_search = __( 'on', ' text_domain' ); }117 if ( isset( $instance[ 'search_title' ] ) ) { $search_title = $instance[ 'search_title' ]; } else { $search_title = __( 'Search this page', ' text_domain' ); }118 if ( isset( $instance[ 'show_index' ] ) ) { $show_index = $instance[ 'show_index' ]; } else { $show_index = __( 'on', ' text_domain' ); }119 if ( isset( $instance[ 'index_title' ] ) ) { $index_title = $instance[ 'index_title' ]; } else { $index_title = __( 'Page Contents', ' text_domain' ); }118 if ( isset( $instance[ 'show_search' ] ) ) { $show_search = $instance[ 'show_search' ]; } else { $show_search = __( 'on', 'search-index-page-content' ); } 119 if ( isset( $instance[ 'search_title' ] ) ) { $search_title = $instance[ 'search_title' ]; } else { $search_title = __( 'Search this page', 'search-index-page-content' ); } 120 if ( isset( $instance[ 'show_index' ] ) ) { $show_index = $instance[ 'show_index' ]; } else { $show_index = __( 'on', 'search-index-page-content' ); } 121 if ( isset( $instance[ 'index_title' ] ) ) { $index_title = $instance[ 'index_title' ]; } else { $index_title = __( 'Page Contents', 'search-index-page-content' ); } 120 122 ?> 121 123 … … 126 128 name="<?php echo $this->get_field_name( 'show_search' ); ?>" 127 129 type="checkbox" <?php echo $checked = ($show_search == "on") ? "checked" : ""; ?> /> 128 <?php _e( 'Show search field?' ); ?>130 <?php _e( 'Show search field?', 'search-index-page-content' ); ?> 129 131 </label> 130 132 </p> 131 133 <p> 132 <label for="<?php echo $this->get_field_id( 'search_title' ); ?>"><?php _e( 'Search field placeholder text:' ); ?></label>134 <label for="<?php echo $this->get_field_id( 'search_title' ); ?>"><?php _e( 'Search field placeholder text:', 'search-index-page-content' ); ?></label> 133 135 <input class="widefat" 134 136 id="<?php echo $this->get_field_id( 'search_title' ); ?>" … … 145 147 name="<?php echo $this->get_field_name( 'show_index' ); ?>" 146 148 type="checkbox" <?php echo $checked = ($show_index == "on") ? "checked" : ""; ?> /> 147 <?php _e( 'Show contents index links?' ); ?>149 <?php _e( 'Show contents index links?', 'search-index-page-content' ); ?> 148 150 </label> 149 151 </p> 150 152 <p> 151 <label for="<?php echo $this->get_field_id( 'index_title' ); ?>"><?php _e( 'Index links title:' ); ?></label>153 <label for="<?php echo $this->get_field_id( 'index_title' ); ?>"><?php _e( 'Index links title:', 'search-index-page-content' ); ?></label> 152 154 <input class="widefat" 153 155 id="<?php echo $this->get_field_id( 'index_title' ); ?>" … … 156 158 </p> 157 159 <p> 158 <br />INSTRUCTIONS: This widget will only appear on pages or posts when you surround the content to index or search with the shortcode as such: 159 <br /><em>[SIPC_Content]This content will be searchable and/or indexed[/SIPC_Content]</em> 160 <br /><strong><?php _e( 'INSTRUCTIONS', 'search-index-page-content'); ?></strong><br /> 161 <?php _e( 'This widget will only appear on pages or posts when you surround the content to index or search with the shortcode as such:', 'search-index-page-content'); ?> 162 <br /><br /><em>[SIPC_Content]<?php _e( 'This content will be searchable and/or indexed', 'search-index-page-content' ); ?>[/SIPC_Content]</em><br /> 160 163 </p> 161 164 <?php … … 262 265 add_action( 'wp_footer', 'sipc_inline_scripts' ); 263 266 267 268 269 /* -------------------- 270 * Localize Plugin for Translations 271 * -------------------- */ 272 273 function ap_action_init() { 274 load_plugin_textdomain('search-index-page-content', false, basename( dirname( __FILE__ ) ) . '/languages' ); 275 } 276 277 // Add actions 278 add_action('init', 'ap_action_init'); 279 264 280 ?>
Note: See TracChangeset
for help on using the changeset viewer.