/app/view/shortcode/class-ms-view-shortcode-login.php

  1. <?php 
  2. class MS_View_Shortcode_Login extends MS_View { 
  3.  
  4. /** 
  5. * Returns the HTML code. 
  6. * 
  7. * @since 1.0.0 
  8. * @return string 
  9. */ 
  10. public function to_html() { 
  11. $res_html = ''; 
  12. $res_form = ''; 
  13. $html = ''; 
  14.  
  15. $valid_forms = array( 
  16. 'login',  
  17. 'logout',  
  18. 'reset',  
  19. 'lost',  
  20. ); 
  21.  
  22. extract( $this->data ); 
  23.  
  24. if ( ! isset( $form ) || ! in_array( $form, $valid_forms ) ) { 
  25. if ( MS_Model_Member::is_logged_in() ) { 
  26. $form = 'logout'; 
  27. } elseif ( isset( $action ) && 'resetpass' === $action ) { 
  28. $form = 'reset'; 
  29. } elseif ( isset( $_GET['show'] ) && 'lostpass' == $_GET['show'] ) { 
  30. $form = 'lost'; 
  31. } else { 
  32. $form = 'login'; 
  33.  
  34. $this->data['form'] = $form; 
  35.  
  36. /** 
  37. * Provide a customized login form. 
  38. * 
  39. * Possible filters to provide a customized login form: 
  40. * - 'ms_shortcode_custom_form-login' 
  41. * - 'ms_shortcode_custom_form-logout' 
  42. * - 'ms_shortcode_custom_form-reset' 
  43. * - 'ms_shortcode_custom_form-lost' 
  44. * 
  45. * @since 1.0.0 
  46. */ 
  47. $html = apply_filters( 
  48. 'ms_shortcode_custom_form-' . $form,  
  49. '',  
  50. $this->data 
  51. ); 
  52.  
  53. if ( ! empty( $html ) ) { 
  54. return $html; 
  55. } else { 
  56. $html = ''; 
  57.  
  58. if ( 'logout' === $form ) { 
  59. return $this->logout_form(); 
  60. } elseif ( 'reset' === $form ) { 
  61. return $this->reset_form(); 
  62. } else { 
  63. if ( empty( $redirect_login ) ) { 
  64. $redirect_login = MS_Helper_Utility::get_current_url(); 
  65.  
  66. // Build the Login Form. 
  67. $res_form .= $prefix; 
  68. $res_form .= $this->login_form( $redirect_login ); 
  69. $res_form .= $this->lostpass_form(); 
  70.  
  71. // Wrap form in optional wrappers. 
  72. if ( ! empty( $wrapwith ) ) { 
  73. $res_form .= sprintf( '<%s class="%s">', esc_attr( $wrapwith ), esc_attr( $wrapwithclass ) ); 
  74. $res_form = sprintf( 
  75. '<%1$s class="%2$s">%3$s</%1$s>',  
  76. esc_attr( $wrapwith ),  
  77. esc_attr( $wrapwithclass ),  
  78. $res_form 
  79. ); 
  80. if ( ! empty( $item ) ) { 
  81. $res_form = sprintf( 
  82. '<%1$s class="%2$s">%3$s</%1$s>',  
  83. esc_attr( $item ),  
  84. esc_attr( $itemclass ),  
  85. $res_form 
  86. ); 
  87. if ( ! empty( $holder ) ) { 
  88. $res_form = sprintf( 
  89. '<%1$s class="%2$s">%3$s</%1$s>',  
  90. esc_attr( $holder ),  
  91. esc_attr( $holderclass ),  
  92. $res_form 
  93. ); 
  94.  
  95. // Complete the HTML output. 
  96. if ( $header ) { 
  97. $html .= $this->login_header_html(); 
  98. $html .= $res_form; 
  99.  
  100. if ( $register && ! MS_Model_Member::is_logged_in() ) { 
  101. if ( MS_Model_Member::can_register() ) { 
  102. $link = sprintf( 
  103. '<a href="%1$s">%2$s</a>',  
  104. MS_Controller_Frontend::get_registration_url( 'register' ),  
  105. __( 'Register', 'membership2' ) 
  106. ); 
  107.  
  108. /** 
  109. * Filter documented in wp-includes/general-template.php 
  110. */ 
  111. $html .= apply_filters( 'register', $link ); 
  112.  
  113. // Load the ajax script that handles the Ajax login functions. 
  114. wp_enqueue_script( 'ms-ajax-login' ); 
  115.  
  116. lib3()->ui->data( 
  117. 'ms_ajax_login',  
  118. array( 
  119. //'ajaxurl' => admin_url( 'admin-ajax.php' ),  
  120. 'ajaxurl' => admin_url( 'admin-ajax.php', is_ssl() ? 'https' : 'http' ),  
  121. 'loadingmessage' => __( 'Please wait...', 'membership2' ),  
  122. 'errormessage' => __( 'Request failed, please try again.', 'membership2' ),  
  123. ); 
  124. // Remove linebreaks to bypass the "wpautop" filter. 
  125. $html = str_replace( array( "\r\n", "\r", "\n" ), '', $html ); 
  126.  
  127. $html = '<div class="ms-membership-form-wrapper">' . $html . '</div>'; 
  128. $html = apply_filters( 'ms_compact_code', $html ); 
  129.  
  130. /** 
  131. * Possible filters to provide a customized login form: 
  132. * - 'ms_shortcode_form-login' 
  133. * - 'ms_shortcode_form-logout' 
  134. * - 'ms_shortcode_form-reset' 
  135. * - 'ms_shortcode_form-lost' 
  136. */ 
  137. return apply_filters( 
  138. 'ms_shortcode_form-' . $form,  
  139. $html,  
  140. $this->data 
  141. ); 
  142.  
  143. /** 
  144. * Returns HTML partial with the header of the login form. 
  145. * 
  146. * @since 1.0.0 
  147. * 
  148. * @return string 
  149. */ 
  150. private function login_header_html() { 
  151. extract( $this->data ); 
  152.  
  153. ob_start(); 
  154. ?> 
  155. <legend><?php echo esc_html( $title ); ?></legend> 
  156. <?php if ( $show_note ) : ?> 
  157. <div class="ms-alert-box ms-alert-error"> 
  158. <?php _e( 'Please log in to access this page.', 'membership2' ); ?> 
  159. </div> 
  160. <?php endif; 
  161.  
  162. return ob_get_clean(); 
  163.  
  164. /** 
  165. * Returns HTML partial with the actual login form. 
  166. * 
  167. * @since 1.0.0 
  168. * 
  169. * @param string $redirect_to URL to redirect to right after login. 
  170. * @return string 
  171. */ 
  172. private function login_form( $redirect_to = null ) { 
  173. if ( empty( $redirect_to ) ) { 
  174. // Default redirect is back to the current page 
  175. $redirect_to = lib3()->net->current_url(); 
  176.  
  177. $defaults = array( 
  178. 'redirect_login' => $redirect_to,  
  179. 'label_username' => __( 'Username', 'membership2' ),  
  180. 'label_password' => __( 'Password', 'membership2' ),  
  181. 'label_remember' => __( 'Remember Me', 'membership2' ),  
  182. 'label_log_in' => __( 'Log In', 'membership2' ),  
  183. 'id_login_form' => 'loginform',  
  184. 'id_username' => 'user_login',  
  185. 'id_password' => 'user_pass',  
  186. 'id_remember' => 'rememberme',  
  187. 'id_login' => 'wp-submit',  
  188. 'show_remember' => true,  
  189. 'value_username' => '',  
  190. 'value_remember' => false, // Set this to true to default the "Remember me" checkbox to checked 
  191. ); 
  192.  
  193. /** 
  194. * Filter the default login form output arguments. 
  195. * 
  196. * @since 1.0.0 
  197. * 
  198. * @see wp_login_form() 
  199. * 
  200. * @param array $defaults An array of default login form arguments. 
  201. */ 
  202. $args = wp_parse_args( 
  203. $this->data,  
  204. apply_filters( 'login_form_defaults', $defaults ) 
  205. ); 
  206.  
  207. extract( $args ); 
  208.  
  209. $show_form = 'login' === $form ? '' : 'display:none'; 
  210. $form_class = 'ms-form ms-form-login'; 
  211. if ( $show_labels ) { 
  212. $form_class .= ' ms-has-labels'; 
  213. } else { 
  214. $form_class .= ' ms-no-labels'; 
  215. if ( $autofocus ) { 
  216. $form_class .= ' autofocus'; 
  217.  
  218. ob_start(); 
  219. ?> 
  220. <form 
  221. name="<?php echo esc_attr( $id_login_form ); ?>" 
  222. id="<?php echo esc_attr( $id_login_form ); ?>" 
  223. action="login" method="post" 
  224. class="<?php echo esc_attr( $form_class ); ?>" 
  225. style="<?php echo esc_attr( $show_form ); ?>"> 
  226.  
  227. <div class="form"> 
  228. <?php wp_nonce_field( 'ms-ajax-login' ); ?> 
  229. <?php echo apply_filters( 'login_form_top', '', $args ); ?> 
  230. <?php if ( 'top' === $nav_pos ) : ?> 
  231. <div class="status" style="display:none"></div> 
  232. <?php endif; ?> 
  233. <p class="login-username ms-field"> 
  234. <?php if ( $show_labels ) : ?> 
  235. <label for="<?php echo esc_attr( $id_username ); ?>"> 
  236. <?php echo esc_html( $label_username ); ?> 
  237. </label> 
  238. <?php endif; ?> 
  239. <input 
  240. type="text" 
  241. name="log" 
  242. id="<?php echo esc_attr( $id_username ); ?>" 
  243. class="input focus" 
  244. value="<?php echo esc_attr( $value_username ); ?>" 
  245. size="20" 
  246. placeholder="<?php echo esc_html( $label_username ); ?>"> 
  247. </p> 
  248. <p class="login-password ms-field"> 
  249. <?php if ( $show_labels ) : ?> 
  250. <label for="<?php echo esc_attr( $id_password ); ?>"> 
  251. <?php echo esc_html( $label_password ); ?> 
  252. </label> 
  253. <?php endif; ?> 
  254. <input 
  255. type="password" 
  256. name="pwd" 
  257. id="<?php echo esc_attr( $id_password ); ?>" 
  258. class="input" 
  259. value="" 
  260. size="20" 
  261. placeholder="<?php echo esc_html( $label_password ); ?>"> 
  262. </p> 
  263. <?php echo apply_filters( 'login_form_middle', '', $args ); ?> 
  264. <?php if ( 'top' === $nav_pos ) : ?> 
  265. <div class="nav"> 
  266. <p><a class="lost" href="#lostpassword"> 
  267. <?php _e( 'Lost your password?', 'membership2' ); ?> 
  268. </a></p> 
  269. </div> 
  270. <?php endif; ?> 
  271. <?php if ( $show_remember ) : ?> 
  272. <p class="login-remember ms-field"> 
  273. <input 
  274. name="rememberme" 
  275. type="checkbox" 
  276. id="<?php echo esc_attr( $id_remember ); ?>" 
  277. value="forever" 
  278. <?php checked( $value_remember ); ?> /> 
  279. <label for="<?php echo esc_attr( $id_remember ); ?>"> 
  280. <?php echo esc_html( $label_remember ); ?> 
  281. </label> 
  282. </p> 
  283. <?php endif; ?> 
  284. <?php do_action( 'login_form' );?> 
  285. <p class="login-submit"> 
  286. <input 
  287. type="submit" 
  288. name="wp-submit" 
  289. id="<?php echo esc_attr( $id_login ); ?>" 
  290. class="button-primary" 
  291. value="<?php echo esc_attr( $label_log_in ); ?>" /> 
  292. <input type="hidden" name="redirect_to" value="<?php echo esc_url( $redirect_login ); ?>" /> 
  293. </p> 
  294. <?php echo apply_filters( 'login_form_bottom', '', $args ); ?> 
  295. <?php if ( 'bottom' === $nav_pos ) : ?> 
  296. <div class="status" style="display:none"></div> 
  297. </div> 
  298. <div class="nav"> 
  299. <p><a class="lost" href="#lostpassword"><?php _e( 'Lost your password?', 'membership2' ); ?></a></p> 
  300. <?php endif; ?> 
  301. </div> 
  302. </form> 
  303. <?php 
  304.  
  305. /** 
  306. * Fire the login-footer action, which is usually done in the page footer 
  307. * of the wp-login.php page. This hook is used by other plugins to include 
  308. * custom javascript or CSS on the login page. 
  309. * 
  310. * We need it specifically for our Domain Mapping plugin. 
  311. * 
  312. * @since 1.0.3.2 
  313. */ 
  314. do_action( 'login_footer' ); 
  315.  
  316. $html = ob_get_clean(); 
  317. $html = apply_filters( 'ms_compact_code', $html ); 
  318. return $html; 
  319.  
  320. /** 
  321. * Returns the HTML partial of the lost-password form 
  322. * 
  323. * @since 1.0.0 
  324. * 
  325. * @return string 
  326. */ 
  327. private function lostpass_form() { 
  328. $defaults = array( 
  329. 'label_lost_username' => __( 'Username or E-mail', 'membership2' ),  
  330. 'label_lostpass' => __( 'Reset Password', 'membership2' ),  
  331. 'id_lost_form' => 'lostpasswordform',  
  332. 'id_lost_username' => 'user_login',  
  333. 'id_lostpass' => 'wp-submit',  
  334. 'value_username' => '',  
  335. ); 
  336.  
  337. /** 
  338. * Filter the default login form output arguments. 
  339. * 
  340. * @since 1.0.0 
  341. * 
  342. * @see wp_login_form() 
  343. * 
  344. * @param array $defaults An array of default login form arguments. 
  345. */ 
  346. $args = wp_parse_args( $this->data, apply_filters( 'login_form_defaults', $defaults ) ); 
  347.  
  348. extract( $args ); 
  349.  
  350. $show_form = 'lost' === $form ? '' : 'display:none'; 
  351. $form_class = 'ms-form ms-form-lost'; 
  352. if ( $show_labels ) { 
  353. $form_class .= ' ms-has-labels'; 
  354. } else { 
  355. $form_class .= ' ms-no-labels'; 
  356.  
  357. ob_start(); 
  358. do_action( 'lost_password' ); 
  359. ?> 
  360. <form 
  361. name="<?php echo esc_attr( $id_lost_form ); ?>" 
  362. id="<?php echo esc_attr( $id_lost_form ); ?>" 
  363. action="lostpassword" 
  364. method="post" 
  365. class="<?php echo esc_attr( $form_class ); ?>" 
  366. style="<?php echo esc_attr( $show_form ); ?>"> 
  367. <div class="form"> 
  368. <?php wp_nonce_field( 'ms-ajax-lostpass' ); ?> 
  369. <?php echo apply_filters( 'lostpass_form_top', '', $args ); ?> 
  370. <?php if ( 'top' === $nav_pos ) : ?> 
  371. <div class="status" style="display:none"></div> 
  372. <?php endif; ?> 
  373. <p class="lostpassword-username ms-field"> 
  374. <?php if ( $show_labels ) : ?> 
  375. <label for="<?php echo esc_attr( $id_lost_username ); ?>" > 
  376. <?php echo esc_html( $label_lost_username ); ?> 
  377. </label> 
  378. <?php endif; ?> 
  379. <input 
  380. type="text" 
  381. name="user_login" 
  382. id="<?php echo esc_attr( $id_lost_username ); ?>" 
  383. class="input focus" 
  384. value="<?php echo esc_attr( $value_username ); ?>" 
  385. size="20" 
  386. placeholder="<?php echo esc_html( $label_lost_username ); ?>" /> 
  387. </p> 
  388. <?php echo apply_filters( 'lostpass_form_middle', '', $args ); ?> 
  389. <?php if ( 'top' === $nav_pos ) : ?> 
  390. <div class="nav"> 
  391. <p><a class="login" href="#login"><?php _e( 'Log in', 'membership2' ); ?></a></p> 
  392. </div> 
  393. <?php endif; ?> 
  394. <?php 
  395. /** 
  396. * Fires inside the lostpassword <form> tags, before the hidden fields. 
  397. * 
  398. * @since 1.0.0 
  399. */ 
  400. do_action( 'lostpassword_form' ); ?> 
  401. <p class="submit"> 
  402. <input 
  403. type="submit" 
  404. name="wp-submit" 
  405. id="<?php echo esc_attr( $id_lostpass ); ?>" 
  406. class="button-primary" 
  407. value="<?php echo esc_attr( $label_lostpass ); ?>" /> 
  408. </p> 
  409. <?php echo apply_filters( 'lostpass_form_bottom', '', $args ); ?> 
  410. <?php if ( 'bottom' === $nav_pos ) : ?> 
  411. <div class="status" style="display:none"></div> 
  412. </div> 
  413. <div class="nav"> 
  414. <p><a class="login" href="#login"><?php _e( 'Log in', 'membership2' ); ?></a></p> 
  415. <?php endif; ?> 
  416. </div> 
  417. </form> 
  418. <?php 
  419. $html = ob_get_clean(); 
  420. $html = apply_filters( 'ms_compact_code', $html ); 
  421.  
  422. return $html; 
  423.  
  424. /** 
  425. * Returns HTML partial that contains the logout form 
  426. * 
  427. * @since 1.0.0 
  428. * 
  429. * @return string 
  430. */ 
  431. private function logout_form() { 
  432. if ( ! MS_Model_Member::is_logged_in() ) { return ''; } 
  433. $member = MS_Model_Member::get_current_member(); 
  434.  
  435. extract( $this->data ); 
  436.  
  437. if ( empty( $redirect_logout ) ) { 
  438. $redirect_logout = MS_Helper_Utility::home_url( '/' ); 
  439.  
  440. $yourname = sprintf( 
  441. __( 'You are logged in as %s.', 'membership2' ),  
  442. ucfirst( $member->name ) 
  443. ); 
  444.  
  445. $yourname = apply_filters( 
  446. 'ms_shortcode_logout_message',  
  447. $yourname,  
  448. $member 
  449. ); 
  450.  
  451. $logout_text = apply_filters( 
  452. 'ms_shortcode_logout_link_text',  
  453. __( 'Logout', 'membership2' ),  
  454. $member 
  455. ); 
  456.  
  457. $redirect_logout = apply_filters( 
  458. 'ms_shortcode_logout_redirect',  
  459. $redirect_logout,  
  460. $member 
  461. ); 
  462.  
  463. $html = sprintf( 
  464. '%1$s <a class="login_button" href="%2$s">%3$s</a>',  
  465. $yourname,  
  466. wp_logout_url( $redirect_logout ),  
  467. $logout_text 
  468. ); 
  469.  
  470. if ( ! empty( $holder ) ) { 
  471. $html = sprintf( 
  472. '<%1$s class="%2$s">%3$s</%1$s>',  
  473. esc_attr( $holder ),  
  474. esc_attr( $holderclass ),  
  475. $html 
  476. ); 
  477.  
  478. return $html; 
  479.  
  480. /** 
  481. * Returns HTML partial that contains password-reset form. 
  482. * Based on WordPress core code from wp-login.php 
  483. * 
  484. * @since 1.0.0 
  485. * 
  486. * @return string 
  487. */ 
  488. private function reset_form() { 
  489. static $Reset_Result = null; 
  490.  
  491. if ( null === $Reset_Result ) { 
  492. lib3()->array->equip_get( 'login', 'key' ); 
  493. lib3()->array->equip_post( 'pass1', 'pass2' ); 
  494. $rp_login = wp_unslash( $_GET['login'] ); 
  495. $rp_key = wp_unslash( $_GET['key'] ); 
  496. $err_msg = new WP_Error(); 
  497. $fatal_error = false; 
  498.  
  499. lib3()->array->strip_slashes( $_POST, 'pass1', 'pass2' ); 
  500. $pass1 = $_POST['pass1']; 
  501. $pass2 = $_POST['pass2']; 
  502.  
  503. // Get the user object and validate the key. 
  504. if ( $rp_login && $rp_key ) { 
  505. $user = check_password_reset_key( $rp_key, $rp_login ); 
  506. } else { 
  507. $user = false; 
  508.  
  509. if ( ! $user || is_wp_error( $user ) ) { 
  510. // If the user was not found then show an error message. 
  511. if ( $user && 'expired_key' == $user->get_error_code() ) { 
  512. $fatal_error = true; 
  513. $err_msg->add( 
  514. 'password_expired_key',  
  515. __( 'Sorry, this reset-key is not valid anymore. Please request a new reset email and try again.', 'membership2' ) 
  516. ); 
  517. } else { 
  518. $fatal_error = true; 
  519. $err_msg->add( 
  520. 'password_invalid_key',  
  521. __( 'Sorry, we did not find a valid reset-key. Please request a new reset email and try again.', 'membership2' ) 
  522. ); 
  523. } else { 
  524. // If the user provided a new password, then check it now. 
  525. if ( $pass1 && $pass1 != $pass2 ) { 
  526. $pass1 = false; 
  527. $err_msg->add( 
  528. 'password_reset_mismatch',  
  529. __( 'The passwords do not match, try again.', 'membership2' ) 
  530. ); 
  531.  
  532. if ( $fatal_error && count( $err_msg->errors ) ) { 
  533. $url = esc_url_raw( 
  534. add_query_arg( 
  535. array( 'show' => 'lostpass' ),  
  536. remove_query_arg( array( 'action', 'key', 'login' ) ) 
  537. ); 
  538.  
  539. $Reset_Result = sprintf( 
  540. '[ms-note type="warning"]%s[/ms-note]<a href="%s">%s</a>',  
  541. $err_msg->get_error_message(),  
  542. $url,  
  543. __( 'Request a new password-reset key', 'membership2' ) 
  544. ); 
  545. } elseif ( $pass1 ) { 
  546. // This action is documented in wp-login.php 
  547. do_action( 'validate_password_reset', $err_msg, $user ); 
  548.  
  549. reset_password( $user, $_POST['pass1'] ); 
  550.  
  551. // All done! Show success message and link to login form 
  552. $url = esc_url_raw( 
  553. remove_query_arg( array( 'action', 'key', 'login' ) ) 
  554. ); 
  555.  
  556. $Reset_Result = sprintf( 
  557. '[ms-note type="info"]%s[/ms-note]<a href="%s">%s</a>',  
  558. __( 'Your Password has been reset.', 'membership2' ),  
  559. $url,  
  560. __( 'Login with your new password', 'membership2' ) 
  561. ); 
  562. } else { 
  563. // This action is documented in wp-login.php 
  564. do_action( 'validate_password_reset', $err_msg, $user ); 
  565.  
  566. wp_enqueue_script( 'utils' ); 
  567. wp_enqueue_script( 'user-profile' ); 
  568.  
  569. ob_start(); 
  570. if ( count( $err_msg->errors ) ) { 
  571. printf( 
  572. '[ms-note type="warning"]%s[/ms-note]',  
  573. implode( '<br>', $err_msg->get_error_messages() ) 
  574. ); 
  575. ?> 
  576. <form name="resetpassform" id="resetpassform" 
  577. action="" method="post" autocomplete="off" class="ms-form"> 
  578. <input type="hidden" id="user_login" 
  579. value="<?php echo esc_attr( $rp_login ); ?>" autocomplete="off"/> 
  580.  
  581. <p class="user-pass1-wrap"> 
  582. <label for="pass1"><?php _e( 'New password' ) ?></label><br /> 
  583. <div class="wp-pwd"> 
  584. <span class="password-input-wrapper"> 
  585. <input type="password" data-reveal="1" data-pw="<?php echo esc_attr( wp_generate_password( 16 ) ); ?>" name="pass1" id="pass1" class="input" size="20" value="" autocomplete="off" aria-describedby="pass-strength-result" /> 
  586. </span> 
  587. <div id="pass-strength-result" class="hide-if-no-js" aria-live="polite"><?php _e( 'Strength indicator' ); ?></div> 
  588. </div> 
  589. </p> 
  590. <p class="user-pass2-wrap"> 
  591. <label for="pass2"><?php _e( 'Confirm new password' ) ?></label><br /> 
  592. <input type="password" name="pass2" id="pass2" class="input" size="20" value="" autocomplete="off" /> 
  593. </p> 
  594.  
  595. <p class="description indicator-hint"><?php echo wp_get_password_hint(); ?></p> 
  596.  
  597. <br class="clear"/> 
  598.  
  599. <?php 
  600. // This action is documented in wp-login.php 
  601. do_action( 'resetpass_form', $user ); 
  602. ?> 
  603. <p class="submit"> 
  604. <input type="hidden" name="rp_key" value="<?php echo esc_attr( $rp_key ); ?>" /> 
  605.  
  606. <button type="submit" name="wp-submit" id="wp-submit" 
  607. class="button button-primary button-large"> 
  608. <?php _e( 'Reset Password', 'membership2' ); ?> 
  609. </button> 
  610. </p> 
  611. </form> 
  612. <?php 
  613. $html = ob_get_clean(); 
  614. $Reset_Result = apply_filters( 'ms_compact_code', $html ); 
  615.  
  616. $Reset_Result = do_shortcode( $Reset_Result ); 
  617.  
  618. return $Reset_Result; 
.