I'm new to creating wordpress plugins.
I am trying to create a plugin that creates both the client side and the admin side. a form to fill out and insert the data into a table that my plugin automatically creates.
for example:
this is the form:
As you will see the part of the administrator I already have it. Now how do I create that form on the client side? I do not have the slightest idea and trying with shortcode but I do not know if you can avoid php code with a shortcode (to do the post of the form, validate and that)
I leave the code of my main page
<?php
/*
Plugin Name: Miembros
Plugin URT: http://wc-solutions.net
Description: Plugin personalizado para la creacion de academis online
Version: 1.0
Author: WC Solutions
Author URI:http://wc-solutions.net
License: GPL
License URI: http://wc-solutions.net
*/
/*Requerimos el archivo wc_crear_menu
* llamamos instanciamso la clase para crear el menu en el administrador de wordpress creamos el menu
*/
require_once('includes/wc_crear_menu.php');
$wc_menu = new wc_crear_menu;
/*--------------------------------------------------------------------*/
/* Cargamos el CSS y JS de materialize
* agregamos el css a todos los elementos del menu
*/
function wc_load_custom_wp_admin_style($hook) {
$menus = [
'toplevel_page_WC_menu',
'miembros/admin/lista_miembros.php',
'miembros/admin/lista_cursos.php',
'miembros/admin/pagos.php',
'miembros/admin/ajustes.php',
];
if(! in_array( $hook, $menus )) {
return;
}
wp_enqueue_media();
wp_enqueue_style(
'wc_miembros_style',
plugins_url('admin/assets/css/materialize.min.css', __FILE__)
);
wp_enqueue_script(
'ajax-script',
plugins_url( 'admin/assets/js/materialize.min.js', __FILE__ ),
array( 'jquery' )
);
}
add_action( 'admin_enqueue_scripts', 'wc_load_custom_wp_admin_style' );
function wc_instalar(){
/* Creamos las tablas en l base de datos de wordpress */
require_once('includes/wc_database_creator.php');
$testdb = new wc_database_creator;
}
function wc_desinstalar(){
flush_rewrite_rules();
}
function wc_desintalar(){
// remove_menu_page('wc_Mimbros');
//borrar el plugin
}