Skip to content

Commit

Permalink
Merge pull request #1106 from ramiy/release/1.7
Browse files Browse the repository at this point in the history
Fix admin_url() function usage
  • Loading branch information
Devin Walker committed Oct 10, 2016
2 parents fc6133d + ecc3a35 commit 7630a6f
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 7 deletions.
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

0 comments on commit 7630a6f

Please sign in to comment.