Plugin Directory

Changeset 1630619

Timestamp:
04/06/2017 02:04:56 AM (7 years ago)
Author:
Cheffheid
Message:

Update translation namespace away from variables, fix a handful of PHPCS errors.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • post-series-manager/trunk/post-series-manager.php

    r1374858 r1630619  
    2222*
    2323* 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
    2525* published by the Free Software Foundation.
    2626*
     
    4646
    4747    function __construct() {
    48         $this->plugin_name = "post-series-manager";
    49         $this->plugin_version = "1.1.0";
     48        $this->plugin_name = ;
     49        $this->plugin_version = ;
    5050
    5151        register_activation_hook( __FILE__, array( &$this, 'post_series_manager_activate' ) );
     
    7777            'post',
    7878            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                ),
    8183                '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            )
    97100        );
    98101    }
     
    100103    public function post_series_i18n() {
    101104        load_plugin_textdomain(
    102             $this->plugin_name,
     105            ,
    103106            false,
    104107            dirname( plugin_basename( __FILE__ ) ) . '/languages/'
    105             );
     108        );
    106109    }
    107110
     
    123126                $series_link = sprintf( '<a href="%s">%s</a>', get_term_link( $series ), $series->name );
    124127
    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() )
    128131                {
    129132                    $series_list_HTML = $this->get_series_list_HTML( $series );
     
    143146    *
    144147    * @since  1.0.0
    145     * 
     148    *
    146149    * @param  object $series The post series to work through
    147150    * @return string $series_list_HTML Completed HTML string of all the series lists
     
    151154        $current_post_ID = get_the_ID();
    152155
    153         $current_indicator = apply_filters( 'post-series-manager-current-text', __('(Current)', $this->plugin_name) );
     156        $current_indicator = apply_filters( 'post-series-manager-current-text', ) );
    154157
    155158        $args = array(
     
    158161                    'taxonomy' => 'post-series',
    159162                    'field' => 'slug',
    160                     'terms' => $series->name
    161                 )
     163                    'terms' => $series->name
     164                )
    162165            ),
    163166            'order' => 'ASC',
     
    167170        $series_posts = get_posts( $args );
    168171
    169         if( count( $series_posts ) > 1 )
     172        if( count( $series_posts ) > 1 )
    170173        {
    171174            $current_post = get_post( $current_post_ID );
     
    185188            }
    186189
    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:', ) ) );
    188191
    189192            $list_opening = apply_filters( 'post-series-list-opening-tags', sprintf( '<ol class="post-series-manager-post-list" start="%s">', $start_index + 1 ) );
     
    191194            $series_list_HTML = $list_introduction . $list_opening;
    192195
    193             for($i = $start_index; $i <= $end_index; $i++ )
     196            for$i = $start_index; $i <= $end_index; $i++ )
    194197            {
    195198                $post_title   = get_the_title( $series_posts[$i]->ID );
     
    222225
    223226        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
    226229            $series_nav = '<div class="post-series-nav"><p>%s<br /> %s</p></div>';
    227230            $next = get_next_post_link( '%link', '%title', true, NULL, 'post-series' );
     
    232235        }
    233236
    234        return $shortcode_HTML;
     237    return $shortcode_HTML;
    235238
    236239    }
     
    257260    // Reverse sort order, since part 1 is generally older than part X
    258261    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() ) ) {
    260263            $query->set( 'order', 'ASC' );
    261264        }
Note: See TracChangeset for help on using the changeset viewer.