WC_Settings_Accounts

WC_Settings_Accounts.

Defined (1)

The class is defined in the following location(s).

/includes/admin/settings/class-wc-settings-accounts.php  
  1. class WC_Settings_Accounts extends WC_Settings_Page { 
  2.  
  3. /** 
  4. * Constructor. 
  5. */ 
  6. public function __construct() { 
  7.  
  8. $this->id = 'account'; 
  9. $this->label = __( 'Accounts', 'woocommerce' ); 
  10.  
  11. add_filter( 'woocommerce_settings_tabs_array', array( $this, 'add_settings_page' ), 20 ); 
  12. add_action( 'woocommerce_settings_' . $this->id, array( $this, 'output' ) ); 
  13. add_action( 'woocommerce_settings_save_' . $this->id, array( $this, 'save' ) ); 
  14.  
  15. /** 
  16. * Get settings array. 
  17. * @return array 
  18. */ 
  19. public function get_settings() { 
  20. $settings = apply_filters( 'woocommerce_' . $this->id . '_settings', array( 
  21.  
  22. array( 'title' => __( 'Account pages', 'woocommerce' ), 'type' => 'title', 'desc' => __( 'These pages need to be set so that WooCommerce knows where to send users to access account related functionality.', 'woocommerce' ), 'id' => 'account_page_options' ),  
  23.  
  24. array( 
  25. 'title' => __( 'My account page', 'woocommerce' ),  
  26. 'desc' => sprintf( __( 'Page contents: [%s]', 'woocommerce' ), apply_filters( 'woocommerce_my_account_shortcode_tag', 'woocommerce_my_account' ) ),  
  27. 'id' => 'woocommerce_myaccount_page_id',  
  28. 'type' => 'single_select_page',  
  29. 'default' => '',  
  30. 'class' => 'wc-enhanced-select',  
  31. 'css' => 'min-width:300px;',  
  32. 'desc_tip' => true,  
  33. ),  
  34.  
  35. array( 'type' => 'sectionend', 'id' => 'account_page_options' ),  
  36.  
  37. array( 'title' => '', 'type' => 'title', 'id' => 'account_registration_options' ),  
  38.  
  39. array( 
  40. 'title' => __( 'Customer registration', 'woocommerce' ),  
  41. 'desc' => __( 'Enable customer registration on the "Checkout" page.', 'woocommerce' ),  
  42. 'id' => 'woocommerce_enable_signup_and_login_from_checkout',  
  43. 'default' => 'yes',  
  44. 'type' => 'checkbox',  
  45. 'checkboxgroup' => 'start',  
  46. 'autoload' => false,  
  47. ),  
  48.  
  49. array( 
  50. 'desc' => __( 'Enable customer registration on the "My account" page.', 'woocommerce' ),  
  51. 'id' => 'woocommerce_enable_myaccount_registration',  
  52. 'default' => 'no',  
  53. 'type' => 'checkbox',  
  54. 'checkboxgroup' => 'end',  
  55. 'autoload' => false,  
  56. ),  
  57.  
  58. array( 
  59. 'title' => __( 'Login', 'woocommerce' ),  
  60. 'desc' => __( 'Display returning customer login reminder on the "Checkout" page.', 'woocommerce' ),  
  61. 'id' => 'woocommerce_enable_checkout_login_reminder',  
  62. 'default' => 'yes',  
  63. 'type' => 'checkbox',  
  64. 'checkboxgroup' => 'start',  
  65. 'autoload' => false,  
  66. ),  
  67.  
  68. array( 
  69. 'title' => __( 'Account creation', 'woocommerce' ),  
  70. 'desc' => __( 'Automatically generate username from customer email.', 'woocommerce' ),  
  71. 'id' => 'woocommerce_registration_generate_username',  
  72. 'default' => 'yes',  
  73. 'type' => 'checkbox',  
  74. 'checkboxgroup' => 'start',  
  75. 'autoload' => false,  
  76. ),  
  77.  
  78. array( 
  79. 'desc' => __( 'Automatically generate customer password', 'woocommerce' ),  
  80. 'id' => 'woocommerce_registration_generate_password',  
  81. 'default' => 'no',  
  82. 'type' => 'checkbox',  
  83. 'checkboxgroup' => 'end',  
  84. 'autoload' => false,  
  85. ),  
  86.  
  87. array( 'type' => 'sectionend', 'id' => 'account_registration_options' ),  
  88.  
  89. array( 'title' => __( 'My account endpoints', 'woocommerce' ), 'type' => 'title', 'desc' => __( 'Endpoints are appended to your page URLs to handle specific actions on the accounts pages. They should be unique and can be left blank to disable the endpoint.', 'woocommerce' ), 'id' => 'account_endpoint_options' ),  
  90.  
  91. array( 
  92. 'title' => __( 'Orders', 'woocommerce' ),  
  93. 'desc' => __( 'Endpoint for the "My account → Orders" page.', 'woocommerce' ),  
  94. 'id' => 'woocommerce_myaccount_orders_endpoint',  
  95. 'type' => 'text',  
  96. 'default' => 'orders',  
  97. 'desc_tip' => true,  
  98. ),  
  99.  
  100. array( 
  101. 'title' => __( 'View order', 'woocommerce' ),  
  102. 'desc' => __( 'Endpoint for the "My account → View order" page.', 'woocommerce' ),  
  103. 'id' => 'woocommerce_myaccount_view_order_endpoint',  
  104. 'type' => 'text',  
  105. 'default' => 'view-order',  
  106. 'desc_tip' => true,  
  107. ),  
  108.  
  109. array( 
  110. 'title' => __( 'Downloads', 'woocommerce' ),  
  111. 'desc' => __( 'Endpoint for the "My account → Downloads" page.', 'woocommerce' ),  
  112. 'id' => 'woocommerce_myaccount_downloads_endpoint',  
  113. 'type' => 'text',  
  114. 'default' => 'downloads',  
  115. 'desc_tip' => true,  
  116. ),  
  117.  
  118. array( 
  119. 'title' => __( 'Edit account', 'woocommerce' ),  
  120. 'desc' => __( 'Endpoint for the "My account → Edit account" page.', 'woocommerce' ),  
  121. 'id' => 'woocommerce_myaccount_edit_account_endpoint',  
  122. 'type' => 'text',  
  123. 'default' => 'edit-account',  
  124. 'desc_tip' => true,  
  125. ),  
  126.  
  127. array( 
  128. 'title' => __( 'Addresses', 'woocommerce' ),  
  129. 'desc' => __( 'Endpoint for the "My account → Addresses" page.', 'woocommerce' ),  
  130. 'id' => 'woocommerce_myaccount_edit_address_endpoint',  
  131. 'type' => 'text',  
  132. 'default' => 'edit-address',  
  133. 'desc_tip' => true,  
  134. ),  
  135.  
  136. array( 
  137. 'title' => __( 'Payment methods', 'woocommerce' ),  
  138. 'desc' => __( 'Endpoint for the "My account → Payment methods" page.', 'woocommerce' ),  
  139. 'id' => 'woocommerce_myaccount_payment_methods_endpoint',  
  140. 'type' => 'text',  
  141. 'default' => 'payment-methods',  
  142. 'desc_tip' => true,  
  143. ),  
  144.  
  145. array( 
  146. 'title' => __( 'Lost password', 'woocommerce' ),  
  147. 'desc' => __( 'Endpoint for the "My account → Lost password" page.', 'woocommerce' ),  
  148. 'id' => 'woocommerce_myaccount_lost_password_endpoint',  
  149. 'type' => 'text',  
  150. 'default' => 'lost-password',  
  151. 'desc_tip' => true,  
  152. ),  
  153.  
  154. array( 
  155. 'title' => __( 'Logout', 'woocommerce' ),  
  156. 'desc' => __( 'Endpoint for the triggering logout. You can add this to your menus via a custom link: yoursite.com/?customer-logout=true', 'woocommerce' ),  
  157. 'id' => 'woocommerce_logout_endpoint',  
  158. 'type' => 'text',  
  159. 'default' => 'customer-logout',  
  160. 'desc_tip' => true,  
  161. ),  
  162.  
  163. array( 'type' => 'sectionend', 'id' => 'account_endpoint_options' ),  
  164.  
  165. ) ); 
  166.  
  167. return apply_filters( 'woocommerce_get_settings_' . $this->id, $settings );