errors[] = (string) $msg; } /** * Echoes the content of the $errors array as formatted HTML if it contains error messages. */ public function display_errors() { if ( count( $this->errors ) < 1 ) { return; } $html = '
'; $html .= sprintf( '%s', esc_html__( 'Errors:', 'search-and-replace' ) ); $html .= ''; $html .= '
'; echo $html; } /** *displays the html for the submit button */ public function show_submit_button() { echo ''; submit_button( $this->get_submit_button_title() ); wp_nonce_field( 'replace_domain', 'insr_nonce' ); } /** * @return string */ protected function get_submit_button_title() { return esc_html__( 'Submit', 'search-replace' ); } /** * @return string */ public function get_slug() { return sanitize_title_with_dashes( $this->get_page_title() ); } }