Skip to content

Commit

Permalink
All: move twitter override to site options
Browse files Browse the repository at this point in the history
remove use of the non-standard `JQUERY_LIVE_DOMAIN` constant and turn
this into a site option instead.
  • Loading branch information
Krinkle committed Sep 9, 2023
1 parent 94211f0 commit 7a195ce
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
17 changes: 15 additions & 2 deletions sites.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ function jquery_sites() {
'jquery_body_class' => 'jquery-ui',
'jquery_docsearch_api_key' => '2fce35e56784bbb48c78d105739190c2',
'jquery_docsearch_index_name' => 'jqueryui',
'jquery_twitter_link' => 'https://twitter.com/jqueryui',
),
),
'blog.jqueryui.com' => array(
Expand All @@ -93,10 +94,11 @@ function jquery_sites() {
'blogname' => 'jQuery UI Blog',
'stylesheet' => 'blog.jqueryui.com',
'jquery_body_class' => 'jquery-ui',
'jquery_twitter_link' => 'https://twitter.com/jqueryui',
),
),
'api.jqueryui.com' => array(
'subsites' => 1, // Has one level of sub-sites (api.jqueryui.com/([^/]+))
'subsites' => true, // Has one level of sub-sites (api.jqueryui.com/([^/]+))
'blog_id' => 8,
'cookie_domain' => '.jqueryui.com',
'options' => array(
Expand All @@ -109,6 +111,7 @@ function jquery_sites() {
'jquery_logo_link'=> 'https://jqueryui.com/',
'jquery_docsearch_api_key' => '2fce35e56784bbb48c78d105739190c2',
'jquery_docsearch_index_name' => 'jqueryui',
'jquery_twitter_link' => 'https://twitter.com/jqueryui',
),
),
'api.jqueryui.com/1.8' => array(
Expand All @@ -125,6 +128,7 @@ function jquery_sites() {
'jquery_logo_link'=> 'https://jqueryui.com/',
'jquery_docsearch_api_key' => '2fce35e56784bbb48c78d105739190c2',
'jquery_docsearch_index_name' => 'jqueryui',
'jquery_twitter_link' => 'https://twitter.com/jqueryui',
),
),
'api.jqueryui.com/1.9' => array(
Expand All @@ -141,6 +145,7 @@ function jquery_sites() {
'jquery_logo_link'=> 'https://jqueryui.com/',
'jquery_docsearch_api_key' => '2fce35e56784bbb48c78d105739190c2',
'jquery_docsearch_index_name' => 'jqueryui',
'jquery_twitter_link' => 'https://twitter.com/jqueryui',
),
),
'jquery.org' => array(
Expand Down Expand Up @@ -169,10 +174,11 @@ function jquery_sites() {
'jquery_body_class' => 'jquery-mobile',
'jquery_docsearch_api_key' => '207328b0f1c18555c9021d05157dd651',
'jquery_docsearch_index_name' => 'jquerymobile',
'jquery_twitter_link' => 'https://twitter.com/jquerymobile',
),
),
'api.jquerymobile.com' => array(
'subsites' => 1, // Has one level of sub-sites (api.jquerymobile.com/([^/]+))
'subsites' => true, // Has one level of sub-sites (api.jquerymobile.com/([^/]+))
'blog_id' => 13,
'cookie_domain' => '.jquerymobile.com',
'options' => array(
Expand All @@ -185,6 +191,7 @@ function jquery_sites() {
'jquery_logo_link'=> 'https://jquerymobile.com/',
'jquery_docsearch_api_key' => '207328b0f1c18555c9021d05157dd651',
'jquery_docsearch_index_name' => 'jquerymobile',
'jquery_twitter_link' => 'https://twitter.com/jquerymobile',
),
),
# Historical: Database blog_id 14 is reserved for api.qunitjs.com.
Expand Down Expand Up @@ -242,6 +249,7 @@ function jquery_sites() {
'jquery_logo_link'=> 'https://jquerymobile.com/',
'jquery_docsearch_api_key' => '207328b0f1c18555c9021d05157dd651',
'jquery_docsearch_index_name' => 'jquerymobile',
'jquery_twitter_link' => 'https://twitter.com/jquerymobile',
),
),
'api.jqueryui.com/1.10' => array(
Expand All @@ -258,6 +266,7 @@ function jquery_sites() {
'jquery_logo_link'=> 'https://jqueryui.com/',
'jquery_docsearch_api_key' => '2fce35e56784bbb48c78d105739190c2',
'jquery_docsearch_index_name' => 'jqueryui',
'jquery_twitter_link' => 'https://twitter.com/jqueryui',
),
),
'api.jqueryui.com/1.12' => array(
Expand All @@ -274,6 +283,7 @@ function jquery_sites() {
'jquery_logo_link'=> 'https://jqueryui.com/',
'jquery_docsearch_api_key' => '2fce35e56784bbb48c78d105739190c2',
'jquery_docsearch_index_name' => 'jqueryui',
'jquery_twitter_link' => 'https://twitter.com/jqueryui',
),
),
'api.jqueryui.com/1.11' => array(
Expand All @@ -290,6 +300,7 @@ function jquery_sites() {
'jquery_logo_link'=> 'https://jqueryui.com/',
'jquery_docsearch_api_key' => '2fce35e56784bbb48c78d105739190c2',
'jquery_docsearch_index_name' => 'jqueryui',
'jquery_twitter_link' => 'https://twitter.com/jqueryui',
),
),
'api.jquerymobile.com/1.4' => array(
Expand All @@ -306,6 +317,7 @@ function jquery_sites() {
'jquery_logo_link'=> 'https://jquerymobile.com/',
'jquery_docsearch_api_key' => '207328b0f1c18555c9021d05157dd651',
'jquery_docsearch_index_name' => 'jquerymobile',
'jquery_twitter_link' => 'https://twitter.com/jquerymobile',
),
),
'releases.jquery.com' => array(
Expand Down Expand Up @@ -335,6 +347,7 @@ function jquery_sites() {
'jquery_logo_link'=> 'https://jqueryui.com/',
'jquery_docsearch_api_key' => '2fce35e56784bbb48c78d105739190c2',
'jquery_docsearch_index_name' => 'jqueryui',
'jquery_twitter_link' => 'https://twitter.com/jqueryui',
),
),
);
Expand Down
19 changes: 2 additions & 17 deletions themes/jquery/footer-bottom.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<?php
$project = preg_replace( '/^.*?([^.]+)\.[^.]+$/', '$1', JQUERY_LIVE_DOMAIN );

$links = array(
'Learning Center' => array(
'icon' => 'pencil',
Expand All @@ -10,13 +8,9 @@
'icon' => 'group',
'url' => 'https://forum.jquery.com/',
),
'API' => array(
'icon' => 'wrench',
'url' => 'https://api.' . $project . '.com/'
),
'Twitter' => array(
'icon' => 'twitter',
'url' => 'https://twitter.com/jquery'
'url' => get_option( 'jquery_twitter_link' ) ?: 'https://twitter.com/jquery'
),
'IRC' => array(
'icon' => 'comments',
Expand All @@ -27,15 +21,6 @@
'url' => 'https://github.com/jquery'
)
);

switch ( $project ) {
case 'jqueryui':
$links[ 'Twitter' ][ 'url' ] = 'https://twitter.com/jqueryui';
break;
case 'jquerymobile':
$links[ 'Twitter' ][ 'url' ] = 'https://twitter.com/jquerymobile';
break;
}
?>

<div id="legal">
Expand All @@ -50,4 +35,4 @@
</div>

<?php
unset( $project, $links );
unset( $links );

0 comments on commit 7a195ce

Please sign in to comment.