define_hooks(); } public function controller() { if( isset( $_GET['submit'] ) ) { // Submit button $full_name = filter_input( INPUT_GET, 'full_name', FILTER_SANITIZE_STRING ); $phone = filter_input( INPUT_GET, 'phone', FILTER_SANITIZE_STRING ); } } /** * Display form */ public function display_form() { $full_name = filter_input( INPUT_GET, 'full_name', FILTER_SANITIZE_STRING ); $phone = filter_input( INPUT_GET, 'phone', FILTER_SANITIZE_STRING ); // Default empty array $output = ''; $geturl =get_the_permalink(); $getdate =get_the_date(); $output .= '
'; return $output; } /** * Display text field */ private function display_text( $name, $label, $value = '' ) { $output = ''; $output .= ''; $output .= ''; return $output; } /** * Define hooks related to plugin */ private function define_hooks() { /** * Add action to send email */ add_action( 'wp', array( $this, 'controller' ) ); /** * Add shortcode to display form */ add_shortcode( 'contact', array( $this, 'display_form' ) ); } } new WPSE_299521_Form(); function wpb_adding_scripts() { wp_register_script('my_amazing_script2', get_template_directory_uri() . '/assets/js/jquery341.js', true); wp_register_script('my_amazing_script', get_template_directory_uri() . '/assets/js/signupprocess.js', true); wp_enqueue_script('my_amazing_script2'); wp_enqueue_script('my_amazing_script'); } add_action( 'wp_enqueue_scripts', 'wpb_adding_scripts' ); // custom shortcode //SHORT-CODE-FUNCTION // shortcode function shortcode_hlight($atts, $content = null){ return '' . do_shortcode($content) . '
' . '' . do_shortcode($content) . '
' .'