Skip to content

Commit 7a195ce

Browse files
committed
All: move twitter override to site options
remove use of the non-standard `JQUERY_LIVE_DOMAIN` constant and turn this into a site option instead.
1 parent 94211f0 commit 7a195ce

File tree

2 files changed

+17
-19
lines changed

2 files changed

+17
-19
lines changed

sites.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ function jquery_sites() {
8484
'jquery_body_class' => 'jquery-ui',
8585
'jquery_docsearch_api_key' => '2fce35e56784bbb48c78d105739190c2',
8686
'jquery_docsearch_index_name' => 'jqueryui',
87+
'jquery_twitter_link' => 'https://twitter.com/jqueryui',
8788
),
8889
),
8990
'blog.jqueryui.com' => array(
@@ -93,10 +94,11 @@ function jquery_sites() {
9394
'blogname' => 'jQuery UI Blog',
9495
'stylesheet' => 'blog.jqueryui.com',
9596
'jquery_body_class' => 'jquery-ui',
97+
'jquery_twitter_link' => 'https://twitter.com/jqueryui',
9698
),
9799
),
98100
'api.jqueryui.com' => array(
99-
'subsites' => 1, // Has one level of sub-sites (api.jqueryui.com/([^/]+))
101+
'subsites' => true, // Has one level of sub-sites (api.jqueryui.com/([^/]+))
100102
'blog_id' => 8,
101103
'cookie_domain' => '.jqueryui.com',
102104
'options' => array(
@@ -109,6 +111,7 @@ function jquery_sites() {
109111
'jquery_logo_link'=> 'https://jqueryui.com/',
110112
'jquery_docsearch_api_key' => '2fce35e56784bbb48c78d105739190c2',
111113
'jquery_docsearch_index_name' => 'jqueryui',
114+
'jquery_twitter_link' => 'https://twitter.com/jqueryui',
112115
),
113116
),
114117
'api.jqueryui.com/1.8' => array(
@@ -125,6 +128,7 @@ function jquery_sites() {
125128
'jquery_logo_link'=> 'https://jqueryui.com/',
126129
'jquery_docsearch_api_key' => '2fce35e56784bbb48c78d105739190c2',
127130
'jquery_docsearch_index_name' => 'jqueryui',
131+
'jquery_twitter_link' => 'https://twitter.com/jqueryui',
128132
),
129133
),
130134
'api.jqueryui.com/1.9' => array(
@@ -141,6 +145,7 @@ function jquery_sites() {
141145
'jquery_logo_link'=> 'https://jqueryui.com/',
142146
'jquery_docsearch_api_key' => '2fce35e56784bbb48c78d105739190c2',
143147
'jquery_docsearch_index_name' => 'jqueryui',
148+
'jquery_twitter_link' => 'https://twitter.com/jqueryui',
144149
),
145150
),
146151
'jquery.org' => array(
@@ -169,10 +174,11 @@ function jquery_sites() {
169174
'jquery_body_class' => 'jquery-mobile',
170175
'jquery_docsearch_api_key' => '207328b0f1c18555c9021d05157dd651',
171176
'jquery_docsearch_index_name' => 'jquerymobile',
177+
'jquery_twitter_link' => 'https://twitter.com/jquerymobile',
172178
),
173179
),
174180
'api.jquerymobile.com' => array(
175-
'subsites' => 1, // Has one level of sub-sites (api.jquerymobile.com/([^/]+))
181+
'subsites' => true, // Has one level of sub-sites (api.jquerymobile.com/([^/]+))
176182
'blog_id' => 13,
177183
'cookie_domain' => '.jquerymobile.com',
178184
'options' => array(
@@ -185,6 +191,7 @@ function jquery_sites() {
185191
'jquery_logo_link'=> 'https://jquerymobile.com/',
186192
'jquery_docsearch_api_key' => '207328b0f1c18555c9021d05157dd651',
187193
'jquery_docsearch_index_name' => 'jquerymobile',
194+
'jquery_twitter_link' => 'https://twitter.com/jquerymobile',
188195
),
189196
),
190197
# Historical: Database blog_id 14 is reserved for api.qunitjs.com.
@@ -242,6 +249,7 @@ function jquery_sites() {
242249
'jquery_logo_link'=> 'https://jquerymobile.com/',
243250
'jquery_docsearch_api_key' => '207328b0f1c18555c9021d05157dd651',
244251
'jquery_docsearch_index_name' => 'jquerymobile',
252+
'jquery_twitter_link' => 'https://twitter.com/jquerymobile',
245253
),
246254
),
247255
'api.jqueryui.com/1.10' => array(
@@ -258,6 +266,7 @@ function jquery_sites() {
258266
'jquery_logo_link'=> 'https://jqueryui.com/',
259267
'jquery_docsearch_api_key' => '2fce35e56784bbb48c78d105739190c2',
260268
'jquery_docsearch_index_name' => 'jqueryui',
269+
'jquery_twitter_link' => 'https://twitter.com/jqueryui',
261270
),
262271
),
263272
'api.jqueryui.com/1.12' => array(
@@ -274,6 +283,7 @@ function jquery_sites() {
274283
'jquery_logo_link'=> 'https://jqueryui.com/',
275284
'jquery_docsearch_api_key' => '2fce35e56784bbb48c78d105739190c2',
276285
'jquery_docsearch_index_name' => 'jqueryui',
286+
'jquery_twitter_link' => 'https://twitter.com/jqueryui',
277287
),
278288
),
279289
'api.jqueryui.com/1.11' => array(
@@ -290,6 +300,7 @@ function jquery_sites() {
290300
'jquery_logo_link'=> 'https://jqueryui.com/',
291301
'jquery_docsearch_api_key' => '2fce35e56784bbb48c78d105739190c2',
292302
'jquery_docsearch_index_name' => 'jqueryui',
303+
'jquery_twitter_link' => 'https://twitter.com/jqueryui',
293304
),
294305
),
295306
'api.jquerymobile.com/1.4' => array(
@@ -306,6 +317,7 @@ function jquery_sites() {
306317
'jquery_logo_link'=> 'https://jquerymobile.com/',
307318
'jquery_docsearch_api_key' => '207328b0f1c18555c9021d05157dd651',
308319
'jquery_docsearch_index_name' => 'jquerymobile',
320+
'jquery_twitter_link' => 'https://twitter.com/jquerymobile',
309321
),
310322
),
311323
'releases.jquery.com' => array(
@@ -335,6 +347,7 @@ function jquery_sites() {
335347
'jquery_logo_link'=> 'https://jqueryui.com/',
336348
'jquery_docsearch_api_key' => '2fce35e56784bbb48c78d105739190c2',
337349
'jquery_docsearch_index_name' => 'jqueryui',
350+
'jquery_twitter_link' => 'https://twitter.com/jqueryui',
338351
),
339352
),
340353
);

