Skip to content

Commit b208a14

Browse files
jzaeffererrdworth
authored andcommitted
jqueryui.com: Sort demos by title
(cherry picked from commit 78349dc) Conflicts: themes/jquery/js/scripts.js
1 parent 37ca551 commit b208a14

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mu-plugins/jqueryui.com/jquery-filters.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111

1212
$plugin = $post->post_name;
1313
$demoList = json_decode( file_get_contents( GW_RESOURCE_DIR . '/demos/demo-list.json' ) );
14-
$defaultDemo = $demoList->$plugin->default;
14+
$demos = $demoList->$plugin;
15+
$defaultDemo = $demos[ 0 ];
1516

1617
$demoContent .=
1718
'<div class="demo-list">' .
1819
'<h2>Examples</h2>' .
1920
'<ul>';
20-
foreach ( $demoList->$plugin as $filename => $demo ) {
21+
foreach ( $demoList->$plugin as $demo ) {
22+
$filename = $demo->filename;
2123
$demoContent .=
2224
($filename === 'default' ? '<li class="active">' : '<li>') .
2325
'<a href="/resources/demos/' . $plugin . '/' . $filename . '.html">' .

0 commit comments

Comments
 (0)