%s', $type, $message ); } /** * Render contact form shortcode * * @param array $atts * @param string $contents * * @return string */ public function render_shortcode( $atts, $contents = '' ) { extract( shortcode_atts( array( 'id' => 0 ), $atts ) ); weforms()->scripts->enqueue_frontend(); ob_start(); $form = weforms()->form->get( $id ); if ( ! $form->id ) { return $this->show_error( __( 'The form couldn\'t be found.', 'weforms' ) ); } $is_open = $form->is_submission_open(); if ( is_wp_error( $is_open ) ) { return $this->show_error( $is_open->get_error_message() ); } $this->render_form( $form ); return ob_get_clean(); } /** * Render the form * * @param \WeForms_Form $form * * @return void */ function render_form( $form ) { $form_fields = $form->get_fields(); $form_settings = $form->get_settings(); $show_credit = weforms_get_settings( 'credit', false ); ?>
' . __( 'Powered by weForms', 'weforms' ) . '', 'https://wordpress.org/plugins/weforms/' ); } weforms_track_form_view( $form->id ); } /** * Render submit button * * @param integer $form_id * @param array $form_settings * * @return void */ function submit_button( $form_id, $form_settings ) { ?>
  •