Diff: STRATO-apps/wordpress_03/app/wp-content/plugins/paid-memberships-pro/shortcodes/pmpro_account.php
Keine Baseline-Datei – Diff nur gegen leer.
1
-
1
+
<?php
2
+
/*
3
+
Shortcode to show membership account information
4
+
*/
5
+
function pmpro_shortcode_account($atts, $content=null, $code="")
6
+
{
7
+
global $wpdb, $current_user;
8
+
9
+
// $atts ::= array of attributes
10
+
// $content ::= text within enclosing form of shortcode element
11
+
// $code ::= the shortcode found, when == callback name
12
+
// examples: [pmpro_account] [pmpro_account sections="membership,profile"/]
13
+
14
+
extract(shortcode_atts(array(
15
+
'section' => '',
16
+
'sections' => 'membership,profile,invoices,links',
17
+
'title' => null,
18
+
), $atts));
19
+
20
+
// Did they use 'section' instead of 'sections'?
21
+
if ( ! empty( $section ) ) {
22
+
$sections = $section;
23
+
}
24
+
25
+
// Extract the user-defined sections for the shortcode.
26
+
$sections = array_map( 'trim', explode( ',', $sections ) );
27
+
28
+
// Start the output buffer to capture the content of the shortcode.
29
+
ob_start();
30
+
31
+
// If multiple sections are being shown, set title to null.
32
+
// Titles can only be changed from the default if only one section is being shown.
33
+
if ( count( $sections ) > 1 ) {
34
+
$title = null;
35
+
}
36
+
37
+
// We want to show the actual levels for admins.
38
+
add_filter( 'pmpro_disable_admin_membership_access', '__return_true', 15 );
39
+
40
+
// Get the current user's membership levels.
41
+
$mylevels = pmpro_getMembershipLevelsForUser();
42
+
43
+
// Sort the levels by the levels order.
44
+
if ( ! empty( $mylevels ) ) {
45
+
$mylevels = pmpro_sort_levels_by_order( $mylevels );
46
+
}
47
+
48
+
// Remove the filter so we don't mess up other stuff.
49
+
remove_filter( 'pmpro_disable_admin_membership_access', '__return_true', 15 );
50
+
51
+
// Just to be sure, only inclue the levels that allow signups.
52
+
$pmpro_levels = pmpro_getAllLevels();
53
+
?>
54
+
<div class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro' ) ); ?>">
55
+
<?php if ( in_array( 'profile', $sections ) ) {
56
+
?>
57
+
<section id="pmpro_account-profile" class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_section', 'pmpro_account-profile' ) ); ?>">
58
+
<?php
59
+
if ( '' !== $title ) { // Check if title is being forced to not show.
60
+
// If a custom title was not set, use the default. Otherwise, show the custom title.
61
+
?>
62
+
<h2 class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_section_title pmpro_font-x-large' ) ); ?>"><?php echo esc_html( null === $title ? __( 'My Account', 'paid-memberships-pro' ) : $title ); ?></h2>
63
+
<?php
64
+
}
65
+
?>
66
+
<div class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_card' ) ); ?>">
67
+
<?php
68
+
// Get the current user.
69
+
wp_get_current_user();
70
+
?>
71
+
<h3 class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_card_title pmpro_font-large pmpro_heading-with-avatar' ) ); ?>">
72
+
<?php echo get_avatar( $current_user->ID, 48 ); ?>
73
+
<?php
74
+
/* translators: the current user's display name */
75
+
printf( esc_html__( 'Welcome, %s', 'paid-memberships-pro' ), esc_html( $current_user->display_name ) );
76
+
?>
77
+
</h3>
78
+
<div class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_card_content' ) ); ?>">
79
+
<ul class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_list pmpro_list-plain' ) ); ?>">
80
+
<?php do_action('pmpro_account_bullets_top');?>
81
+
<li class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_list_item' ) ); ?>"><strong><?php esc_html_e( 'Username', 'paid-memberships-pro' ); ?>:</strong> <?php echo esc_html( $current_user->user_login ); ?></li>
82
+
<li class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_list_item' ) ); ?>"><strong><?php esc_html_e( 'Email', 'paid-memberships-pro' );?>:</strong> <?php echo esc_html( $current_user->user_email ); ?></li>
83
+
<?php do_action('pmpro_account_bullets_bottom');?>
84
+
</ul>
85
+
</div> <!-- end pmpro_card_content -->
86
+
<div class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_card_actions' ) ); ?>">
87
+
<?php
88
+
// Get the edit profile and change password links if 'Member Profile Edit Page' is set.
89
+
if ( ! empty( get_option( 'pmpro_member_profile_edit_page_id' ) ) ) {
90
+
$edit_profile_url = pmpro_url( 'member_profile_edit' );
91
+
$change_password_url = add_query_arg( 'view', 'change-password', pmpro_url( 'member_profile_edit' ) );
92
+
} elseif ( ! pmpro_block_dashboard() ) {
93
+
$edit_profile_url = admin_url( 'profile.php' );
94
+
$change_password_url = admin_url( 'profile.php' );
95
+
}
96
+
97
+
// Build the links to return.
98
+
$pmpro_profile_action_links = array();
99
+
if ( ! empty( $edit_profile_url) ) {
100
+
$pmpro_profile_action_links['edit-profile'] = sprintf( '<a id="pmpro_actionlink-profile" href="%s">%s</a>', esc_url( $edit_profile_url ), esc_html__( 'Edit Profile', 'paid-memberships-pro' ) );
101
+
}
102
+
103
+
if ( ! empty( $change_password_url ) ) {
104
+
$pmpro_profile_action_links['change-password'] = sprintf( '<a id="pmpro_actionlink-change-password" href="%s">%s</a>', esc_url( $change_password_url ), esc_html__( 'Change Password', 'paid-memberships-pro' ) );
105
+
}
106
+
107
+
$pmpro_profile_action_links['logout'] = sprintf( '<a id="pmpro_actionlink-logout" href="%s">%s</a>', esc_url( wp_logout_url() ), esc_html__( 'Log Out', 'paid-memberships-pro' ) );
108
+
109
+
// Wrap each action link item in a <span>
110
+
$pmpro_profile_action_links = array_map( function( $link ) {
111
+
return '<span class="' . esc_attr( pmpro_get_element_class( 'pmpro_card_action' ) ) . '">' . $link . '</span>';
112
+
}, $pmpro_profile_action_links );
113
+
114
+
115
+
/**
116
+
* Filter the profile action links.
117
+
*
118
+
* @param array $pmpro_profile_action_links Profile action links.
119
+
* @return array $pmpro_profile_action_links Profile action links.
120
+
*/
121
+
$pmpro_profile_action_links = apply_filters( 'pmpro_account_profile_action_links', $pmpro_profile_action_links );
122
+
123
+
$allowed_html = array(
124
+
'a' => array (
125
+
'class' => array(),
126
+
'href' => array(),
127
+
'id' => array(),
128
+
'target' => array(),
129
+
'title' => array(),
130
+
),
131
+
'span' => array(
132
+
'class' => array(),
133
+
),
134
+
);
135
+
echo wp_kses( implode( '<span class="' . esc_attr( pmpro_get_element_class( 'pmpro_card_action_separator' ) ) . '">' . pmpro_actions_nav_separator() . '</span>', $pmpro_profile_action_links ), $allowed_html );
136
+
?>
137
+
</div> <!-- end pmpro_card_actions -->
138
+
</div> <!-- end pmpro_card -->
139
+
</section> <!-- end pmpro_account-profile -->
140
+
<?php } ?>
141
+
142
+
<?php if ( in_array( 'membership', $sections) || in_array( 'memberships', $sections ) ) {
143
+
?>
144
+
<section id="pmpro_account-membership" class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_section', 'pmpro_account-membership' ) ); ?>">
145
+
<?php
146
+
if ( '' !== $title ) { // Check if title is being forced to not show.
147
+
// If a custom title was not set, use the default. Otherwise, show the custom title.
148
+
?>
149
+
<h2 class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_section_title pmpro_font-x-large' ) ); ?>"><?php echo esc_html( null === $title ? __( 'My Memberships', 'paid-memberships-pro' ) : $title ); ?></h2>
150
+
<?php
151
+
}
152
+
?>
153
+
<div class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_section_content' ) ); ?>">
154
+
<?php if ( empty( $mylevels ) ) {
155
+
156
+
?>
157
+
<div id="pmpro_account-membership-none" class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_card' ) ); ?>">
158
+
<div class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_card_content' ) ); ?>">
159
+
<p>
160
+
<?php
161
+
esc_html_e( 'You do not have an active membership.', 'paid-memberships-pro' );
162
+
$levels_url = pmpro_url( 'levels' );
163
+
if ( ! empty( $levels_url ) ) {
164
+
echo ' ';
165
+
?>
166
+
<a href="<?php echo esc_url( $levels_url ); ?>"><?php esc_html_e( 'Choose a membership level.', 'paid-memberships-pro' ); ?></a>
167
+
<?php
168
+
}
169
+
?>
170
+
</p>
171
+
</div> <!-- end pmpro_card_content -->
172
+
</div> <!-- end pmpro_card -->
173
+
<?php
174
+
} else {
175
+
foreach ( $mylevels as $level ) {
176
+
?>
177
+
<div id="pmpro_account-membership-<?php echo esc_attr( $level->ID ); ?>" class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_card' ) ); ?>">
178
+
179
+
<h3 class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_card_title pmpro_font-large' ) ); ?>"><?php echo esc_html( $level->name ); ?></h3>
180
+
181
+
<div class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_card_content' ) ); ?>">
182
+
183
+
<ul class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_list pmpro_list-plain pmpro_list-with-labels pmpro_cols-3' ) ); ?>">
184
+
185
+
<?php
186
+
// Show information about the first active subscription for this level.
187
+
$subscription = null;
188
+
$subscriptions = PMPro_Subscription::get_subscriptions_for_user( $current_user->ID, $level->id );
189
+
if ( ! empty( $subscriptions ) ) {
190
+
$subscription = $subscriptions[0];
191
+
?>
192
+
<li class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_list_item' ) ); ?>">
193
+
<span class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_list_item_label' ) ); ?>"><?php esc_html_e( 'Subscription', 'paid-memberships-pro' ); ?></span>
194
+
<span class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_list_item_value' ) ); ?>"><?php echo esc_html( $subscription->get_cost_text() ); ?></span>
195
+
</li>
196
+
<li class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_list_item' ) ); ?>">
197
+
<span class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_list_item_label' ) ); ?>"><?php esc_html_e( 'Next payment on', 'paid-memberships-pro' ); ?></span>
198
+
<span class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_list_item_value' ) ); ?>"><?php echo esc_html( $subscription->get_next_payment_date( get_option( 'date_format' ) ) ); ?></span>
199
+
</li>
200
+
<?php
201
+
}
202
+
203
+
$expiration_text = pmpro_get_membership_expiration_text( $level, $current_user, '' );
204
+
if ( ! empty( $expiration_text ) ) {
205
+
?>
206
+
<li class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_list_item' ) ); ?>">
207
+
<span class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_list_item_label' ) ); ?>"><?php esc_html_e( 'Expires', 'paid-memberships-pro' ); ?></span>
208
+
<span class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_list_item_value' ) ); ?>"><?php echo wp_kses_post( $expiration_text ); ?></span>
209
+
</li>
210
+
<?php
211
+
}
212
+
?>
213
+
</ul> <!-- end pmpro_list -->
214
+
<?php
215
+
/**
216
+
* Hook to add content after the default level card content.
217
+
*
218
+
* @since 3.4
219
+
* @param object $level The current level object.
220
+
*/
221
+
do_action( 'pmpro_membership_account_after_level_card_content', $level );
222
+
?>
223
+
</div> <!-- end pmpro_card_content -->
224
+
225
+
<div class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_card_actions' ) ); ?>">
226
+
227
+
<?php
228
+
/**
229
+
* Fires before the member action links.
230
+
*/
231
+
do_action( 'pmpro_member_action_links_before' );
232
+
?>
233
+
234
+
<?php
235
+
// Build the links to return.
236
+
$pmpro_member_action_links = array();
237
+
238
+
$renew_url = pmpro_url( 'checkout', 'level=' . $level->id, 'https' );
239
+
if ( array_key_exists($level->id, $pmpro_levels) && pmpro_isLevelExpiringSoon( $level ) && ! empty( $renew_url ) ) {
240
+
$pmpro_member_action_links['renew'] = '<a id="pmpro_actionlink-renew" href="' . esc_url( $renew_url ) . '" aria-label="' . esc_attr( sprintf( esc_html__( 'Renew %1$s Membership', 'paid-memberships-pro' ), $level->name ) ) . '">' . esc_html__( 'Renew', 'paid-memberships-pro' ) . '</a>';
241
+
242
+
}
243
+
244
+
// Check if we should show the update billing link.
245
+
if ( ! empty( $subscription ) ) {
246
+
// Check if this subscription is for the default gateaway (we can currently only update billing info for the default gateway).
247
+
if ( $subscription->get_gateway() == get_option( 'pmpro_gateway' ) ) {
248
+
// Check if the gateway supports updating billing info.
249
+
$gateway_obj = $subscription->get_gateway_object();
250
+
if ( ! empty( $gateway_obj ) && method_exists( $gateway_obj, 'supports' ) && $gateway_obj->supports( 'payment_method_updates' ) ) {
251
+
// Make sure that the subscription has an order, which is necessary to update.
252
+
$newest_orders = $subscription->get_orders( array( 'limit' => 1 ) );
253
+
$update_billing_url = pmpro_url( 'billing', 'pmpro_subscription_id=' . $subscription->get_id(), 'https' );
254
+
if ( ! empty( $newest_orders ) && ! empty( $update_billing_url ) ) {
255
+
$pmpro_member_action_links['update-billing'] = sprintf( '<a id="pmpro_actionlink-update-billing" href="%s">%s</a>', $update_billing_url, esc_html__( 'Update Billing Info', 'paid-memberships-pro' ) );
256
+
}
257
+
}
258
+
}
259
+
}
260
+
261
+
// Check if we should show the change membership level link.
262
+
$show_change_link = false;
263
+
264
+
// Get the group for this level.
265
+
$level_group_id = pmpro_get_group_id_for_level( $level->ID );
266
+
$level_group = pmpro_get_level_group( $level_group_id );
267
+
268
+
// Show the link if there is more than one level available.
269
+
if ( count( $pmpro_levels ) > 1 ) {
270
+
$show_change_link = true;
271
+
}
272
+
273
+
// Do not show the link if the group does not allow multiple selections.
274
+
if ( ! empty( $level_group ) && ! empty( $level_group->allow_multiple_selections ) ) {
275
+
$show_change_link = false;
276
+
}
277
+
278
+
$levels_url = pmpro_url( 'levels' );
279
+
if ( ! empty( $show_change_link ) && ! empty( $levels_url ) ) {
280
+
$pmpro_member_action_links['change'] = '<a id="pmpro_actionlink-change" href="' . esc_url( $levels_url ) . '" aria-label="' . esc_attr( sprintf( esc_html__( 'Change %1$s Membership', 'paid-memberships-pro' ), $level->name ) ) . '">' . esc_html__( 'Change', 'paid-memberships-pro' ) . '</a>';
281
+
}
282
+
283
+
$cancel_url = pmpro_url( 'cancel', 'levelstocancel=' . $level->id );
284
+
if ( ! empty( $cancel_url ) ) {
285
+
$pmpro_member_action_links['cancel'] = '<a id="pmpro_actionlink-cancel" href="' . esc_url( $cancel_url ) . '" aria-label="' . esc_attr( sprintf( esc_html__( 'Cancel %1$s Membership', 'paid-memberships-pro' ), $level->name ) ) . '">' . esc_html__( 'Cancel', 'paid-memberships-pro' ) . '</a>';
286
+
}
287
+
288
+
// Wrap each action link item in a <span>
289
+
$pmpro_member_action_links = array_map( function( $link ) {
290
+
return '<span class="' . esc_attr( pmpro_get_element_class( 'pmpro_card_action' ) ) . '">' . $link . '</span>';
291
+
}, $pmpro_member_action_links );
292
+
293
+
/**
294
+
* Filter the member action links.
295
+
*
296
+
* @param array $pmpro_member_action_links Member action links.
297
+
* @param int $level->id The ID of the membership level.
298
+
* @return array $pmpro_member_action_links Member action links.
299
+
*/
300
+
$pmpro_member_action_links = apply_filters( 'pmpro_member_action_links', $pmpro_member_action_links, $level->id );
301
+
302
+
$allowed_html = array(
303
+
'a' => array (
304
+
'class' => array(),
305
+
'href' => array(),
306
+
'id' => array(),
307
+
'target' => array(),
308
+
'title' => array(),
309
+
'aria-label' => array(),
310
+
),
311
+
'span' => array(
312
+
'class' => array(),
313
+
),
314
+
);
315
+
echo wp_kses( implode( '<span class="' . esc_attr( pmpro_get_element_class( 'pmpro_card_action_separator' ) ) . '">' . pmpro_actions_nav_separator() . '</span>', $pmpro_member_action_links ), $allowed_html );
316
+
?>
317
+
318
+
<?php
319
+
/**
320
+
* Fires after the member action links.
321
+
*/
322
+
do_action( 'pmpro_member_action_links_after' );
323
+
?>
324
+
325
+
</div> <!-- end pmpro_card_actions -->
326
+
</div> <!-- end pmpro_card -->
327
+
<?php } ?>
328
+
<?php } ?>
329
+
</div> <!-- end pmpro_section_content -->
330
+
</section> <!-- end pmpro_account-membership -->
331
+
<?php } ?>
332
+
333
+
<?php if ( in_array( 'invoices', $sections ) ) {
334
+
// Get the last 6 orders for the current user.
335
+
$orders = MemberOrder::get_orders(
336
+
array(
337
+
'limit' => 6,
338
+
'status' => array( 'pending', 'refunded', 'success' ),
339
+
'user_id' => $current_user->ID,
340
+
)
341
+
);
342
+
343
+
// Show the orders section if there are orders.
344
+
if ( ! empty( $orders ) ) {
345
+
?>
346
+
<section id="pmpro_account-orders" class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_section', 'pmpro_account-orders' ) ); ?>">
347
+
<?php
348
+
if ( '' !== $title ) { // Check if title is being forced to not show.
349
+
// If a custom title was not set, use the default. Otherwise, show the custom title.
350
+
?>
351
+
<h2 class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_section_title pmpro_font-x-large' ) ); ?>"><?php echo esc_html( null === $title ? __( 'Order History', 'paid-memberships-pro' ) : $title ); ?></h2>
352
+
<?php
353
+
}
354
+
?>
355
+
<div class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_card' ) ); ?>">
356
+
<div class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_card_content' ) ); ?>">
357
+
<table class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_table pmpro_table_orders', 'pmpro_table_orders' ) ); ?>">
358
+
<thead>
359
+
<tr>
360
+
<th class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_table_order-date' ) ); ?>"><?php esc_html_e( 'Date', 'paid-memberships-pro' ); ?></th>
361
+
<th class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_table_order-level' ) ); ?>"><?php esc_html_e( 'Level', 'paid-memberships-pro' ); ?></th>
362
+
<th class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_table_order-total' ) ); ?>"><?php esc_html_e( 'Total', 'paid-memberships-pro' ); ?></th>
363
+
<th class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_table_order-status' ) ); ?>"><?php esc_html_e( 'Status', 'paid-memberships-pro'); ?></th>
364
+
</tr>
365
+
</thead>
366
+
<tbody>
367
+
<?php
368
+
$count = 0;
369
+
foreach ( $orders as $order ) {
370
+
// Only show the first 5 orders.
371
+
if ( $count++ > 4 ) {
372
+
break;
373
+
}
374
+
375
+
// Get a member order object.
376
+
$order_id = $order->id;
377
+
$order = new MemberOrder;
378
+
$order->getMemberOrderByID($order_id);
379
+
$order->getMembershipLevel();
380
+
381
+
// Set the display status and tag style.
382
+
if ( in_array( $order->status, array( '', 'success', 'cancelled' ) ) ) {
383
+
$display_status = esc_html__( 'Paid', 'paid-memberships-pro' );
384
+
$tag_style = 'success';
385
+
} elseif ( $order->status == 'pending' ) {
386
+
// Some Add Ons set status to pending.
387
+
$display_status = esc_html__( 'Pending', 'paid-memberships-pro' );
388
+
$tag_style = 'alert';
389
+
} elseif ( $order->status == 'refunded' ) {
390
+
$display_status = esc_html__( 'Refunded', 'paid-memberships-pro' );
391
+
$tag_style = 'error';
392
+
}
393
+
$invoice_url = pmpro_url( "invoice", "?invoice=" . $order->code );
394
+
$date_content = empty( $invoice_url ) ? date_i18n( get_option( 'date_format' ), $order->getTimestamp() ) : '<a href="' . esc_url( $invoice_url ) . '">' . esc_html( date_i18n( get_option( 'date_format' ), $order->getTimestamp() ) ) . '</a>';
395
+
?>
396
+
<tr id="pmpro_table_order-<?php echo esc_attr( $order->code ); ?>">
397
+
<th class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_table_order-date' ) ); ?>" data-title="<?php esc_attr_e( 'Date', 'paid-memberships-pro' ); ?>"><?php echo wp_kses_post( $date_content ); ?></th>
398
+
<td class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_table_order-level' ) ); ?>" data-title="<?php esc_attr_e( 'Level', 'paid-memberships-pro' ); ?>"><?php if(!empty($order->membership_level)) echo esc_html( $order->membership_level->name ); else echo esc_html__("N/A", 'paid-memberships-pro' );?></td>
399
+
<td class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_table_order-amount' ) ); ?>" data-title="<?php esc_attr_e( 'Amount', 'paid-memberships-pro' ); ?>"><?php
400
+
//phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
401
+
echo pmpro_escape_price( $order->get_formatted_total() ); ?></td>
402
+
<td class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_table_order-status' ) ); ?>" data-title="<?php esc_attr_e( 'Status', 'paid-memberships-pro' ); ?>">
403
+
<span class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_tag pmpro_tag-' . $tag_style ) ); ?>"><?php echo esc_html( $display_status ); ?></span>
404
+
</td>
405
+
</tr>
406
+
<?php
407
+
}
408
+
?>
409
+
</tbody>
410
+
</table>
411
+
</div> <!-- end pmpro_card_content -->
412
+
<?php
413
+
// Show the "View All Orders" link if there are more than 5 orders.
414
+
if ( $count == 6 ) {
415
+
$invoice_url = pmpro_url( 'invoice' );
416
+
if ( ! empty( $invoice_url ) ) {
417
+
?>
418
+
<div class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_card_actions' ) ); ?>">
419
+
<a href="<?php echo esc_url( $invoice_url ); ?>"><?php esc_html_e( 'View All Orders →', 'paid-memberships-pro' );?></a>
420
+
</div>
421
+
<?php
422
+
} else {
423
+
// Invoice page is not set, but we should still let the user know that there are more orders.
424
+
?>
425
+
<div class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_card_actions' ) ); ?>">
426
+
<p><?php esc_html_e( 'Please contact the site administrator for full order history.', 'paid-memberships-pro' ); ?></p>
427
+
</div>
428
+
<?php
429
+
}
430
+
}
431
+
?>
432
+
</div> <!-- end pmpro_card -->
433
+
</section> <!-- end pmpro_account-orders -->
434
+
<?php } ?>
435
+
<?php } ?>
436
+
437
+
<?php if ( in_array('links', $sections ) && ( has_filter( 'pmpro_member_links_top' ) || has_filter( 'pmpro_member_links_bottom' ) ) ) { ?>
438
+
<section id="pmpro_account-links" class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_section', 'pmpro_account-links' ) ); ?>">
439
+
<?php
440
+
if ( '' !== $title ) { // Check if title is being forced to not show.
441
+
// If a custom title was not set, use the default. Otherwise, show the custom title.
442
+
?>
443
+
<h2 class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_section_title pmpro_font-x-large' ) ); ?>"><?php echo esc_html( null === $title ? __( 'Member Links', 'paid-memberships-pro' ) : $title ); ?></h2>
444
+
<?php
445
+
}
446
+
?>
447
+
<div class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_card' ) ); ?>">
448
+
<div class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_card_content' ) ); ?>">
449
+
<ul class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_list' ) ); ?>">
450
+
<?php
451
+
do_action("pmpro_member_links_top");
452
+
?>
453
+
454
+
<?php
455
+
do_action("pmpro_member_links_bottom");
456
+
?>
457
+
</ul>
458
+
</div> <!-- end pmpro_card_content -->
459
+
</div> <!-- end pmpro_card -->
460
+
</section> <!-- end pmpro_account-links -->
461
+
<?php } ?>
462
+
</div> <!-- end pmpro -->
463
+
<?php
464
+
465
+
$content = ob_get_contents();
466
+
ob_end_clean();
467
+
468
+
return $content;
469
+
}
470
+
add_shortcode('pmpro_account', 'pmpro_shortcode_account');
471
+