Version Description
- Fixed problems with new option to ignore specific articles introduced in version 7.3 beta 2
Download this release
Release Info
Developer | jackdewey |
Plugin | Link Library |
Version | 7.3.2 |
Comparing to | |
See all releases |
Code changes from version 7.3.1 to 7.3.2
- link-library.php +1 -29
- readme.txt +4 -1
- render-link-library-sc.php +37 -1
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: 7.3.
|
7 |
Author: Yannick Lefebvre
|
8 |
Author URI: http://ylefebvre.github.io/
|
9 |
Text Domain: link-library
|
@@ -317,8 +317,6 @@ class link_library_plugin {
|
|
317 |
|
318 |
add_filter( 'posts_where', array( $this, 'll_posts_where' ), 10, 2 );
|
319 |
|
320 |
-
add_filter( 'posts_orderby', array( $this, 'll_posts_orderby' ), 10, 2 );
|
321 |
-
|
322 |
// Load text domain for translation of admin pages and text strings
|
323 |
load_plugin_textdomain( 'link-library', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
|
324 |
|
@@ -394,32 +392,6 @@ class link_library_plugin {
|
|
394 |
return $where;
|
395 |
}
|
396 |
|
397 |
-
function ll_posts_orderby( $orderby, $wp_query ) {
|
398 |
-
if ( '_llcustomtitlesort' !== $wp_query->get( 'orderby' ) ) {
|
399 |
-
return $orderby;
|
400 |
-
}
|
401 |
-
|
402 |
-
$genoptions = get_option( 'LinkLibraryGeneral' );
|
403 |
-
$genoptions = wp_parse_args( $genoptions, ll_reset_gen_settings( 'return' ) );
|
404 |
-
|
405 |
-
global $wpdb;
|
406 |
-
|
407 |
-
$matches = $genoptions['ignoresortarticles']; // REGEXP is not case sensitive here
|
408 |
-
|
409 |
-
// Custom ordering (SQL)
|
410 |
-
return sprintf(
|
411 |
-
"
|
412 |
-
CASE
|
413 |
-
WHEN {$wpdb->posts}.post_title REGEXP( '^($matches)[[:space:]]+' )
|
414 |
-
THEN TRIM( SUBSTR( {$wpdb->posts}.post_title FROM %d ))
|
415 |
-
ELSE {$wpdb->posts}.post_title
|
416 |
-
END %s
|
417 |
-
",
|
418 |
-
strlen( $matches ) + 1,
|
419 |
-
'ASC' === strtoupper( $wp_query->get( 'order' ) ) ? 'ASC' : 'DESC'
|
420 |
-
);
|
421 |
-
}
|
422 |
-
|
423 |
function link_library_rss_feed_request( $qv ) {
|
424 |
|
425 |
if ( isset( $qv['feed'] ) && !isset( $qv['post_type'] ) ) {
|
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: 7.3.2
|
7 |
Author: Yannick Lefebvre
|
8 |
Author URI: http://ylefebvre.github.io/
|
9 |
Text Domain: link-library
|
317 |
|
318 |
add_filter( 'posts_where', array( $this, 'll_posts_where' ), 10, 2 );
|
319 |
|
|
|
|
|
320 |
// Load text domain for translation of admin pages and text strings
|
321 |
load_plugin_textdomain( 'link-library', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
|
322 |
|
392 |
return $where;
|
393 |
}
|
394 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
395 |
function link_library_rss_feed_request( $qv ) {
|
396 |
|
397 |
if ( isset( $qv['feed'] ) && !isset( $qv['post_type'] ) ) {
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://ylefebvre.github.io/wordpress-plugins/link-library/
|
|
4 |
Tags: link, list, directory, page, library, AJAX, RSS, feeds, inline, search, paging, add, submit, import, batch, pop-up
|
5 |
Requires at least: 4.4
|
6 |
Tested up to: 5.9
|
7 |
-
Stable tag: 7.3.
|
8 |
|
9 |
The purpose of this plugin is to add the ability to output a list of link categories and a complete list of links with notes and descriptions.
|
10 |
|
@@ -48,6 +48,9 @@ Further configuration is available under the Link Library Settings panel.
|
|
48 |
|
49 |
== Changelog ==
|
50 |
|
|
|
|
|
|
|
51 |
= 7.3.1 =
|
52 |
* Added extra field to Link Library widget to allow users to select category(ies) to be displayed
|
53 |
|
4 |
Tags: link, list, directory, page, library, AJAX, RSS, feeds, inline, search, paging, add, submit, import, batch, pop-up
|
5 |
Requires at least: 4.4
|
6 |
Tested up to: 5.9
|
7 |
+
Stable tag: 7.3.2
|
8 |
|
9 |
The purpose of this plugin is to add the ability to output a list of link categories and a complete list of links with notes and descriptions.
|
10 |
|
48 |
|
49 |
== Changelog ==
|
50 |
|
51 |
+
= 7.3.2 =
|
52 |
+
* Fixed problems with new option to ignore specific articles introduced in version 7.3 beta 2
|
53 |
+
|
54 |
= 7.3.1 =
|
55 |
* Added extra field to Link Library widget to allow users to select category(ies) to be displayed
|
56 |
|
render-link-library-sc.php
CHANGED
@@ -24,6 +24,32 @@ function link_library_highlight_phrase( $str, $phrase, $tag_open = '<strong>', $
|
|
24 |
return $str;
|
25 |
}
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
function link_library_get_breadcrumb_path( $slug, $rewritepage, $level = 0 ) {
|
28 |
$genoptions = get_option( 'LinkLibraryGeneral' );
|
29 |
$genoptions = wp_parse_args( $genoptions, ll_reset_gen_settings( 'return' ) );
|
@@ -886,7 +912,7 @@ function RenderLinkLibrary( $LLPluginClass, $generaloptions, $libraryoptions, $s
|
|
886 |
}
|
887 |
|
888 |
if ( 'name' == $linkorder ) {
|
889 |
-
$link_query_args['orderby'] = '
|
890 |
$link_query_args['order'] = in_array( $linkdirection, $validdirections ) ? $linkdirection : 'ASC';
|
891 |
} elseif ( 'id' == $linkorder ) {
|
892 |
$link_query_args['orderby']['ID'] = in_array( $linkdirection, $validdirections ) ? $linkdirection : 'ASC';
|
@@ -977,8 +1003,18 @@ function RenderLinkLibrary( $LLPluginClass, $generaloptions, $libraryoptions, $s
|
|
977 |
$link_query_args['tax_query']['relation'] = 'AND';
|
978 |
}
|
979 |
|
|
|
|
|
|
|
|
|
|
|
980 |
$the_link_query = new WP_Query( $link_query_args );
|
981 |
|
|
|
|
|
|
|
|
|
|
|
982 |
if ( $debugmode ) {
|
983 |
$output .= "\n<!-- Link Query: " . print_r( $link_query_args, TRUE ) . "-->\n\n";
|
984 |
$output .= "\n<!-- Link Results: " . print_r( $the_link_query, TRUE ) . "-->\n\n";
|
24 |
return $str;
|
25 |
}
|
26 |
|
27 |
+
function ll_create_temp_column( $fields ) {
|
28 |
+
global $wpdb;
|
29 |
+
|
30 |
+
$genoptions = get_option( 'LinkLibraryGeneral' );
|
31 |
+
$genoptions = wp_parse_args( $genoptions, ll_reset_gen_settings( 'return' ) );
|
32 |
+
|
33 |
+
$matches = $genoptions['ignoresortarticles'];;
|
34 |
+
$has_the = " CASE
|
35 |
+
WHEN $wpdb->posts.post_title regexp( '^($matches)[[:space:]]' )
|
36 |
+
THEN trim(substr($wpdb->posts.post_title from 4))
|
37 |
+
ELSE $wpdb->posts.post_title
|
38 |
+
END AS title2";
|
39 |
+
if ( $has_the ) {
|
40 |
+
$fields .= ( preg_match( '/^(\s+)?,/', $has_the ) ) ? $has_the : ", $has_the";
|
41 |
+
}
|
42 |
+
return $fields;
|
43 |
+
}
|
44 |
+
|
45 |
+
function ll_sort_by_temp_column ($orderby) {
|
46 |
+
$custom_orderby = " UPPER(title2) ASC";
|
47 |
+
if ($custom_orderby) {
|
48 |
+
$orderby = $custom_orderby;
|
49 |
+
}
|
50 |
+
return $orderby;
|
51 |
+
}
|
52 |
+
|
53 |
function link_library_get_breadcrumb_path( $slug, $rewritepage, $level = 0 ) {
|
54 |
$genoptions = get_option( 'LinkLibraryGeneral' );
|
55 |
$genoptions = wp_parse_args( $genoptions, ll_reset_gen_settings( 'return' ) );
|
912 |
}
|
913 |
|
914 |
if ( 'name' == $linkorder ) {
|
915 |
+
$link_query_args['orderby'] = 'title';
|
916 |
$link_query_args['order'] = in_array( $linkdirection, $validdirections ) ? $linkdirection : 'ASC';
|
917 |
} elseif ( 'id' == $linkorder ) {
|
918 |
$link_query_args['orderby']['ID'] = in_array( $linkdirection, $validdirections ) ? $linkdirection : 'ASC';
|
1003 |
$link_query_args['tax_query']['relation'] = 'AND';
|
1004 |
}
|
1005 |
|
1006 |
+
if ( 'name' == $linkorder && !empty( $ignoresortarticles ) ) {
|
1007 |
+
add_filter( 'posts_fields', 'll_create_temp_column' );
|
1008 |
+
add_filter( 'posts_orderby', 'll_sort_by_temp_column' );
|
1009 |
+
}
|
1010 |
+
|
1011 |
$the_link_query = new WP_Query( $link_query_args );
|
1012 |
|
1013 |
+
if ( 'name' == $linkorder && !empty( $ignoresortarticles ) ) {
|
1014 |
+
remove_filter( 'posts_fields', 'll_create_temp_column' );
|
1015 |
+
remove_filter( 'posts_orderby', 'll_sort_by_temp_column' );
|
1016 |
+
}
|
1017 |
+
|
1018 |
if ( $debugmode ) {
|
1019 |
$output .= "\n<!-- Link Query: " . print_r( $link_query_args, TRUE ) . "-->\n\n";
|
1020 |
$output .= "\n<!-- Link Results: " . print_r( $the_link_query, TRUE ) . "-->\n\n";
|