Changeset 1630619
- Timestamp:
- 04/06/2017 02:04:56 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
post-series-manager/trunk/post-series-manager.php
r1374858 r1630619 22 22 * 23 23 * This program is free software; you can redistribute it and/or modify 24 * it under the terms of the GNU General Public License, version 2, as 24 * it under the terms of the GNU General Public License, version 2, as 25 25 * published by the Free Software Foundation. 26 26 * … … 46 46 47 47 function __construct() { 48 $this->plugin_name = "post-series-manager";49 $this->plugin_version = "1.1.0";48 $this->plugin_name = ; 49 $this->plugin_version = ; 50 50 51 51 register_activation_hook( __FILE__, array( &$this, 'post_series_manager_activate' ) ); … … 77 77 'post', 78 78 array( 79 'label' => __( 'Post Series', $this->plugin_name ), 80 'rewrite' => array( 'slug' => 'post-series' ), 79 'label' => __( 'Post Series', 'post-series-manager' ), 80 'rewrite' => array( 81 'slug' => 'post-series', 82 ), 81 83 'labels' => array( 82 'name' => __( 'Post Series', $this->plugin_name ), 83 'singular_name' => __( 'Post Series', $this->plugin_name ), 84 'all_items' => __( 'All Post Series', $this->plugin_name ), 85 'edit_item' => __( 'Edit Post Series', $this->plugin_name ), 86 'view_item' => __( 'View Post Series', $this->plugin_name ), 87 'update_item' => __( 'Update Post Series', $this->plugin_name ), 88 'add_new_item' => __( 'Add New Post Series', $this->plugin_name ), 89 'new_item_name' => __( 'New Post Series Name', $this->plugin_name ), 90 'search_items' => __( 'Search Post Series', $this->plugin_name ), 91 'popular_items' => __( 'Popular Post Series', $this->plugin_name ), 92 'separate_items_with_commas' => __( 'Separate post series with commas', $this->plugin_name ), 93 'add_or_remove_items' => __( 'Add or remove post series', $this->plugin_name ), 94 'choose_from_most_used' => __( 'Choose from most used post series', $this->plugin_name ), 95 'not_found' => __( 'No post series found', $this->plugin_name ) ) 96 ) 84 'name' => __( 'Post Series', 'post-series-manager' ), 85 'singular_name' => esc_html__( 'Post Series', 'post-series-manager' ), 86 'all_items' => esc_html__( 'All Post Series', 'post-series-manager' ), 87 'edit_item' => esc_html__( 'Edit Post Series', 'post-series-manager' ), 88 'view_item' => esc_html__( 'View Post Series', 'post-series-manager' ), 89 'update_item' => esc_html__( 'Update Post Series', 'post-series-manager' ), 90 'add_new_item' => esc_html__( 'Add New Post Series', 'post-series-manager' ), 91 'new_item_name' => esc_html__( 'New Post Series Name', 'post-series-manager' ), 92 'search_items' => esc_html__( 'Search Post Series', 'post-series-manager' ), 93 'popular_items' => esc_html__( 'Popular Post Series', 'post-series-manager' ), 94 'separate_items_with_commas' => esc_html__( 'Separate post series with commas', 'post-series-manager' ), 95 'add_or_remove_items' => esc_html__( 'Add or remove post series', 'post-series-manager' ), 96 'choose_from_most_used' => esc_html__( 'Choose from most used post series', 'post-series-manager' ), 97 'not_found' => esc_html__( 'No post series found', 'post-series-manager' ), 98 ), 99 ) 97 100 ); 98 101 } … … 100 103 public function post_series_i18n() { 101 104 load_plugin_textdomain( 102 $this->plugin_name,105 , 103 106 false, 104 107 dirname( plugin_basename( __FILE__ ) ) . '/languages/' 105 108 ); 106 109 } 107 110 … … 123 126 $series_link = sprintf( '<a href="%s">%s</a>', get_term_link( $series ), $series->name ); 124 127 125 $series_text = apply_filters( 'post-series-manager-series-text', __( 'This post is part of the series', $this->plugin_name) );126 127 if ( is_single() )128 $series_text = apply_filters( 'post-series-manager-series-text', __( 'This post is part of the series', ) ); 129 130 if( is_single() ) 128 131 { 129 132 $series_list_HTML = $this->get_series_list_HTML( $series ); … … 143 146 * 144 147 * @since 1.0.0 145 * 148 * 146 149 * @param object $series The post series to work through 147 150 * @return string $series_list_HTML Completed HTML string of all the series lists … … 151 154 $current_post_ID = get_the_ID(); 152 155 153 $current_indicator = apply_filters( 'post-series-manager-current-text', __('(Current)', $this->plugin_name) );156 $current_indicator = apply_filters( 'post-series-manager-current-text', ) ); 154 157 155 158 $args = array( … … 158 161 'taxonomy' => 'post-series', 159 162 'field' => 'slug', 160 'terms' => $series->name 161 ) 163 'terms' => $series->name 164 ) 162 165 ), 163 166 'order' => 'ASC', … … 167 170 $series_posts = get_posts( $args ); 168 171 169 if ( count( $series_posts ) > 1 )172 if( count( $series_posts ) > 1 ) 170 173 { 171 174 $current_post = get_post( $current_post_ID ); … … 185 188 } 186 189 187 $list_introduction = apply_filters( 'post-series-list-intro-text', sprintf( '<p>%s</p>', __( 'Other posts in this series:', $this->plugin_name) ) );190 $list_introduction = apply_filters( 'post-series-list-intro-text', sprintf( '<p>%s</p>', __( 'Other posts in this series:', ) ) ); 188 191 189 192 $list_opening = apply_filters( 'post-series-list-opening-tags', sprintf( '<ol class="post-series-manager-post-list" start="%s">', $start_index + 1 ) ); … … 191 194 $series_list_HTML = $list_introduction . $list_opening; 192 195 193 for ($i = $start_index; $i <= $end_index; $i++ )196 for$i = $start_index; $i <= $end_index; $i++ ) 194 197 { 195 198 $post_title = get_the_title( $series_posts[$i]->ID ); … … 222 225 223 226 if ( $all_series ) { 224 $series_text = apply_filters( 'post-series-manager-next-text', __( 'Continue reading this series:', $this->plugin_name) );225 227 $series_text = apply_filters( 'post-series-manager-next-text', ) ); 228 226 229 $series_nav = '<div class="post-series-nav"><p>%s<br /> %s</p></div>'; 227 230 $next = get_next_post_link( '%link', '%title', true, NULL, 'post-series' ); … … 232 235 } 233 236 234 237 return $shortcode_HTML; 235 238 236 239 } … … 257 260 // Reverse sort order, since part 1 is generally older than part X 258 261 public function post_series_sort_order( $query ) { 259 if( ( $query->is_main_query() ) && ( is_tax( 'post-series') ) ) {262 if( ( $query->is_main_query() ) && ( is_tax() ) ) { 260 263 $query->set( 'order', 'ASC' ); 261 264 }
Note: See TracChangeset
for help on using the changeset viewer.