Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix admin_url() function usage #1106

Merged
merged 3 commits into from
Oct 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion includes/admin/class-admin-notices.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function give_admin_bar_menu( $wp_admin_bar ) {
//Add the main siteadmin menu item.
$wp_admin_bar->add_menu( array(
'id' => 'give-test-notice',
'href' => admin_url() . 'edit.php?post_type=give_forms&page=give-settings&tab=gateways',
'href' => admin_url( 'edit.php?post_type=give_forms&page=give-settings&tab=gateways' ),
'parent' => 'top-secondary',
'title' => esc_html__( 'Give Test Mode Active', 'give' ),
'meta' => array( 'class' => 'give-test-mode-active' ),
Expand Down
2 changes: 1 addition & 1 deletion includes/admin/customers/class-customer-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function column_default( $item, $column_name ) {

case 'num_purchases' :
$value = '<a href="' .
admin_url( '/edit.php?post_type=give_forms&page=give-payment-history&user=' . urlencode( $item['email'] )
admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&user=' . urlencode( $item['email'] )
) . '">' . esc_html( $item['num_purchases'] ) . '</a>';
break;

Expand Down
11 changes: 9 additions & 2 deletions includes/admin/dashboard-widgets.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,16 @@ function give_dashboard_at_a_glance_widget( $items ) {
$text = sprintf( $text, number_format_i18n( $num_posts->publish ) );

if ( current_user_can( 'edit_give_forms', get_current_user_id() ) ) {
$text = sprintf( '<a class="give-forms-count" href="edit.php?post_type=give_forms">%1$s</a>', $text );
$text = sprintf(
'<a class="give-forms-count" href="%1$s">%2$s</a>',
admin_url( 'edit.php?post_type=give_forms' ),
$text
);
} else {
$text = sprintf( '<span class="give-forms-count">%1$s</span>', $text );
$text = sprintf(
'<span class="give-forms-count">%1$s</span>',
$text
);
}

$items[] = $text;
Expand Down
2 changes: 1 addition & 1 deletion includes/admin/payments/actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ function give_trigger_purchase_delete( $data ) {
}

give_delete_purchase( $payment_id );
wp_redirect( admin_url( '/edit.php?post_type=give_forms&page=give-payment-history&give-message=payment_deleted' ) );
wp_redirect( admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&give-message=payment_deleted' ) );
give_die();
}
}
Expand Down
2 changes: 1 addition & 1 deletion includes/admin/reporting/class-donor-reports-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public function column_default( $item, $column_name ) {

case 'num_purchases' :
$value = '<a href="' .
admin_url( '/edit.php?post_type=give_forms&page=give-payment-history&user=' . urlencode( $item['email'] )
admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&user=' . urlencode( $item['email'] )
) . '">' . esc_html( $item['num_purchases'] ) . '</a>';
break;

Expand Down
2 changes: 1 addition & 1 deletion includes/admin/welcome.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public function tabs() {
<a class="nav-tab <?php echo $selected == 'give-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-credits' ), 'index.php' ) ) ); ?>">
<?php esc_html_e( 'Credits', 'give' ); ?>
</a>
<a class="nav-tab <?php echo $selected == 'give-add-ons' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( null, 'index.php' ) ) . 'edit.php?post_type=give_forms&page=give-addons'; ?>">
<a class="nav-tab <?php echo $selected == 'give-add-ons' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-addons' ) ); ?>">
<?php esc_html_e( 'Add-ons', 'give' ); ?>
</a>
</h2>
Expand Down