diff --git a/go-form-plugin/go-form-plugin.php b/go-form-plugin/go-form-plugin.php index afd221e..133f39b 100644 --- a/go-form-plugin/go-form-plugin.php +++ b/go-form-plugin/go-form-plugin.php @@ -11,6 +11,7 @@ if (!defined('ABSPATH')) exit; // ========== Database ========== function go_form_activate() { global $wpdb; + require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); $charset = $wpdb->get_charset_collate(); $forms = $wpdb->prefix . 'go_form_forms'; $entries = $wpdb->prefix . 'go_form_entries'; @@ -138,27 +139,7 @@ function go_form_shortcode($atts) { ob_start(); echo $msg; - echo '
-

Add New Player

-
- '.wp_nonce_field('go_form_action', 'go_form_nonce', true, false).' - - - - - - - - - - -
-

* Required fields

- -
-

Players

'; - go_form_render_entries_table(go_form_get_entries($form_id)); - echo '
'; + include plugin_dir_path(__FILE__) . 'templates/form-shortcode.php'; return ob_get_clean(); } add_shortcode('go_form', 'go_form_shortcode'); diff --git a/go-form-plugin/templates/form-shortcode.php b/go-form-plugin/templates/form-shortcode.php new file mode 100644 index 0000000..529c94a --- /dev/null +++ b/go-form-plugin/templates/form-shortcode.php @@ -0,0 +1,21 @@ +
+

Add New Player

+
+ + + + + + + + + + + +
+

* Required fields

+ +
+

Players

+ +