Link Library - Version 6.0-Beta4

Version Description

Download this release

Release Info

Developer jackdewey
Plugin Icon 128x128 Link Library
Version 6.0-Beta4
Comparing to
See all releases

Code changes from version 6.0-Beta3 to 6.0-Beta4

link-library-admin.php CHANGED
@@ -1201,8 +1201,25 @@ class link_library_plugin_admin {
1201
  $row = 0;
1202
  $successfulimport = 0;
1203
  $successfulupdate = 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1204
 
1205
- if ( isset( $_POST['importlinks'] ) ) {
 
1206
  wp_suspend_cache_addition( true );
1207
  set_time_limit( 600 );
1208
 
@@ -2073,6 +2090,10 @@ class link_library_plugin_admin {
2073
  <td>
2074
  <input type='hidden' value='<?php echo $genoptions['schemaversion']; ?>' name='schemaversion' id='schemaversion' />
2075
  <table>
 
 
 
 
2076
  <?php if ( !is_multisite() ) { ?>
2077
  <tr>
2078
  <td><?php _e( 'Update channel', 'link-library' ); ?></td>
1201
  $row = 0;
1202
  $successfulimport = 0;
1203
  $successfulupdate = 0;
1204
+
1205
+ if ( isset( $_POST['ll60reupdate'] ) ) {
1206
+ global $wpdb;
1207
+
1208
+ $wpdb->get_results ( 'DELETE a,b,c
1209
+ FROM wp_posts a
1210
+ LEFT JOIN wp_term_relationships b
1211
+ ON (a.ID = b.object_id)
1212
+ LEFT JOIN wp_postmeta c
1213
+ ON (a.ID = c.post_id)
1214
+ WHERE a.post_type = \'link_library_links\';' );
1215
+
1216
+ $link_category_terms = get_terms( 'link_library_category', array( 'fields' => 'ids', 'hide_empty' => false ) );
1217
+ foreach ( $link_category_terms as $value ) {
1218
+ wp_delete_term( $value, 'link_library_category' );
1219
+ }
1220
 
1221
+ delete_option( 'LinkLibrary60Update' );
1222
+ } elseif ( isset( $_POST['importlinks'] ) ) {
1223
  wp_suspend_cache_addition( true );
1224
  set_time_limit( 600 );
1225
 
2090
  <td>
2091
  <input type='hidden' value='<?php echo $genoptions['schemaversion']; ?>' name='schemaversion' id='schemaversion' />
2092
  <table>
2093
+ <tr>
2094
+ <td><?php _e( 'Link Library 6.0 Beta', 'link-library' ); ?></td>
2095
+ <td><input type="submit" id="ll60reupdate" name="ll60reupdate" value="<?php _e( 'Re-import links', 'link-library' ); ?>" /></td>
2096
+ </tr>
2097
  <?php if ( !is_multisite() ) { ?>
2098
  <tr>
2099
  <td><?php _e( 'Update channel', 'link-library' ); ?></td>
link-library-update-60.php CHANGED
@@ -138,37 +138,50 @@ function link_library_60_update( $plugin_class ) {
138
  }
139
 
140
  $genoptions = get_option( 'LinkLibraryGeneral' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
141
 
142
- for ( $i = 1; $i <= $genoptions['numberstylesets']; $i++ ) {
143
- $settingsname = 'LinkLibraryPP' . $i;
144
- $options = get_option( $settingsname );
145
-
146
- $lists_of_cats = array( 'categorylist', 'excludecategorylist', 'defaultsinglecat' );
147
 
148
- foreach ( $lists_of_cats as $list_of_cats ) {
149
- if ( !empty( $options[$list_of_cats] ) ) {
150
- $category_list_array = explode( ',', $options[$list_of_cats] );
151
- $new_category_list_array = array();
152
 
153
- foreach ( $category_list_array as $category_list_item ) {
154
- $original_term = get_term( $category_list_item, 'link_category' );
155
- $corresponding_term = get_term_by( 'name', $original_term->name, 'link_library_category' );
156
- $new_category_list_array[] = $corresponding_term->term_id;
157
  }
158
 
159
- $new_category_list = implode( ',', $new_category_list_array );
160
- $options[$list_of_cats . '_cpt'] = $new_category_list;
161
- } else {
162
- $options[$list_of_cats . '_cpt'] = '';
163
  }
164
  }
165
-
166
- $newcolumnoptions[] = $options['linkheader'];
167
- $newcolumnoptions[] = $options['descheader'];
168
- $newcolumnoptions[] = $options['notesheader'];
169
- $options['columnheaderoverride'] = implode( ',', $newcolumnoptions );
170
-
171
- update_option( $settingsname, $options );
172
  }
173
 
174
  update_option( 'LinkLibrary60Update', true );
138
  }
139
 
140
  $genoptions = get_option( 'LinkLibraryGeneral' );
141
+ if ( !empty( $genoptions ) ) {
142
+ for ( $i = 1; $i <= $genoptions['numberstylesets']; $i++ ) {
143
+ $settingsname = 'LinkLibraryPP' . $i;
144
+ $options = get_option( $settingsname );
145
+
146
+ if ( !empty( $options ) ) {
147
+ $lists_of_cats = array( 'categorylist', 'excludecategorylist', 'defaultsinglecat' );
148
+
149
+ foreach ( $lists_of_cats as $list_of_cats ) {
150
+ if ( !empty( $options[$list_of_cats] ) ) {
151
+ $category_list_array = explode( ',', $options[$list_of_cats] );
152
+ $new_category_list_array = array();
153
+
154
+ foreach ( $category_list_array as $category_list_item ) {
155
+ $original_term = get_term( $category_list_item, 'link_category' );
156
+ $corresponding_term = get_term_by( 'name', $original_term->name, 'link_library_category' );
157
+ $new_category_list_array[] = $corresponding_term->term_id;
158
+ }
159
+
160
+ $new_category_list = implode( ',', $new_category_list_array );
161
+ $options[$list_of_cats . '_cpt'] = $new_category_list;
162
+ } else {
163
+ $options[$list_of_cats . '_cpt'] = '';
164
+ }
165
+ }
166
 
167
+ $newcolumnoptions = array();
168
+ if ( isset( $options['linkheader'] ) ) {
169
+ $newcolumnoptions[] = $options['linkheader'];
170
+ }
 
171
 
172
+ if ( isset( $options['descheader'] ) ) {
173
+ $newcolumnoptions[] = $options['descheader'];
174
+ }
 
175
 
176
+ if ( isset( $options['notesheader'] ) ) {
177
+ $newcolumnoptions[] = $options['notesheader'];
 
 
178
  }
179
 
180
+ $options['columnheaderoverride'] = implode( ',', $newcolumnoptions );
181
+
182
+ update_option( $settingsname, $options );
 
183
  }
184
  }
 
 
 
 
 
 
 
185
  }
186
 
187
  update_option( 'LinkLibrary60Update', true );
link-library.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Link Library
4
  Plugin URI: http://wordpress.org/extend/plugins/link-library/
5
  Description: Display links on pages with a variety of options
6
- Version: 6.0 Beta 2
7
  Author: Yannick Lefebvre
8
  Author URI: http://ylefebvre.ca/
9
  Text Domain: link-library
@@ -254,10 +254,6 @@ class link_library_plugin {
254
  add_filter( 'wp_feed_cache_transient_lifetime' , array( $this, 'feed_cache_filter_handler' ) );
255
 
256
  add_filter( 'post_type_link', array( $this, 'permalink_structure' ), 10, 4 );
257
-
258
- global $wpdb;
259
-
260
- $wpdb->linkcategorymeta = $wpdb->get_blog_prefix() . 'linkcategorymeta';
261
  }
262
 
263
  function feed_cache_filter_handler( $seconds ) {
3
  Plugin Name: Link Library
4
  Plugin URI: http://wordpress.org/extend/plugins/link-library/
5
  Description: Display links on pages with a variety of options
6
+ Version: 6.0 Beta 4
7
  Author: Yannick Lefebvre
8
  Author URI: http://ylefebvre.ca/
9
  Text Domain: link-library
254
  add_filter( 'wp_feed_cache_transient_lifetime' , array( $this, 'feed_cache_filter_handler' ) );
255
 
256
  add_filter( 'post_type_link', array( $this, 'permalink_structure' ), 10, 4 );
 
 
 
 
257
  }
258
 
259
  function feed_cache_filter_handler( $seconds ) {
readme.txt CHANGED
@@ -59,6 +59,11 @@ Further configuration is available under the Link Library Settings panel.
59
 
60
  == Changelog ==
61
 
 
 
 
 
 
62
  = 6.0 Beta 3 =
63
  * Incorporated changes from 5.9.15.3
64
 
59
 
60
  == Changelog ==
61
 
62
+ = 6.0 Beta 4 =
63
+ * Corrected warnings when activating plugin on a site that had never had old version of Link Library
64
+ * Added button under General Options to re-import links from 5.9.x to 6.0
65
+ * Removed code in plugin initialization referring to inexistent table
66
+
67
  = 6.0 Beta 3 =
68
  * Incorporated changes from 5.9.15.3
69