Skip to content

Commit

Permalink
Disable Back icon on the "Add New Subscriptions" page; See: wpsharks/…
Browse files Browse the repository at this point in the history
  • Loading branch information
Kristine delos Santos committed Jul 21, 2016
1 parent 92e0b66 commit 09170be
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
4 changes: 1 addition & 3 deletions src/includes/classes/SubManageSubFormBase.php
Expand Up @@ -160,11 +160,9 @@ protected function maybeDisplay()
$valid_sub_key = $this->plugin->utils_sub->get($sub_key);
$is_edit = $this->is_edit;
$sub = $this->sub;
$current_email = $this->plugin->utils_sub->currentEmail();
$current_email = (bool) $this->plugin->utils_sub->currentEmail();
$has_subscriptions = $current_email ? (bool)$this->plugin->utils_sub->queryTotal(null, ['sub_email' => $current_email, 'status' => 'subscribed', 'sub_email_or_user_ids' => true]) : false;

// $has_subscriptions = false;

$form_fields = $this->form_fields;

$current_value_for = function ($key_prop) use ($_this) {
Expand Down
Expand Up @@ -79,7 +79,7 @@
</li>
<?php endforeach; ?>
</ul>
<?php if (has_subscriptions) : ?>
<?php ($is_edit || ($current_email && $has_subscriptions)) ?>
<p style="margin-top:1em;">
<a href="<?php echo esc_attr($plugin->utils_url->subManageSummaryUrl($sub_key, null, true)); ?>">
<i class="fa fa-arrow-circle-left"></i> <?php echo __('Back to My Subscriptions', SLUG_TD); ?>
Expand Down Expand Up @@ -165,7 +165,7 @@
</li>
<?php endforeach; ?>
</ul>
<?php if (has_subscriptions) : ?>
<?php ($is_edit || ($current_email && $has_subscriptions)) ?>
<p style="margin-top:1em;">
<a href="<?php echo esc_attr($sub_summary_return_url); ?>">
<i class="fa fa-arrow-circle-left"></i> <?php echo __('Back to My Subscriptions', SLUG_TD); ?>
Expand All @@ -177,7 +177,7 @@
<?php endif; ?>

<h2 style="margin-top:0;">
<?php if (has_subscriptions) : ?>
<?php ($is_edit || ($current_email && $has_subscriptions)) ?>
<a href="<?php echo esc_attr($sub_summary_return_url); ?>" title="<?php echo __('Back to My Subscriptions', SLUG_TD); ?>">
<i class="fa fa-arrow-circle-left pull-right"></i>
</a>
Expand Down
3 changes: 1 addition & 2 deletions src/includes/templates/type-s/site/footer-tag.php
Expand Up @@ -31,11 +31,10 @@
$blog_name_clip = $plugin->utils_string->clip(get_bloginfo('name'));

// Summary return URL; w/ all summary navigation vars preserved. Display only when the current user has subscriptions.
$current_email = $plugin->utils_sub->currentEmail();
$current_email = (bool) $this->plugin->utils_sub->currentEmail();
$has_subscriptions = $current_email ? (bool)$this->plugin->utils_sub->queryTotal(null, ['sub_email' => $current_email, 'status' => 'subscribed', 'sub_email_or_user_ids' => true]) : false;

$sub_summary_return_url = $has_subscriptions && $plugin->utils_url->subManageSummaryUrl(!empty($sub_key) ? $sub_key : '', null, true);
// $sub_summary_return_url = '';

// Current `host[/path]` with support for multisite network child blogs.
$current_host_path = $plugin->utils_url->currentHostPath();
Expand Down

0 comments on commit 09170be

Please sign in to comment.