themes/jquery/footer-bottom.php

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
<?php
2-
$project = preg_replace( '/^.*?([^.]+)\.[^.]+$/', '$1', JQUERY_LIVE_DOMAIN );
3-
42
$links = array(
53
'Learning Center' => array(
64
'icon' => 'pencil',
@@ -10,13 +8,9 @@
108
'icon' => 'group',
119
'url' => 'https://forum.jquery.com/',
1210
),
13-
'API' => array(
14-
'icon' => 'wrench',
15-
'url' => 'https://api.' . $project . '.com/'
16-
),
1711
'Twitter' => array(
1812
'icon' => 'twitter',
19-
'url' => 'https://twitter.com/jquery'
13+
'url' => get_option( 'jquery_twitter_link' ) ?: 'https://twitter.com/jquery'
2014
),
2115
'IRC' => array(
2216
'icon' => 'comments',
@@ -27,15 +21,6 @@
2721
'url' => 'https://github.com/jquery'
2822
)
2923
);
30-
31-
switch ( $project ) {
32-
case 'jqueryui':
33-
$links[ 'Twitter' ][ 'url' ] = 'https://twitter.com/jqueryui';
34-
break;
35-
case 'jquerymobile':
36-
$links[ 'Twitter' ][ 'url' ] = 'https://twitter.com/jquerymobile';
37-
break;
38-
}
3924
?>
4025

4126
<div id="legal">
@@ -50,4 +35,4 @@
5035
</div>
5136

5237
<?php
53-
unset( $project, $links );
38+
unset( $links );

0 commit comments

Comments
 (0)