Plugin Directory

Changeset 1277266


Ignore:
Timestamp:
11/01/2015 04:50:18 PM (10 years ago)
Author:
cip
Message:

2.1.1 - improve code quality

Location:
enhanced-category-pages/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • enhanced-category-pages/trunk/classes/ecp/Enhanced_Category.php

    r1179798 r1277266  
    1010    private $_cp_proprieties;
    1111
    12     public function __construct($translation_domain, $table_categories_posts) {
     12    public function __construct($translation_domain, $table_categs_posts) {
    1313        $this->_name = 'Enhanced Category';
    1414        $this->_name_plural = 'Enhanced Categories';
    1515        $this->_prevent_update = false;
    16         $this->_table_categories_posts = $table_categories_posts;
     16        $this->_table_categories_posts = $table_categs_posts;
    1717
    1818        $this->_cp_proprieties = array(
     
    164164            $cat = get_term($category_id, $taxonomy);
    165165            $post_id = $this->add_new_from_category($cat);
    166         } else {
    167             $post_id = $posts_array[0]->ID;
    168         }
     166
     167            return $post_id;
     168        }
     169
     170        $post_id = $posts_array[0]->ID;
    169171
    170172        return $post_id;
  • enhanced-category-pages/trunk/classes/ecp/WP_Custom_Post.php

    r1101510 r1277266  
    1010    public $id;
    1111
    12     private $meta;
     12    //private $meta;
    1313
    1414    public function __construct($register_options = array(), $translation_domain = "") {
     
    5050        global $post, $post_ID;
    5151        $_uname = ucfirst($this->_name);
    52         $_uname_plural = ucfirst($this->_name_plural);
     52        $revision = isset($_GET['revision']) ? (int) isset($_GET['revision']) : 0;
     53        //$_uname_plural = ucfirst($this->_name_plural);
    5354
    5455        $messages[$this->get_safe_name()] = array(
     
    5859            3 => __('Custom field deleted.'),
    5960            4 => $this->translate('Successfully updated', $_uname),
    60             5 => isset($_GET['revision']) ? $this->translate('Restored to revision from %s', $_uname, wp_post_revision_title((int) $_GET['revision'], false)) : false,
     61            5 => $revision ? $this->translate('Restored to revision from %s', $_uname, wp_post_revision_title($revision, false)) : false,
    6162            6 => $this->translate('Published. <a href="%s">View</a>', $_uname, esc_url(get_permalink($post_ID)), $this->_name),
    6263            7 => $this->translate('Saved.', $_uname),
     
    7576    //translates all parameters and then they are sprintf-ed in the first parameter
    7677    protected function translate($str1) {
     78        $str1;
    7779        $translation = '';
    7880
     
    8183        //translate each string received as argument
    8284        array_walk($args, function (&$str, $index, $translation_domain) {
     85            $index;
    8386            $str = __($str, $translation_domain);
    8487        }, $this->_translation_domain);
  • enhanced-category-pages/trunk/classes/ecp/WP_Integration.php

    r1277248 r1277266  
    9090
    9191    public function category_description_filter($description, $categoryId = null) {
     92        $categoryId;
    9293
    9394        ob_start();
     
    150151            $taxonomy = get_taxonomy($category->taxonomy);
    151152
    152             $a = '<a class="add-new-h2 back-to-categories" href="'
     153            $anchor = '<a class="add-new-h2 back-to-categories" href="'
    153154                . esc_url(admin_url("edit-tags.php?taxonomy={$category->taxonomy}")) . '">'
    154155                . __("Back to {$taxonomy->labels->name}", $this->_translation_domain) . "</a>";
    155156
    156             echo '<input type="hidden" id="enhanced_category_list_edit_url" value="' . htmlentities($a) . '" />';
     157            echo '<input type="hidden" id="enhanced_category_list_edit_url" value="' . htmlentities($anchor) . '" />';
    157158
    158159            echo '<input type="hidden" id="taxonomy_single_name" value="' . htmlentities($taxonomy->labels->singular_name) . '" />';
     
    221222
    222223    public function add_category($term_id, $tt_id, $taxonomy) {
    223 
     224        $tt_id;
    224225        $term = get_term($term_id, $taxonomy);
    225226
     
    232233
    233234    public function update_category($category_id, $tt_id, $taxonomy) {
     235        $tt_id;
    234236        $cat = get_term($category_id, $taxonomy);
    235237
     
    257259
    258260    private function is_valid_taxonomy($taxonomy_name) {
     261        $taxonomy_name;
    259262        //always true for the moment
    260263        //TODO: should check the user settings
  • enhanced-category-pages/trunk/enhanced-category-pages.php

    r1277248 r1277266  
    44Description: Create custom enhanced pages for categories. Manage category page as a custom post.
    55Author: Ciprian Amariei, Diana Amitroaei
    6 Version: 2.1.0
     6Version: 2.1.1
    77Text Domain: enhanced-category-pages
    88Text Path: languages
  • enhanced-category-pages/trunk/readme.txt

    r1277248 r1277266  
    55Requires at least: 3.0.1
    66Tested up to: 4.3.1
    7 Stable tag: 2.1.0
     7Stable tag: 2.1.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    157157* WooCommerce product category can be enhanced now
    158158
     159= 2.1.1 =
     160* Improve code quality
     161
    159162== Upgrade Notice ==
    160163
     
    179182= 2.1.0 =
    180183* New feature: WooCommerce product category can be enhanced now
     184
     185= 2.1.1 =
     186* Improve code quality
Note: See TracChangeset for help on using the changeset viewer.