PluginProbe
Friends / 2.8.1
Friends v2.8.1
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 / frontend / parts / header-menu.php

header-menu.php in Friends 2.8.1, at templates/frontend/parts/header-menu.php

54 lines 3.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * This template contains the content header menu part for an article on /friends/.
4 *
5 * @version 1.0
6 * @package Friends
7 */
8
9 $friend_user = $args['friend_user'];
10 if ( apply_filters( 'friends_debug', false ) ) : ?>
11 <?php
12 $edit_user_link = Friends\Admin::admin_edit_user_link( false, $friend_user );
13 if ( $edit_user_link ) :
14 ?>
15 <li class="menu-item"><a href="<?php echo esc_attr( $edit_user_link ); ?>"><?php esc_html_e( 'Edit friend', 'friends' ); ?></a></li>
16 <?php endif; ?>
17 <?php endif; ?>
18 <li class="menu-item">
19 <a href="<?php echo esc_attr( $friend_user->get_local_friends_page_url() . get_the_ID() . '/?share=' . hash( 'crc32b', apply_filters( 'friends_share_salt', wp_salt( 'nonce' ) ) . get_the_ID() ) ); ?>"><?php esc_html_e( 'Share link', 'friends' ); ?></a>
20 </li>
21 <?php if ( apply_filters( 'friends_debug', false ) ) : ?>
22 <li class="menu-item friends-dropdown">
23 <select name="post-format" class="friends-change-post-format form-select select-sm" data-change-post-format-nonce="<?php echo esc_attr( wp_create_nonce( 'friends-change-post-format_' . get_the_ID() ) ); ?>" data-id="<?php echo esc_attr( get_the_ID() ); ?>" >
24 <option disabled="disabled"><?php esc_html_e( 'Change post format', 'friends' ); ?></option>
25 <?php foreach ( get_post_format_strings() as $format => $title ) : ?>
26 <option value="<?php echo esc_attr( $format ); ?>"<?php selected( get_post_format(), $format ); ?>><?php echo esc_html( $title ); ?></option>
27 <?php endforeach; ?>
28 </select>
29 </li>
30 <?php endif; ?>
31 <?php if ( current_user_can( 'edit_post', get_current_user_id(), get_the_ID() ) ) : ?>
32 <li class="menu-item"><?php edit_post_link(); ?></li>
33 <?php endif; ?>
34 <?php if ( in_array( get_post_type(), apply_filters( 'friends_frontend_post_types', array() ), true ) ) : ?>
35 <?php if ( apply_filters( 'friends_show_author_edit', true, $args['friend_user'] ) ) : ?>
36 <li class="menu-item"><a href="<?php echo esc_url( self_admin_url( 'admin.php?page=edit-friend-rules&user=' . get_the_author_meta( 'ID' ) . '&post=' . get_the_ID() ) ); ?>" title="<?php esc_attr_e( 'Muffle posts like these', 'friends' ); ?>" class="friends-muffle-post">
37 <?php esc_html_e( 'Muffle posts like these', 'friends' ); ?>
38 </a></li>
39 <?php endif; ?>
40 <li class="menu-item">
41 <?php if ( 'trash' === get_post_status() ) : ?>
42 <a href="#" title="<?php /* phpcs:ignore WordPress.WP.I18n.MissingArgDomain */ esc_attr_e( 'Restore from Trash' ); ?>" data-trash-nonce="<?php echo esc_attr( wp_create_nonce( 'trash-post_' . get_the_ID() ) ); ?>" data-untrash-nonce="<?php echo esc_attr( wp_create_nonce( 'untrash-post_' . get_the_ID() ) ); ?>" data-id="<?php echo esc_attr( get_the_ID() ); ?>" class="friends-untrash-post">
43 <?php /* phpcs:ignore WordPress.WP.I18n.MissingArgDomain */ esc_html_e( 'Restore from Trash' ); ?>
44 </a>
45 <?php else : ?>
46 <a href="#" title="<?php /* phpcs:ignore WordPress.WP.I18n.MissingArgDomain */ esc_attr_e( 'Move to Trash' ); ?>" data-trash-nonce="<?php echo esc_attr( wp_create_nonce( 'trash-post_' . get_the_ID() ) ); ?>" data-untrash-nonce="<?php echo esc_attr( wp_create_nonce( 'untrash-post_' . get_the_ID() ) ); ?>" data-id="<?php echo esc_attr( get_the_ID() ); ?>" class="friends-trash-post">
47 <?php /* phpcs:ignore WordPress.WP.I18n.MissingArgDomain */ esc_html_e( 'Move to Trash' ); ?>
48 </a>
49 <?php endif; ?>
50 </li>
51 <?php endif; ?>
52 <?php
53 do_action( 'friends_entry_dropdown_menu' );
54