Plugin Directory

Changeset 1829414


Ignore:
Timestamp:
02/26/2018 03:46:21 PM (8 years ago)
Author:
jacking83
Message:

update code

Location:
simple-exclude-categories
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • simple-exclude-categories/trunk/index.php

    r859401 r1829414  
    22/*
    33Plugin Name: Simple Exclude Categories
    4 Description: Hide posts in categories from WordPress Homepage
    5 Plugin URI: http://someblog.vv.si/
    6 Version: 1.0
     4Description: Hide posts in categories on WordPress homepage
     5Plugin URI: https://sihung.net/
     6Version: 1.1
    77Author: Trang Si Hung
    8 Author URI: http://someblog.vv.si/
     8Author URI: https://sihung.net/
    99Author Email: trangsihung@gmail.com
    1010License: GPLv2 or later
    1111License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1212
    13 Copyright 2013 Someblog (trangsihung@gmail.com)
     13Copyright 2018 TSH (trangsihung@gmail.com)
    1414
    1515This program is free software; you can redistribute it and/or modify
     
    4848    $options    = get_option('exclude_cats');
    4949    $pag        = 'exclude_cats';
    50     $_cats      = get_terms( 'category' );
     50    $_cats      = get_terms( array ( 'taxonomy' => 'category', 'hide_empty' => false ) );
    5151    $html       = '';
    5252
    53     foreach ($_cats as $term) {
     53    foreach ($_cats as $k => $term) {
    5454        if($options != ''){
    5555            $checked = in_array($term->term_id, $options) ? 'checked="checked"' : '';
    5656        }
    5757
    58         $html .= '<p class="cat_l">';
    59         $html .= sprintf( '<input type="checkbox" id="%1$s[%2$s]" name="%1$s[]" value="%2$s" %3$s />', $pag, $term->term_id, $checked );
    60         $html .= sprintf( '<label for="%1$s[%3$s]"> %2$s</label><br>', $pag, $term->name, $term->term_id );
    61         $html .= '</p>';
     58        $html .= '<div class="cat_l">';
     59        $html .= sprintf('<label for="%1$s[%2$s]"><input name="%1$s[]" type="checkbox" id="%1$s[%2$s]" value="%2$s" %3$s> %4$s</label>', $pag, $term->term_id, $checked, $term->name);
     60        $html .= '</div>';
     61        $html .= ($k+1) % 4 == 0 ? '<div class="cb"></div>' : '';
    6262    }
    6363
  • simple-exclude-categories/trunk/plugin.css

    r859401 r1829414  
    1 .cat_l{ display: block; width: 25%; float: left; }
     1.cat_l{ display: block; width: 25%; float: left; margin-bottom: 10px; }
    22.cb{clear: both;}
  • simple-exclude-categories/trunk/readme.txt

    r859401 r1829414  
    22Contributors: jacking83
    33Tags: exclude, categories, hide, options
    4 Donate link: http://someblog.vv.si/
    5 Stable tag: 1.0
     4Donate link: https://sihung.net/
     5Stable tag: 1.1
    66Requires at least: 3.5
    7 Tested up to: 3.8
     7Tested up to: 4.9.4
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1010
    11 Hide posts in categories from WordPress Homepage
     11Hide posts in categories on WordPress Homepage
    1212
    1313== Description ==
    14 English: Plugin help hide all posts in one or more category on Homepage. Go to \"Settings» Reading \"to choose the category need to hide
     14Plugin help hide all posts in one or more category on your homepage.
    1515
    16 Vietnamese: Plugin giúp ẩn bài posts trong một hoặc nhiều category trên trang Homepage. Vào \"Settings » Reading\" để chọn category cần ẩn
     16Go to "Settings » Reading"to choose the category need to hide
    1717
    1818== Installation ==
Note: See TracChangeset for help on using the changeset viewer.