function profile_get() { if (!is_user_logged_in()) { $this->redirect(wp_login_url(gp_url_profile())); return; } $this->tmpl('profile'); }
/** * Displays the settings page, requires a user to be logged in. */ public function settings_get() { if (!is_user_logged_in()) { $this->redirect(wp_login_url(gp_url_profile())); exit; } $this->tmpl('settings'); }
?> <h4 id="validators"><?php _e('Validators for parent projects'); ?> </h4> <ul class="permissions"> <?php foreach ($parent_permissions as $permission) { ?> <li> <span class="permission-action"><?php _e('user'); ?> </span> <span class="user"><?php printf('<a href="%s">%s</a>', gp_url_profile($permission->user->user_nicename), esc_html($permission->user->user_login)); ?> </span> <span class="permission-action"><?php printf(__('can %s strings with locale'), esc_html($permission->action)); ?> </span> <span class="user"><?php echo esc_html($permission->locale_slug); ?> </span> <span class="permission-action"><?php _e('and slug'); ?> </span> <span class="user"><?php
<?php } ?> <?php if ($t->user_login) { ?> <dl> <dt><?php _e('Translated by:', 'glotpress'); ?> </dt> <dd><?php if ($t->user_display_name && $t->user_display_name != $t->user_login) { printf('<a href="%s" tabindex="-1">%s (%s)</a>', gp_url_profile($t->user_nicename), $t->user_display_name, $t->user_login); } else { printf('<a href="%s" tabindex="-1">%s</a>', gp_url_profile($t->user_nicename), $t->user_login); } ?> </dd> </dl> <?php } ?> <?php references($project, $t); ?> <dl> <dt><?php _e('Priority of the original:', 'glotpress');
/** * Outputs a HTML link to a user profile page. * * @since 2.1.0 * * @param WP_User $user A WP_User user object. */ function gp_link_user($user) { if ($user->display_name && $user->display_name !== $user->user_login) { printf('<a href="%s" tabindex="-1">%s (%s)</a>', esc_url(gp_url_profile($user->user_nicename)), esc_html($user->display_name), esc_html($user->user_login)); } else { printf('<a href="%s" tabindex="-1">%s</a>', esc_url(gp_url_profile($user->user_nicename)), esc_attr($user->user_login)); } }
<h4 id="validators"><?php _e('Validators for parent projects'); ?> </h4> <ul class="permissions"> <?php foreach ($parent_permissions as $permission) { ?> <li> <span class="permission-action"><?php _e('user'); ?> </span> <?php if (GP_Bootstrap_Theme::has_feature('profile')) { echo '<span class="user">' . sprintf('<a href="%s">%s</a>', gp_url_profile($permission->user->user_nicename), esc_html($permission->user->user_login)) . '</span>'; } else { echo '<span class="user">' . esc_html($permission->user->user_login) . '</span>'; } ?> <span class="permission-action"><?php printf(__('can %s strings with locale'), esc_html($permission->action)); ?> </span> <span class="user"><?php echo esc_html($permission->locale_slug); ?> </span> <span class="permission-action"><?php _e('and slug');
function gp_nav_menu_items($location = 'main') { $items = array(); if ('main' === $location) { $items[gp_url('/projects')] = __('Projects', 'glotpress'); $items[gp_url('/languages')] = __('Locales', 'glotpress'); } elseif ('side' === $location) { if (is_user_logged_in()) { $user = wp_get_current_user(); $items[gp_url_profile($user->user_nicename)] = __('Profile', 'glotpress'); $items[gp_url('/settings')] = __('Settings', 'glotpress'); $items[esc_url(wp_logout_url(gp_url_current()))] = __('Log out', 'glotpress'); } else { $items[esc_url(wp_login_url(gp_url_current()))] = __('Log in', 'glotpress'); } } /** * Filter the list of navigation menu items. * * @since 1.0.0 * * @param array $items Menu items. URL as the key, menu label as the value. * @param string $location Location of the menu. */ return apply_filters('gp_nav_menu_items', $items, $location); }