Changeset 1829414
- Timestamp:
- 02/26/2018 03:46:21 PM (8 years ago)
- Location:
- simple-exclude-categories
- Files:
-
- 6 edited
-
assets/banner-772x250.png (modified) (previous)
-
assets/screenshot-1.png (modified) (previous)
-
trunk/index.php (modified) (2 diffs)
-
trunk/plugin.css (modified) (1 diff)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/screenshot-1.png (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
simple-exclude-categories/trunk/index.php
r859401 r1829414 2 2 /* 3 3 Plugin Name: Simple Exclude Categories 4 Description: Hide posts in categories from WordPress Homepage5 Plugin URI: http ://someblog.vv.si/6 Version: 1. 04 Description: Hide posts in categories on WordPress homepage 5 Plugin URI: https://sihung.net/ 6 Version: 1.1 7 7 Author: Trang Si Hung 8 Author URI: http ://someblog.vv.si/8 Author URI: https://sihung.net/ 9 9 Author Email: trangsihung@gmail.com 10 10 License: GPLv2 or later 11 11 License URI: http://www.gnu.org/licenses/gpl-2.0.html 12 12 13 Copyright 201 3 Someblog(trangsihung@gmail.com)13 Copyright 2018 TSH (trangsihung@gmail.com) 14 14 15 15 This program is free software; you can redistribute it and/or modify … … 48 48 $options = get_option('exclude_cats'); 49 49 $pag = 'exclude_cats'; 50 $_cats = get_terms( 'category');50 $_cats = get_terms( array ( 'taxonomy' => 'category', 'hide_empty' => false ) ); 51 51 $html = ''; 52 52 53 foreach ($_cats as $ term) {53 foreach ($_cats as $k => $term) { 54 54 if($options != ''){ 55 55 $checked = in_array($term->term_id, $options) ? 'checked="checked"' : ''; 56 56 } 57 57 58 $html .= '< pclass="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>' : ''; 62 62 } 63 63 -
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; } 2 2 .cb{clear: both;} -
simple-exclude-categories/trunk/readme.txt
r859401 r1829414 2 2 Contributors: jacking83 3 3 Tags: exclude, categories, hide, options 4 Donate link: http ://someblog.vv.si/5 Stable tag: 1. 04 Donate link: https://sihung.net/ 5 Stable tag: 1.1 6 6 Requires at least: 3.5 7 Tested up to: 3.87 Tested up to: 4.9.4 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html 10 10 11 Hide posts in categories fromWordPress Homepage11 Hide posts in categories on WordPress Homepage 12 12 13 13 == 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 14 Plugin help hide all posts in one or more category on your homepage. 15 15 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 16 Go to "Settings » Reading"to choose the category need to hide 17 17 18 18 == Installation ==
Note: See TracChangeset
for help on using the changeset viewer.