Search Over 18,000 FREE Plugins from the Official WordPress Plugin Directory Repository

Sort Page List by Last Name

Sorts wp_list_pages-generated page lists by last name or, more generally, the last word of any page's title.

Aimed at archivists and other WordPress developers who use the names of individuals as page titles, this plugin sorts wp_list_pages-generated page lists by last name. More generally, the plugin can also be used to sort wp_list_pages-generated page lists by the last word of any page's title.

Author Studio Hyperset, Inc.
Profile
Contributors studiohyperset, oqm4, ryanajarrett
Tags function, list, name, page, plugin, title, wp_list_pages

 

After installing and activating, developers can order any wp_list_pages-generated page list by surname -- or, more generally, last word -- using the sortbylastname=1 parameter, e.g., <?php wp_list_pages('title_li=&sortbylastname=1'); ?>. Use a "0" to (temporarily) disable the plugin.

1.0

Links

Developer Notes

PLEASE NOTE: Line 14 extracts each separate line of HTML from the original wp_list_pages output and puts it into an array called $lines. The \n parameter tells the explode command that each line ends with a carriage return. However, as of WordPress 3.2.1, the explode command assumes each line ends when it finds an n. As such, if developers edit the plugin using the WordPress code editor, they should add an extra backslash (\) in front of the n before saving the file (e.g, $lines = explode("\\n", $val);). The line will revert to $lines = explode("\n", $val); on save.

Share  
Download
Version 1.0

Requires WordPress version: 3.0 or higher

Compatible up to: 3.5.1

Last Updated 25 Jan 2013

Date Added: 04 Dec 2011

Plugin Homepage

Evaluation
star1
star2
star3
star4
star5

5 stars
2 ratings
652 downloads

Compatibility

Not Enough Data

Reports:
Works: 2
Broken: 0