Changeset 1633621
- Timestamp:
- 04/09/2017 02:44:20 PM (9 years ago)
- Location:
- collection
- Files:
-
- 6 added
- 13 edited
- 18 copied
-
tags/0.1 (added)
-
tags/0.1/collection.php (copied) (copied from collection/trunk/collection.php)
-
tags/0.1/languages (added)
-
tags/0.1/languages/coon-fr_FR.mo (copied) (copied from collection/trunk/languages/coon-fr_FR.mo)
-
tags/0.1/languages/coon-fr_FR.po (copied) (copied from collection/trunk/languages/coon-fr_FR.po)
-
tags/0.1/languages/coon.pot (copied) (copied from collection/trunk/languages/coon.pot)
-
tags/0.1/plugin (added)
-
tags/0.1/plugin/admin (added)
-
tags/0.1/plugin/admin/assets (added)
-
tags/0.1/plugin/admin/assets.php (copied) (copied from collection/trunk/plugin/admin/assets.php)
-
tags/0.1/plugin/admin/assets/admin.css (copied) (copied from collection/trunk/plugin/admin/assets/admin.css)
-
tags/0.1/plugin/admin/assets/admin.js (copied) (copied from collection/trunk/plugin/admin/assets/admin.js)
-
tags/0.1/plugin/admin/form.php (copied) (copied from collection/trunk/plugin/admin/form.php)
-
tags/0.1/plugin/admin/init.php (copied) (copied from collection/trunk/plugin/admin/init.php)
-
tags/0.1/plugin/admin/metabox.php (copied) (copied from collection/trunk/plugin/admin/metabox.php)
-
tags/0.1/plugin/admin/panel.php (copied) (copied from collection/trunk/plugin/admin/panel.php)
-
tags/0.1/plugin/front (added)
-
tags/0.1/plugin/front/init.php (copied) (copied from collection/trunk/plugin/front/init.php)
-
tags/0.1/plugin/front/shortcode.php (copied) (copied from collection/trunk/plugin/front/shortcode.php)
-
tags/0.1/plugin/init.php (copied) (copied from collection/trunk/plugin/init.php)
-
tags/0.1/plugin/options.php (copied) (copied from collection/trunk/plugin/options.php)
-
tags/0.1/plugin/post_types.php (copied) (copied from collection/trunk/plugin/post_types.php)
-
tags/0.1/readme.txt (copied) (copied from collection/trunk/readme.txt) (1 diff)
-
tags/0.1/uninstall.php (copied) (copied from collection/trunk/uninstall.php)
-
trunk/collection.php (modified) (1 diff)
-
trunk/plugin/admin/assets.php (modified) (1 diff)
-
trunk/plugin/admin/form.php (modified) (1 diff)
-
trunk/plugin/admin/init.php (modified) (1 diff)
-
trunk/plugin/admin/metabox.php (modified) (1 diff)
-
trunk/plugin/admin/panel.php (modified) (4 diffs)
-
trunk/plugin/front/init.php (modified) (1 diff)
-
trunk/plugin/front/shortcode.php (modified) (1 diff)
-
trunk/plugin/init.php (modified) (5 diffs)
-
trunk/plugin/options.php (modified) (2 diffs)
-
trunk/plugin/post_types.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/uninstall.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
collection/tags/0.1/readme.txt
r1633562 r1633621 5 5 Requires at least: 4.0 6 6 Tested up to: 4.7 7 Stable tag: trunk7 Stable tag: 0.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
collection/trunk/collection.php
r1633516 r1633621 4 4 Plugin URI: http://web-startup.fr/ 5 5 Description: Create and manage yourself your own collection by means of a simple generator of custom post types. 6 Version: 0. 16 Version: 0.2 7 7 Author: Steeve Lefebvre 8 8 Author URI: web-startup.fr/ -
collection/trunk/plugin/admin/assets.php
r1633516 r1633621 3 3 /** 4 4 * @package Collection 5 * @version 0. 15 * @version 0.2 6 6 */ 7 7 -
collection/trunk/plugin/admin/form.php
r1633516 r1633621 3 3 /** 4 4 * @package Collection 5 * @version 0. 15 * @version 0.2 6 6 */ 7 7 -
collection/trunk/plugin/admin/init.php
r1633516 r1633621 3 3 /** 4 4 * @package Collection 5 * @version 0. 15 * @version 0.2 6 6 */ 7 7 -
collection/trunk/plugin/admin/metabox.php
r1633516 r1633621 3 3 /** 4 4 * @package Collection 5 * @version 0. 15 * @version 0.2 6 6 */ 7 7 -
collection/trunk/plugin/admin/panel.php
r1633516 r1633621 2 2 /** 3 3 * @package Collection 4 * @version 0. 14 * @version 0.2 5 5 */ 6 6 … … 139 139 register_setting( 140 140 'slwsu_collection_reglages', 'slwsu_collection_post_type_supports' 141 ); 142 143 // ... 144 add_settings_field( 145 'slwsu_collection_post_type_deregister', __('Deregister post types', 'coon'), array($this, 'post_type_deregister'), 'slwsu_collection_reglages', 'slwsu_collection_section_reglages' 146 ); 147 register_setting( 148 'slwsu_collection_reglages', 'slwsu_collection_post_type_deregister' 141 149 ); 142 150 … … 490 498 endforeach; 491 499 else: 492 echo '<p style="margin-bottom:10px;"><span class="dashicons dashicons-warning"></span> ' . __('This collection contains no metabox.', 'coon') . '</p>';500 echo '<p style="margin-bottom:10px;"><span class="dashicons dashicons-warning"></span> ' . __('This collection contains no metabox.', 'coon') . '</p>'; 493 501 endif; 494 502 ?> … … 627 635 } 628 636 637 public function post_type_deregister() { 638 $input = get_option('slwsu_collection_post_type_deregister'); 639 echo '<input id="slwsu_collection_post_type_deregister" name="slwsu_collection_post_type_deregister" value="' . $input . '" type="text" class="regular-text" />'; 640 echo '<p class="description">' . __('Add here the different post types to deregister by separating them with a comma ( , ).', 'coon') . '</p>'; 641 } 642 629 643 public function delete_options() { 630 644 $input = get_option('slwsu_collection_delete_options'); -
collection/trunk/plugin/front/init.php
r1633516 r1633621 3 3 /** 4 4 * @package Collection 5 * @version 0. 15 * @version 0.2 6 6 */ 7 7 -
collection/trunk/plugin/front/shortcode.php
r1633516 r1633621 3 3 /** 4 4 * @package Collection 5 * @version 0. 15 * @version 0.2 6 6 */ 7 7 -
collection/trunk/plugin/init.php
r1633516 r1633621 3 3 /** 4 4 * @package Collection 5 * @version 0. 15 * @version 0.2 6 6 */ 7 8 7 defined('ABSPATH') or exit(); 9 8 … … 11 10 12 11 public $post_types; 12 public $del_post_types; 13 13 14 14 /** … … 17 17 public function __construct() { 18 18 $this->post_types = get_option('slwsu_collection_post_types', 'false'); 19 $this->del_post_types = get_option('slwsu_collection_post_type_deregister', ''); 19 20 $this->_init(); 20 21 } … … 31 32 $this->front_init(); 32 33 endif; 34 35 if ('' !== $this->del_post_types): 36 add_action('init', array($this, 'del_post_types'), 20); 37 endif; 33 38 } 34 39 … … 43 48 ${$cpt['name']} = new slwsu_post_types($cpt); 44 49 endforeach; 50 endif; 51 } 52 53 /** 54 * ... 55 */ 56 public function del_post_types() { 57 global $wp_post_types; 58 $aCpt = explode(',', $this->del_post_types); 59 if (is_array($aCpt)): 60 foreach ($aCpt as $post_type) { 61 $post_type = trim($post_type); 62 if (isset($wp_post_types[$post_type]) && '' !== $post_type) { 63 64 unset($wp_post_types[$post_type]); 65 } 66 } 67 else: 68 $post_type = trim($this->del_post_types); 69 unset($wp_post_types[$post_type]); 45 70 endif; 46 71 } -
collection/trunk/plugin/options.php
r1633516 r1633621 3 3 /** 4 4 * @package Collection 5 * @version 0. 15 * @version 0.2 6 6 */ 7 7 … … 19 19 'flush_rewrite' => 'false', 20 20 'post_types' => 'false', 21 'post_type_deregister' => '', 21 22 'metaboxs' => 'false', 22 23 'post_type_supports' => 'title, editor, author, thumbnail, excerpt, comments', -
collection/trunk/plugin/post_types.php
r1633516 r1633621 3 3 /** 4 4 * @package Collection 5 * @version 0. 15 * @version 0.2 6 6 */ 7 8 7 class slwsu_post_types { 9 8 … … 29 28 $this->capability = get_option('slwsu_collection_capability_type', 'post'); 30 29 $this->supports = array_map('trim', explode(',', get_option('slwsu_collection_post_type_supports'))); 31 30 32 31 $post_types = get_option('slwsu_collection_post_types', 'false'); 33 32 $flush = get_option('slwsu_collection_flush_rewrite', 'false'); … … 55 54 public function _init() { 56 55 add_action('init', array($this, 'register_post_types'), 10); 56 57 57 if (true === $this->flush_rewrite): 58 58 add_action('init', array($this, 'flush_rewrite_rules'), 20); … … 84 84 'query_var' => true, 85 85 'rewrite' => array('slug' => $this->slug, 'with_front' => true), 86 'capability_type' => $this->capability, 86 'capability_type' => $this->capability, 87 87 'has_archive' => true, 88 88 'hierarchical' => false, … … 130 130 } 131 131 132 132 133 } -
collection/trunk/readme.txt
r1633562 r1633621 1 1 === Collection === 2 2 Contributors: webstartup, Benoti 3 Tags: cllection, post type, post-type, post-types, custom post type, manage post types, metabox, custom metabox, collection, collection post type, divi compatible3 Tags: post type, post-type, post-types, post types, custom post type, manage post types, metabox, custom metabox, collection, collection post type, divi compatible 4 4 Donate link: http://web-startup.fr/ 5 5 Requires at least: 4.0 … … 20 20 * Add metabox dedicated to collections 21 21 * Add information to content with shortcode 22 * Remove unnecessary post types 22 23 23 24 == Installation == … … 62 63 63 64 == Changelog == 64 = v 1.0.0 = 65 = v 0.2 = 66 * Add deletion after unnecessary types 67 68 = v 0.1 = 65 69 * First release! 66 70 67 71 == Upgrade Notice == 68 = v 1.0.0 = 69 Initial Version. 72 = v 0.2 = 73 * First release! 74 75 = v 0.1 = 76 * Initial Version. -
collection/trunk/uninstall.php
r1633516 r1633621 3 3 /** 4 4 * @package Collection 5 * @version 0. 15 * @version 0.2 6 6 */ 7 7
Note: See TracChangeset
for help on using the changeset viewer.