PluginProbe
Friends / 4.3.0
Friends v4.3.0
4.3.2 4.3.1 4.3.0 4.2.2 4.2.1 4.2.0 4.1.0 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.8 2.8.9 2.9.0 2.9.1 All 88 releases
friends / templates / twitter / frontend / header.php

header.php in Friends 4.3.0, at templates/twitter/frontend/header.php

135 lines 6.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Twitter theme: page header with 3-column layout.
4 *
5 * @package Friends
6 */
7
8 $_search = '';
9 if ( isset( $_GET['s'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
10 $_search = sanitize_text_field( wp_unslash( $_GET['s'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
11 }
12
13 add_filter(
14 'document_title_parts',
15 function ( $title ) use ( $args ) {
16 if ( isset( $args['title'] ) ) {
17 $title['title'] = $args['title'];
18 }
19 return $title;
20 }
21 );
22
23 $twitter_current_user = wp_get_current_user();
24
25 ?><!DOCTYPE html>
26 <html <?php language_attributes(); ?> class="no-js no-svg">
27 <head>
28 <meta charset="<?php bloginfo( 'charset' ); ?>">
29 <meta name="viewport" content="width=device-width, initial-scale=1">
30 <meta name="color-scheme" content="light dark">
31 <?php wp_head(); ?>
32 </head>
33
34 <body <?php body_class(); ?>>
35
36 <!-- Left column: navigation -->
37 <aside class="twitter-left-col">
38 <div class="twitter-logo">
39 <a href="<?php echo esc_url( home_url( '/friends/' ) ); ?>"><?php esc_html_e( 'Friends', 'friends' ); ?></a>
40 </div>
41 <nav class="twitter-left-nav">
42 <?php dynamic_sidebar( 'friends-sidebar' ); ?>
43 </nav>
44 <div class="twitter-left-customize">
45 <a href="<?php echo esc_url( add_query_arg( 'url', home_url( '/friends/' ), admin_url( 'customize.php?autofocus[section]=sidebar-widgets-friends-sidebar' ) ) ); ?>"><?php esc_html_e( 'customize sidebar', 'friends' ); ?></a>
46 </div>
47 <a class="twitter-user-card" href="<?php echo esc_url( home_url( '/friends/' ) ); ?>"><?php echo get_avatar( $twitter_current_user->ID, 40, '', '', array( 'class' => 'twitter-avatar' ) ); ?><div class="twitter-user-info">
48 <strong class="twitter-display-name"><?php echo esc_html( $twitter_current_user->display_name ); ?></strong>
49 <span class="twitter-handle">@<?php echo esc_html( $twitter_current_user->user_login ); ?></span>
50 </div></a>
51 </aside>
52
53 <!-- Center column: timeline -->
54 <div class="twitter-center-col">
55 <details class="twitter-mobile-panel">
56 <summary class="twitter-mobile-panel-toggle">
57 <?php echo get_avatar( $twitter_current_user->ID, 32, '', '', array( 'class' => 'twitter-avatar' ) ); ?>
58 <span><?php echo esc_html( $twitter_current_user->display_name ); ?></span>
59 <i class="dashicons dashicons-arrow-down-alt2"></i>
60 </summary>
61 <div class="twitter-mobile-panel-content">
62 <form class="twitter-search-form form-autocomplete" action="<?php echo esc_url( home_url( '/friends/' ) ); ?>">
63 <div class="form-autocomplete-input twitter-search-wrap">
64 <input class="twitter-search-input master-search" type="text" name="s" placeholder="<?php /* phpcs:ignore WordPress.WP.I18n.MissingArgDomain */ esc_attr_e( 'Search or paste URL' ); ?>" value="<?php echo esc_attr( $_search ); ?>" autocomplete="off" data-nonce="<?php echo esc_attr( wp_create_nonce( 'friends-autocomplete' ) ); ?>" />
65 <i class="form-icon"></i>
66 </div>
67 <ul class="menu" style="display: none"></ul>
68 </form>
69 </div>
70 </details>
71 <div class="twitter-col-header<?php echo is_single() ? ' is-single' : ''; ?>">
72 <div class="twitter-col-title-row">
73 <?php
74 if ( $args['friend_user'] && $args['friend_user'] instanceof Friends\User && is_singular() ) {
75 Friends\Friends::template_loader()->get_template_part(
76 'frontend/single-header',
77 $args['post_format'],
78 $args
79 );
80 } elseif ( $args['friend_user'] && $args['friend_user'] instanceof Friends\User ) {
81 echo '<h2 id="page-title"><a href="' . esc_url( $args['friend_user']->get_local_friends_page_url() ) . '">';
82 if ( $args['friend_user']->get_avatar_url() ) {
83 echo '<img src="' . esc_url( $args['friend_user']->get_avatar_url() ) . '" width="24" height="24" class="twitter-title-avatar" /> ';
84 }
85 echo esc_html( $args['friend_user']->display_name );
86 echo '</a></h2>';
87 } elseif ( isset( $args['title'] ) ) {
88 echo '<h2 id="page-title"><a href="' . esc_url( home_url( '/friends/' ) ) . '">' . esc_html( $args['title'] ) . '</a></h2>';
89 } else {
90 $_title = __( 'Home', 'friends' );
91 echo '<h2 id="page-title"><a href="' . esc_url( home_url( '/friends/' ) ) . '">' . esc_html( $_title ) . '</a></h2>';
92 }
93 ?>
94 <a class="off-canvas-toggle" href="#friends-sidebar" aria-label="<?php esc_attr_e( 'Open sidebar', 'friends' ); ?>"><i class="dashicons dashicons-menu"></i></a>
95 </div>
96 <?php if ( ! is_single() && empty( $args['no-bottom-margin'] ) ) : ?>
97 <div class="twitter-chips-area">
98 <?php
99 if ( $args['friend_user'] && $args['friend_user'] instanceof Friends\User ) {
100 Friends\Friends::template_loader()->get_template_part(
101 'frontend/author-header',
102 $args['post_format'],
103 $args
104 );
105 } else {
106 Friends\Friends::template_loader()->get_template_part(
107 'frontend/main-feed-header',
108 $args['post_format'],
109 $args
110 );
111 }
112 ?>
113 </div>
114 <?php endif; ?>
115 </div>
116
117 <!-- Compose in center column -->
118 <div class="twitter-compose-inline">
119 <div class="twitter-compose-avatar">
120 <?php echo get_avatar( $twitter_current_user->ID, 40, '', '', array( 'class' => 'twitter-avatar' ) ); ?>
121 </div>
122 <form method="post" action="<?php echo esc_url( admin_url( 'admin-ajax.php' ) ); ?>" class="twitter-compose-form friends-post-inline">
123 <?php wp_nonce_field( 'friends_publish' ); ?>
124 <input type="hidden" name="action" value="friends_publish" />
125 <input type="hidden" name="format" value="<?php echo esc_attr( get_option( 'friends_compose_post_format', 'status' ) ); ?>" />
126 <textarea name="content" rows="2" placeholder="<?php esc_attr_e( "What's happening?", 'friends' ); ?>"></textarea>
127 <div class="twitter-compose-footer">
128 <a href="<?php echo esc_url( admin_url( 'admin.php?page=friends-settings#compose' ) ); ?>" class="twitter-compose-settings" title="<?php esc_attr_e( 'Compose settings', 'friends' ); ?>"><span class="dashicons dashicons-admin-generic"></span></a>
129 <button type="submit" class="twitter-compose-submit"><?php esc_html_e( 'Post', 'friends' ); ?></button>
130 </div>
131 </form>
132 </div>
133
134 <?php do_action( 'friends_after_header', $args ); ?>
135