No Description

dashboard.php 2.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. /**
  3. * My Account Dashboard
  4. *
  5. * Shows the first intro screen on the account dashboard.
  6. *
  7. * This template can be overridden by copying it to yourtheme/woocommerce/myaccount/dashboard.php.
  8. *
  9. * HOWEVER, on occasion WooCommerce will need to update template files and you
  10. * (the theme developer) will need to copy the new files to your theme to
  11. * maintain compatibility. We try to do this as little as possible, but it does
  12. * happen. When this occurs the version of the template file will be bumped and
  13. * the readme will list any important changes.
  14. *
  15. * @see https://docs.woocommerce.com/document/template-structure/
  16. * @package WooCommerce\Templates
  17. * @version 4.4.0
  18. */
  19. if ( ! defined( 'ABSPATH' ) ) {
  20. exit; // Exit if accessed directly.
  21. }
  22. $allowed_html = array(
  23. 'a' => array(
  24. 'href' => array(),
  25. ),
  26. );
  27. ?>
  28. <p>
  29. <?php
  30. printf(
  31. /* translators: 1: user display name 2: logout url */
  32. wp_kses( __( 'Hello %1$s (not %1$s? <a href="%2$s">Log out</a>)', 'woocommerce' ), $allowed_html ),
  33. '<strong>' . esc_html( $current_user->display_name ) . '</strong>',
  34. esc_url( wc_logout_url() )
  35. );
  36. ?>
  37. </p>
  38. <p>
  39. <?php
  40. /* translators: 1: Orders URL 2: Address URL 3: Account URL. */
  41. $dashboard_desc = __( 'From your account dashboard you can view your <a href="%1$s">recent orders</a>, manage your <a href="%2$s">billing address</a>, and <a href="%3$s">edit your password and account details</a>.', 'woocommerce' );
  42. if ( wc_shipping_enabled() ) {
  43. /* translators: 1: Orders URL 2: Addresses URL 3: Account URL. */
  44. $dashboard_desc = __( 'From your account dashboard you can view your <a href="%1$s">recent orders</a>, manage your <a href="%2$s">shipping and billing addresses</a>, and <a href="%3$s">edit your password and account details</a>.', 'woocommerce' );
  45. }
  46. printf(
  47. wp_kses( $dashboard_desc, $allowed_html ),
  48. esc_url( wc_get_endpoint_url( 'orders' ) ),
  49. esc_url( wc_get_endpoint_url( 'edit-address' ) ),
  50. esc_url( wc_get_endpoint_url( 'edit-account' ) )
  51. );
  52. ?>
  53. </p>
  54. <?php
  55. /**
  56. * My Account dashboard.
  57. *
  58. * @since 2.6.0
  59. */
  60. do_action( 'woocommerce_account_dashboard' );
  61. /**
  62. * Deprecated woocommerce_before_my_account action.
  63. *
  64. * @deprecated 2.6.0
  65. */
  66. do_action( 'woocommerce_before_my_account' );
  67. /**
  68. * Deprecated woocommerce_after_my_account action.
  69. *
  70. * @deprecated 2.6.0
  71. */
  72. do_action( 'woocommerce_after_my_account' );
  73. /* Omit closing PHP tag at the end of PHP files to avoid "headers already sent" issues. */