PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.6.7
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.6.7
1.8.12.3 1.8.12.2 1.8.12.1 1.8.12 1.8.11.3 1.8.11.2 1.8.11.1 1.8.11 1.6.6 1.6.60 1.6.7 1.6.8 1.6.9 1.7.0 1.7.0.1 1.7.0.11 1.7.0.12 1.7.0.14 1.7.0.2 1.7.0.3 1.7.0.5 1.7.0.6 1.7.0.7 1.7.0.9 1.8.0 All 210 releases
charitable / includes / shortcodes / class-charitable-logout-shortcode.php

class-charitable-logout-shortcode.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.6.7, at includes/shortcodes/class-charitable-logout-shortcode.php

61 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 * Logout shortcode class.
4 *
5 * @package Charitable/Shortcodes/Logout
6 * @author Eric Daams
7 * @copyright Copyright (c) 2018, Studio 164a
8 * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9 * @since 1.5.0
10 * @version 1.5.7
11 */
12
13 // Exit if accessed directly.
14 if ( ! defined( 'ABSPATH' ) ) { exit; }
15
16 if ( ! class_exists( 'Charitable_Logout_Shortcode' ) ) :
17
18 /**
19 * Charitable_Logout_Shortcode class.
20 *
21 * @since 1.5.0
22 */
23 class Charitable_Logout_Shortcode {
24
25 /**
26 * The callback method for the logout shortcode.
27 *
28 * This receives the user-defined attributes and passes the logic off to the class.
29 *
30 * @since 1.5.0
31 *
32 * @param array $atts User-defined shortcode attributes.
33 * @return string
34 */
35 public static function display( $atts = array() ) {
36 if ( ! is_user_logged_in() ) {
37 return;
38 }
39
40 $defaults = array(
41 'redirect' => charitable_get_current_url(),
42 'text' => __( 'Logout', 'charitable' ),
43 );
44
45 $args = shortcode_atts( $defaults, $atts, 'charitable_logout' );
46
47 charitable_template( 'shortcodes/logout.php', $args );
48
49 /**
50 * Filter the output of the login shortcode.
51 *
52 * @since 1.5.0
53 *
54 * @param string $content Shortcode output.
55 */
56 return apply_filters( 'charitable_logout_shortcode', ob_get_clean() );
57 }
58 }
59
60 endif;
61