Changeset 3285
- Timestamp:
- 06/01/2016 02:55:27 PM (9 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/inc/class-plugin.php
r3014 r3285 41 41 add_filter( 'pre_handle_404', array( $this, 'short_circuit_handle_404' ) ); 42 42 add_action( 'wp_default_scripts', array( $this, 'bump_script_versions' ) ); 43 add_action( 'after_setup_theme', array( $this, 'after_setup_theme' ) ); 44 add_filter( 'body_class', array( $this, 'wporg_add_make_site_body_class' ) ); 43 45 44 46 // Load the API endpoints. … … 51 53 52 54 /** 55 * Registers a menu location for a sub-navigation. 56 */ 57 public function after_setup_theme() { 58 register_nav_menu( 'wporg_header_subsite_nav', 'WordPress.org Header Sub-Navigation' ); 59 } 60 61 /** 62 * Adds the CSS classes from make/polyglots to the body to sync the headline icon. 63 */ 64 function wporg_add_make_site_body_class( $classes ) { 65 $classes[] = 'wporg-make'; 66 $classes[] = 'make-polyglots'; 67 return $classes; 68 } 69 70 /** 53 71 * Registers CLI commands if WP-CLI is loaded. 54 72 */ 55 function register_cli_commands() {73 public function register_cli_commands() { 56 74 WP_CLI::add_command( 'wporg-translate init-locale', __NAMESPACE__ . '\CLI\Init_Locale' ); 57 75 } -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/header.php
r2948 r3285 4 4 require WPORGPATH . 'header.php'; 5 5 ?> 6 <script type="text/javascript">document.body.className = document.body.className.replace('no-js','js');</script> 6 <script type="text/javascript">document.body.className = document.body.className.replace('no-js','js');</script> 7 7 8 <div id="headline"> 8 9 <div class="wrapper"> 9 <h2><a href="//make.wordpress.org/polyglots/">Translating WordPress</a></h2> 10 <span id="hello"> 11 <a class="menu-link" href="//make.wordpress.org/polyglots/">Blog</a> 12 <a class="menu-link" href="//make.wordpress.org/polyglots/teams/">Teams</a> 13 <a class="menu-link" href="//make.wordpress.org/polyglots/handbook/">Translator Handbook</a> 10 <h2><a href="<?php echo home_url( '/' ); ?>"><?php bloginfo( 'name' ); ?></a></h2> 14 11 <?php 15 if ( is_user_logged_in() ): 16 $user = wp_get_current_user(); 17 18 printf( __('Hi, %s.'), '<a href="'.gp_url( '/settings' ).'">'.$user->user_login.'</a>' ); 12 wp_nav_menu( array( 13 'theme_location' => 'wporg_header_subsite_nav', 14 'fallback_cb' => '__return_false' 15 ) ); 16 ?> 17 </div> 18 <div class="wrapper"> 19 <ul class="translate-meta-nav"> 20 <?php 21 if ( is_user_logged_in() ) { 22 $user = wp_get_current_user(); 23 printf( 24 '<li>logged in as %s</li>', 25 '<a href="' . esc_url( gp_url_profile( $user->user_login ) ) . '">@' . esc_html( $user->user_nicename ) . '</a>' 26 ); 27 ?> 28 <li><a href="<?php echo esc_url( gp_url( '/settings' ) ); ?>">Settings</a></li> 29 <li><a href="<?php echo esc_url( wp_logout_url( home_url( '/' ) ) ); ?>">Log out</a></li> 30 <?php 31 } else { 32 ?> 33 <li><a href="<?php echo esc_url( wp_login_url() ); ?>"><strong>Log in</strong></a></li> 34 <?php 35 } 19 36 ?> 20 <a href="<?php echo esc_url( wp_logout_url( home_url( '/' ) ) ); ?>"><?php _e( 'Log out' ); ?></a> 21 <?php else: ?> 22 <strong><a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a></strong> 23 <?php endif; ?> 24 <?php do_action( 'after_hello' ); ?> 25 </span> 37 </ul> 26 38 </div> 27 39 </div> 40 28 41 <div class="gp-content"> 29 42 -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/style.css
r3003 r3285 1 html, body { 1 /* Secondary header design */ 2 #headline .menu { 3 list-style: none; 4 float: right; 5 font-size: 14px; 6 font-weight: bold; 7 padding-top: 22px; 8 margin-right: 15px; 9 } 10 11 #headline .menu li { 12 display: inline; 13 padding-left: 20px; 14 } 15 16 /* Responsive design for secondary header */ 17 @media (max-width: 480px) { 18 #headline h2 { 19 margin-left: 6px; 20 font-size: 20px; 21 } 22 23 #headline h2 a:before { 24 font-size: 20px; 25 width: 24px; 26 } 27 } 28 29 @media (max-width: 770px) { 30 #headline { 31 height: auto; 32 } 33 34 #headline h2 { 35 float: none; 36 } 37 38 #headline .menu { 39 float: left; 40 margin: 0; 41 padding: 8px 0; 42 background: #f5f5f5; 43 border-top: 1px solid #d7d7d7; 44 width: 100%; 45 } 46 } 47 48 .wrapper { 49 position: relative; 50 } 51 52 ul.translate-meta-nav { 53 list-style: none; 2 54 margin: 0; 55 padding: 0; 56 font-size: 12px; 57 text-align: right; 58 } 59 60 #headline ul.translate-meta-nav a { 61 color: #0073aa; 62 } 63 64 #headline ul a:hover, 65 #headline ul a:focus { 66 color: #00a0d2; 67 } 68 69 @media (min-width: 771px) { 70 ul.translate-meta-nav { 71 position: absolute; 72 bottom: -18px; 73 right: 6px; 74 } 75 } 76 77 ul.translate-meta-nav li { 78 display: inline-block; 79 margin: 0 8px 3 80 } 4 81 … … 36 113 .actionlist a:visited, 37 114 .gp-content a { 38 color: #007 4a2;115 color: #0073aa; 39 116 } 40 117 41 118 .gp-content a:hover { 42 color: # 2ea2cc;119 color: #00a0d2; 43 120 text-decoration: none; 44 121 } … … 185 262 186 263 .gp-content .meta a { 187 color: #007 4a2;264 color: #0073aa; 188 265 border-bottom: 0; 189 266 } 190 267 191 268 .gp-content .meta a:hover { 192 color: # 2ea2cc;269 color: #00a0d2; 193 270 border-bottom: 0; 194 271 } … … 1295 1372 cursor: pointer; 1296 1373 font: inherit; 1297 color: #007 4a2;1374 color: #0073aa; 1298 1375 } 1299 1376 1300 1377 .button-link:hover { 1301 color: # 2ea2cc;1378 color: #00a0d2; 1302 1379 } 1303 1380
Note: See TracChangeset
for help on using the changeset viewer.