Folders – Unlimited Folders to Organize Media Library Folder, Pages, Posts, File Manager - Version 2.1.7

Version Description

  • Better drag and drop, SportPress support
Download this release

Release Info

Developer galdub
Plugin Icon wp plugin Folders – Unlimited Folders to Organize Media Library Folder, Pages, Posts, File Manager
Version 2.1.7
Comparing to
See all releases

Code changes from version 2.1.6 to 2.1.7

assets/css/design.css CHANGED
@@ -66,12 +66,10 @@
66
  position: relative;
67
  list-style-type: none;
68
  border: 0;
69
- margin: 0;
70
- padding: 0;
71
- margin-left: 20px;
72
- width: 30px;
73
  top: 30px;
74
- padding-bottom: 30px;
75
  height: 100%;
76
  z-index: 1;
77
  }
66
  position: relative;
67
  list-style-type: none;
68
  border: 0;
69
+ margin: 0 0 0 20px;
70
+ padding: 0 0 30px 0;
71
+ width: 40px;
 
72
  top: 30px;
 
73
  height: 100%;
74
  z-index: 1;
75
  }
folders.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: Folders
4
  * Description: Arrange media, pages, custom post types and posts into folders
5
- * Version: 2.1.6
6
  * Author: Premio
7
  * Author URI: https://premio.io/downloads/folders/
8
  */
@@ -15,7 +15,7 @@ define('WCP_FOLDER', 'folders');
15
  define('WCP_FOLDER_VAR', 'folders_settings');
16
  define("WCP_DS", DIRECTORY_SEPARATOR);
17
  define('WCP_FOLDER_URL',plugin_dir_url(__FILE__));
18
- define('WCP_FOLDER_VERSION',"2.1.6");
19
 
20
  include_once plugin_dir_path(__FILE__)."includes/folders.class.php";
21
  register_activation_hook( __FILE__, array( 'WCP_Folders', 'activate' ) );
2
  /**
3
  * Plugin Name: Folders
4
  * Description: Arrange media, pages, custom post types and posts into folders
5
+ * Version: 2.1.7
6
  * Author: Premio
7
  * Author URI: https://premio.io/downloads/folders/
8
  */
15
  define('WCP_FOLDER_VAR', 'folders_settings');
16
  define("WCP_DS", DIRECTORY_SEPARATOR);
17
  define('WCP_FOLDER_URL',plugin_dir_url(__FILE__));
18
+ define('WCP_FOLDER_VERSION',"2.1.7");
19
 
20
  include_once plugin_dir_path(__FILE__)."includes/folders.class.php";
21
  register_activation_hook( __FILE__, array( 'WCP_Folders', 'activate' ) );
includes/folders.class.php CHANGED
@@ -13,6 +13,8 @@ class WCP_Folders
13
 
14
  public $total_folders = 0;
15
 
 
 
16
  public function __construct()
17
  {
18
  spl_autoload_register(array($this, 'autoload'));
@@ -96,6 +98,32 @@ class WCP_Folders
96
  add_filter('pre-upload-ui', array($this, 'show_dropdown_on_media_screen'));
97
 
98
  add_action('add_attachment', array($this, 'add_attachment_category'));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  }
100
 
101
  public function add_attachment_category($post_ID)
@@ -1956,31 +1984,7 @@ class WCP_Folders
1956
 
1957
  self::check_and_set_post_type();
1958
 
1959
- $options = get_option("folders_settings");
1960
 
1961
- $options = is_array($options)?$options:array();
1962
-
1963
- if (in_array("post", $options)) {
1964
- add_filter('manage_posts_columns', array($this, 'wcp_manage_columns_head'));
1965
- add_action('manage_posts_custom_column', array($this, 'wcp_manage_columns_content'), 10, 2);
1966
- }
1967
-
1968
- if (in_array("page", $options)) {
1969
- add_filter('manage_page_posts_columns', array($this, 'wcp_manage_columns_head'));
1970
- add_action('manage_page_posts_custom_column', array($this, 'wcp_manage_columns_content'), 10, 2);
1971
- }
1972
-
1973
- if (in_array("attachment", $options)) {
1974
- add_filter('manage_media_columns', array($this, 'wcp_manage_columns_head'));
1975
- add_action('manage_media_custom_column', array($this, 'wcp_manage_columns_content'), 10, 2);
1976
- }
1977
-
1978
- foreach ($options as $option) {
1979
- if ($option != "post" && $option != "page" && $option != "attachment") {
1980
- add_filter('manage_'.$option.'_posts_columns', array($this, 'wcp_manage_columns_head'), 99999);
1981
- add_action('manage_media'.$option.'_posts_custom_column', array($this, 'wcp_manage_columns_content'), 10, 2, 99999);
1982
- }
1983
- }
1984
 
