PluginProbe
Yatra – Travel Booking & Tour Operator Software / 2.2.10
Yatra – Travel Booking & Tour Operator Software v2.2.10
3.0.14 3.0.14.1 3.0.14.2 3.0.12 3.0.13 3.0.11 3.0.10 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.5.1 3.0.4 3.0.3 3.0.2.9 3.0.2.7 3.0.2.8 3.0.2.6 trunk 1.0.0 2.0.0 2.0.1 2.0.10 2.0.11 All 82 releases
yatra / core / Shortcodes / Login.php

Login.php in Yatra – Travel Booking & Tour Operator Software 2.2.10, at core/Shortcodes/Login.php

60 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Yatra\Core\Shortcodes;
4
5
6 defined('ABSPATH') || exit;
7
8 /**
9 * Shortcode Login class.
10 */
11 class Login
12 {
13
14 /**
15 * Get the shortcode content.
16 *
17 * @param array $atts Shortcode attributes.
18 * @return string
19 */
20 public static function get($atts)
21 {
22 return \Yatra_Shortcodes::shortcode_wrapper(array(__CLASS__, 'output'), $atts);
23 }
24
25 /**
26 * Output the shortcode.
27 *
28 * @param array $atts Shortcode attributes.
29 */
30 public static function output($atts)
31 {
32 $redirect = isset($atts['redirect']) ? sanitize_text_field($atts['redirect']) : '';
33
34 echo '<div class="yatra-row">';
35
36 echo '<div class="yatra-col-md-12 yatra-col-xs-12 yatra-login-wrap">';
37
38 if (is_user_logged_in()) {
39
40 $account_page_url = yatra_get_my_account_page(true);
41
42 printf(esc_html("%sYou're currently logged in. You can access the My Account page from %shere%s.%s"), '<h2>', '<a href="' . esc_url($account_page_url) . '">', '</a>', '</h2>');
43
44 } else {
45
46 yatra_get_template('myaccount/tmpl-form-login.php', array(
47 'redirect' => $redirect,
48 'title' => __('Login', 'yatra')
49 ));
50
51 }
52 echo '</div>';
53
54 echo '</div>';
55
56
57 }
58
59 }
60