Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * The plugin bootstrap file
- *
- * This file is read by WordPress to generate the plugin information in the plugin
- * admin area. This file also includes all of the dependencies used by the plugin,
- * registers the activation and deactivation functions, and defines a function
- * that starts the plugin.
- *
- * @link collinslenjo.co.nf
- * @since 1.0.0
- * @package My_Sms
- *
- * @wordpress-plugin
- * Plugin Name: Wp-New-SMS
- * Plugin URI: collinslenjo.co.nf/plugins/sms
- * Description: This is plugin helps you communicate to your clients through an SMS when they register to your website.
- * Version: 1.0.0
- * Author: Collins Lenjo
- * Author URI: collinslenjo.co.nf
- * License: GPL-2.0+
- * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
- * Text Domain: my-sms
- * Domain Path: /languages
- */
- // If this file is called directly, abort.
- if ( ! defined( 'WPINC' ) ) {
- die;
- }
- /**
- * The code that runs during plugin activation.
- * This action is documented in includes/class-my-sms-activator.php
- */
- function activate_my_sms() {
- require_once plugin_dir_path( __FILE__ ) . 'includes/class-my-sms-activator.php';
- My_Sms_Activator::activate();
- }
- /*
- *This is where i have decided to put my form that will display in the front end.
- *It will be executed by a shortcode.
- *Lets go.
- */
- function register_form(){
- ?>
- <?php
- include 'admin/partials/registerApi.php';
- ?>
- <form action=" . $_SERVER['PHP_SELF'] . " method="POST">
- Username: <br> <input type="text" name="name"> <br/><br/>
- Email: <br/> <input type="text" name="email"> <br/><br/>
- Phone No.: <br/> <input type="number" name="number" placeholder=" eg; +254..."> <br/><br/>
- Password: <br/> <input type="password" name="password"> <br/><br/>
- <input type="submit" value="Register">
- </form>
- <?php
- }
- add_shortcode('form', 'register_form');
- /**
- * The code that runs during plugin deactivation.
- * This action is documented in includes/class-my-sms-deactivator.php
- */
- function deactivate_my_sms() {
- require_once plugin_dir_path( __FILE__ ) . 'includes/class-my-sms-deactivator.php';
- My_Sms_Deactivator::deactivate();
- }
- register_activation_hook( __FILE__, 'activate_my_sms' );
- register_deactivation_hook( __FILE__, 'deactivate_my_sms' );
- /**
- * The core plugin class that is used to define internationalization,
- * admin-specific hooks, and public-facing site hooks.
- */
- require plugin_dir_path( __FILE__ ) . 'includes/class-my-sms.php';
- /**
- * Begins execution of the plugin.
- *
- * Since everything within the plugin is registered via hooks,
- * then kicking off the plugin from this point in the file does
- * not affect the page life cycle.
- *
- * @since 1.0.0
- */
- function run_my_sms() {
- $plugin = new My_Sms();
- $plugin->run();
- }
- run_my_sms();
Advertisement
Add Comment
Please, Sign In to add comment