1985
  $option = get_option("folder_redirect_status", true);
1986
  if ($option == 1) {
@@ -1999,6 +2003,8 @@ class WCP_Folders
1999
  }
2000
 
2001
  $options = get_option("folders_settings");
 
 
2002
  if (is_array($options) && in_array($type, $options)) {
2003
  $columns = array(
2004
  'wcp_move' => '<div class="wcp-move-multiple wcp-col" title="' . __('Move selected items', WCP_FOLDER) . '"><span class="dashicons dashicons-move"></span><div class="wcp-items"></div></div>',
@@ -2010,20 +2016,28 @@ class WCP_Folders
2010
 
2011
  function wcp_manage_columns_content($column_name, $post_ID)
2012
  {
2013
- global $typenow;
2014
- $type = $typenow;
2015
- if(isset($_REQUEST['action']) && $_REQUEST['action'] == 'inline-save') {
2016
- $type = self::sanitize_options($_REQUEST['post_type']);
2017
  }
 
 
 
 
 
 
 
 
2018
 
2019
- $options = get_option("folders_settings");
2020
- if (is_array($options) && in_array($type, $options)) {
2021
- if ($column_name == 'wcp_move') {
2022
- $title = get_the_title();
2023
- if (strlen($title) > 20) {
2024
- $title = substr($title, 0, 20) . "...";
 
 
2025
  }
2026
- echo "<div class='wcp-move-file' data-id='{$post_ID}'><span class='wcp-move dashicons dashicons-move' data-id='{$post_ID}'></span><span class='wcp-item' data-object-id='{$post_ID}'>" . $title . "</span></div>";
2027
  }
2028
  }
2029
  }
13
 
14
  public $total_folders = 0;
15
 
16
+ private static $postIds;
17
+
18
  public function __construct()
19
  {
20
  spl_autoload_register(array($this, 'autoload'));
98
  add_filter('pre-upload-ui', array($this, 'show_dropdown_on_media_screen'));
99
 
100
  add_action('add_attachment', array($this, 'add_attachment_category'));
101
+
102
+ $options = get_option("folders_settings");
103
+
104
+ $options = is_array($options)?$options:array();
105
+
106
+ if (in_array("post", $options)) {
107
+ add_filter('manage_posts_columns', array($this, 'wcp_manage_columns_head'));
108
+ add_action('manage_posts_custom_column', array($this, 'wcp_manage_columns_content'), 10, 2);
109
+ }
110
+
111
+ if (in_array("page", $options)) {
112
+ add_filter('manage_page_posts_columns', array($this, 'wcp_manage_columns_head'));
113
+ add_action('manage_page_posts_custom_column', array($this, 'wcp_manage_columns_content'), 10, 2);
114
+ }
115
+
116
+ if (in_array("attachment", $options)) {
117
+ add_filter('manage_media_columns', array($this, 'wcp_manage_columns_head'));
118
+ add_action('manage_media_custom_column', array($this, 'wcp_manage_columns_content'), 10, 2);
119
+ }
120
+
121
+ foreach ($options as $option) {
122
+ if ($option != "post" && $option != "page" && $option != "attachment") {
123
+ add_filter('manage_edit-'.$option.'_columns', array($this, 'wcp_manage_columns_head'), 99999);
124
+ add_action('manage_'.$option.'_posts_custom_column', array($this, 'wcp_manage_columns_content'), 2, 2);
125
+ }
126
+ }
127
  }
128
 
129
  public function add_attachment_category($post_ID)
1984
 
1985
  self::check_and_set_post_type();
1986
 
 
1987
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1988
 
1989
  $option = get_option("folder_redirect_status", true);
1990
  if ($option == 1) {
2003
  }
2004
 
2005
  $options = get_option("folders_settings");
2006
+
2007
+ // echo "<pre>"; print_r($defaults);
2008
  if (is_array($options) && in_array($type, $options)) {
2009
  $columns = array(
2010
  'wcp_move' => '<div class="wcp-move-multiple wcp-col" title="' . __('Move selected items', WCP_FOLDER) . '"><span class="dashicons dashicons-move"></span><div class="wcp-items"></div></div>',
2016
 
2017
  function wcp_manage_columns_content($column_name, $post_ID)
2018
  {
2019
+ $postIDs = self::$postIds;
2020
+ if(!is_array($postIDs)) {
2021
+ $postIDs = array();
 
2022
  }
2023
+ if(!in_array($post_ID, $postIDs)) {
2024
+ $postIDs[] = $post_ID;
2025
+ self::$postIds = $postIDs;
2026
+ global $typenow;
2027
+ $type = $typenow;
2028
+ if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'inline-save') {
2029
+ $type = self::sanitize_options($_REQUEST['post_type']);
2030
+ }
2031
 
2032
+ $options = get_option("folders_settings");
2033
+ if (is_array($options) && in_array($type, $options)) {
2034
+ if ($column_name == 'wcp_move') {
2035
+ $title = get_the_title();
2036
+ if (strlen($title) > 20) {
2037
+ $title = substr($title, 0, 20) . "...";
2038
+ }
2039
+ echo "<div class='wcp-move-file' data-id='{$post_ID}'><span class='wcp-move dashicons dashicons-move' data-id='{$post_ID}'></span><span class='wcp-item' data-object-id='{$post_ID}'>" . $title . "</span></div>";
2040
  }
 
2041
  }
2042
  }
2043
  }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: galdub, tomeraharon, premio
3
  Tags: folder, folders, organize, pages folders, media library, posts folders, media folders, subfolders, file manager, directories
4
  Requires at least: 3.0.0
5
  Tested up to: 5.2
6
- Stable tag: 2.1.6
7
  Plugin URI: https://premio.io/downloads/folders/
8
 
9
  Folders is a WordPress plugin that will help you quickly organize and manage all of your Pages, Posts and Media library files in folders.
@@ -127,6 +127,9 @@ A live demo for the Folders plugin is available at <a href="https://demo.premio.
127
 
128
  == Changelog ==
129
 
 
 
 
130
  = 2.1.6 =
131
  * Now you can drag and drop single media library files without clicking on the "Organize" button. We've also fixed a WooCommerce products page bug, Safari issue and some other media library issues
132
 
3
  Tags: folder, folders, organize, pages folders, media library, posts folders, media folders, subfolders, file manager, directories
4
  Requires at least: 3.0.0
5
  Tested up to: 5.2
6
+ Stable tag: 2.1.7
7
  Plugin URI: https://premio.io/downloads/folders/
8
 
9
  Folders is a WordPress plugin that will help you quickly organize and manage all of your Pages, Posts and Media library files in folders.
127
 
128
  == Changelog ==
129
 
130
+ = 2.1.7 =
131
+ * Better drag and drop, SportPress support
132
+
133
  = 2.1.6 =
134
  * Now you can drag and drop single media library files without clicking on the "Organize" button. We've also fixed a WooCommerce products page bug, Safari issue and some other media library issues
135
 
templates/admin/upgrade-to-pro.php CHANGED
@@ -1,5 +1,6 @@
1
  <?php
2
  defined('ABSPATH') or die('Nope, not accessing this');
 
3
  ?>
4
  <link href="<?php echo WCP_FOLDER_URL ?>assets/css/admin-setting.css" type="text/css" rel="stylesheet" />
5
  <div class="wrap">
@@ -30,8 +31,18 @@ defined('ABSPATH') or die('Nope, not accessing this');
30
  <div class="rpt_feature rpt_feature_0-2"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>You can add unlimited pages, posts and media files to your folders</span>Unlimited files<span class="rpt_tooltip_plus"> +</span></a></div>
31
  <div class="rpt_feature rpt_feature_0-3"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>You can create additional 2 tires of sub-folders</span>Sub-folders<span class="rpt_tooltip_plus"> +</span></a></div>
32
  <div class="rpt_feature rpt_feature_0-4"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>You can create unlimited folders and sub-folders. On the Free plan it is limited to 10 folders in total</span>Unlimited folders<span class="rpt_tooltip_plus"> +</span></a></div>
33
- <div class="rpt_feature rpt_feature_0-6">
34
- <?php _e('Updates and support for 1 year', WCP_FOLDER); ?>
 
 
 
 
 
 
 
 
 
 
35
  </div>
36
  </div>
37
  <div style="clear:both;"></div>
@@ -59,8 +70,18 @@ defined('ABSPATH') or die('Nope, not accessing this');
59
  <div class="rpt_feature rpt_feature_0-2"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>You can add unlimited pages, posts and media files to your folders</span>Unlimited files<span class="rpt_tooltip_plus"> +</span></a></div>
60
  <div class="rpt_feature rpt_feature_0-3"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>You can create additional 2 tires of sub-folders</span>Sub-folders<span class="rpt_tooltip_plus"> +</span></a></div>
61
  <div class="rpt_feature rpt_feature_0-4"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>You can create unlimited folders and sub-folders. On the Free plan it is limited to 10 folders in total</span>Unlimited folders<span class="rpt_tooltip_plus"> +</span></a></div>
62
- <div class="rpt_feature rpt_feature_0-6">
63
- <?php _e('Updates and support for 1 year', WCP_FOLDER); ?>
 
 
 
 
 
 
 
 
 
 
64
  </div>
65
  </div>
66
  <div style="clear:both;"></div>
@@ -90,8 +111,18 @@ defined('ABSPATH') or die('Nope, not accessing this');
90
  <div class="rpt_feature rpt_feature_0-2"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>You can add unlimited pages, posts and media files to your folders</span>Unlimited files<span class="rpt_tooltip_plus"> +</span></a></div>
91
  <div class="rpt_feature rpt_feature_0-3"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>You can create additional 2 tires of sub-folders</span>Sub-folders<span class="rpt_tooltip_plus"> +</span></a></div>
92
  <div class="rpt_feature rpt_feature_0-4"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>You can create unlimited folders and sub-folders. On the Free plan it is limited to 10 folders in total</span>Unlimited folders<span class="rpt_tooltip_plus"> +</span></a></div>
93
- <div class="rpt_feature rpt_feature_0-6">
94
- <?php _e('Updates and support for 1 year', WCP_FOLDER); ?>
 
 
 
 
 
 
 
 
 
 
95
  </div>
96
  </div>
97
  <div style="clear:both;"></div>
@@ -129,4 +160,17 @@ defined('ABSPATH') or die('Nope, not accessing this');
129
  </div>
130
  </div>
131
  </div>
132
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
  defined('ABSPATH') or die('Nope, not accessing this');
3
+ $pro_url = $pro_url = "https://go.premio.io/?edd_action=add_to_cart&download_id=687&edd_options[price_id]=";
4
  ?>
5
  <link href="<?php echo WCP_FOLDER_URL ?>assets/css/admin-setting.css" type="text/css" rel="stylesheet" />
6
  <div class="wrap">
31
  <div class="rpt_feature rpt_feature_0-2"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>You can add unlimited pages, posts and media files to your folders</span>Unlimited files<span class="rpt_tooltip_plus"> +</span></a></div>
32
  <div class="rpt_feature rpt_feature_0-3"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>You can create additional 2 tires of sub-folders</span>Sub-folders<span class="rpt_tooltip_plus"> +</span></a></div>
33
  <div class="rpt_feature rpt_feature_0-4"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>You can create unlimited folders and sub-folders. On the Free plan it is limited to 10 folders in total</span>Unlimited folders<span class="rpt_tooltip_plus"> +</span></a></div>
34
+ <div class="rpt_feature rpt_feature_0-5">
35
+ <select data-key="0" class="multiple-options">
36
+ <option data-header="Renewals for 25% off" data-price="19" value="<?php echo esc_url($pro_url."1") ?>">
37
+ <?php esc_html_e("Updates & support for 1 year") ?>
38
+ </option>
39
+ <option data-header="For 3 years" data-price="35" value="<?php echo esc_url($pro_url."4") ?>">
40
+ <?php esc_html_e("Updates & support for 3 years") ?>
41
+ </option>
42
+ <option data-header="For lifetime" data-price="59" value="<?php echo esc_url($pro_url."5") ?>">
43
+ <?php esc_html_e("Updates & support for lifetime") ?>
44
+ </option>
45
+ </select>
46
  </div>
47
  </div>
48
  <div style="clear:both;"></div>
70
  <div class="rpt_feature rpt_feature_0-2"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>You can add unlimited pages, posts and media files to your folders</span>Unlimited files<span class="rpt_tooltip_plus"> +</span></a></div>
71
  <div class="rpt_feature rpt_feature_0-3"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>You can create additional 2 tires of sub-folders</span>Sub-folders<span class="rpt_tooltip_plus"> +</span></a></div>
72
  <div class="rpt_feature rpt_feature_0-4"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>You can create unlimited folders and sub-folders. On the Free plan it is limited to 10 folders in total</span>Unlimited folders<span class="rpt_tooltip_plus"> +</span></a></div>
73
+ <div class="rpt_feature rpt_feature_0-5">
74
+ <select data-key="0" class="multiple-options">
75
+ <option data-header="Renewals for 25% off" data-price="39" value="<?php echo esc_url($pro_url."2") ?>">
76
+ <?php esc_html_e("Updates & support for 1 year") ?>
77
+ </option>
78
+ <option data-header="For 3 years" data-price="65" value="<?php echo esc_url($pro_url."6") ?>">
79
+ <?php esc_html_e("Updates & support for 3 years") ?>
80
+ </option>
81
+ <option data-header="For lifetime" data-price="99" value="<?php echo esc_url($pro_url."7") ?>">
82
+ <?php esc_html_e("Updates & support for lifetime") ?>
83
+ </option>
84
+ </select>
85
  </div>
86
  </div>
87
  <div style="clear:both;"></div>
111
  <div class="rpt_feature rpt_feature_0-2"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>You can add unlimited pages, posts and media files to your folders</span>Unlimited files<span class="rpt_tooltip_plus"> +</span></a></div>
112
  <div class="rpt_feature rpt_feature_0-3"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>You can create additional 2 tires of sub-folders</span>Sub-folders<span class="rpt_tooltip_plus"> +</span></a></div>
113
  <div class="rpt_feature rpt_feature_0-4"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>You can create unlimited folders and sub-folders. On the Free plan it is limited to 10 folders in total</span>Unlimited folders<span class="rpt_tooltip_plus"> +</span></a></div>
114
+ <div class="rpt_feature rpt_feature_0-5">
115
+ <select data-key="0" class="multiple-options">
116
+ <option data-header="Renewals for 25% off" data-price="79" value="<?php echo esc_url($pro_url."3") ?>">
117
+ <?php esc_html_e("Updates & support for 1 year") ?>
118
+ </option>
119
+ <option data-header="For 3 years" data-price="139" value="<?php echo esc_url($pro_url."8") ?>">
120
+ <?php esc_html_e("Updates & support for 3 years") ?>
121
+ </option>
122
+ <option data-header="For lifetime" data-price="199" value="<?php echo esc_url($pro_url."9") ?>">
123
+ <?php esc_html_e("Updates & support for lifetime") ?>
124
+ </option>
125
+ </select>
126
  </div>
127
  </div>
128
  <div style="clear:both;"></div>
160
  </div>
161
  </div>
162
  </div>
163
+ </div>
164
+
165
+ <script>
166
+ jQuery(document).ready(function(){
167
+ jQuery(".multiple-options").change(function(){
168
+ thisValue = jQuery(this).val();
169
+ jQuery(this).closest(".rpt_plan").find("a.rpt_foot").attr("href", thisValue);
170
+ thisPrice = jQuery(this).find("option:selected").attr("data-price");
171
+ jQuery(this).closest(".rpt_plan").find(".rpt_price").text("$"+thisPrice);
172
+ priceText = jQuery(this).find("option:selected").attr("data-header");
173
+ jQuery(this).closest(".rpt_plan").find(".rpt_desc").text(priceText);
174
+ });
175
+ });
176
+ </script>