Guest User

Untitled

a guest
Sep 19th, 2016
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.80 KB | None | 0 0
  1. <?php
  2. /**
  3. * The plugin bootstrap file
  4. *
  5. * This file is read by WordPress to generate the plugin information in the plugin
  6. * admin area. This file also includes all of the dependencies used by the plugin,
  7. * registers the activation and deactivation functions, and defines a function
  8. * that starts the plugin.
  9. *
  10. * @link collinslenjo.co.nf
  11. * @since 1.0.0
  12. * @package My_Sms
  13. *
  14. * @wordpress-plugin
  15. * Plugin Name: Wp-New-SMS
  16. * Plugin URI: collinslenjo.co.nf/plugins/sms
  17. * Description: This is plugin helps you communicate to your clients through an SMS when they register to your website.
  18. * Version: 1.0.0
  19. * Author: Collins Lenjo
  20. * Author URI: collinslenjo.co.nf
  21. * License: GPL-2.0+
  22. * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
  23. * Text Domain: my-sms
  24. * Domain Path: /languages
  25. */
  26.  
  27. // If this file is called directly, abort.
  28. if ( ! defined( 'WPINC' ) ) {
  29. die;
  30. }
  31.  
  32. /**
  33. * The code that runs during plugin activation.
  34. * This action is documented in includes/class-my-sms-activator.php
  35. */
  36. function activate_my_sms() {
  37. require_once plugin_dir_path( __FILE__ ) . 'includes/class-my-sms-activator.php';
  38. My_Sms_Activator::activate();
  39. }
  40.  
  41.  
  42.  
  43. /*
  44. *This is where i have decided to put my form that will display in the front end.
  45. *It will be executed by a shortcode.
  46. *Lets go.
  47. */
  48.  
  49. function register_form(){
  50.  
  51. ?>
  52.  
  53. <?php
  54. include 'admin/partials/registerApi.php';
  55. ?>
  56.  
  57. <form action=" . $_SERVER['PHP_SELF'] . " method="POST">
  58. Username: <br> <input type="text" name="name"> <br/><br/>
  59. Email: <br/> <input type="text" name="email"> <br/><br/>
  60. Phone No.: <br/> <input type="number" name="number" placeholder=" eg; +254..."> <br/><br/>
  61. Password: <br/> <input type="password" name="password"> <br/><br/>
  62. <input type="submit" value="Register">
  63.  
  64. </form>
  65.  
  66. <?php
  67. }
  68. add_shortcode('form', 'register_form');
  69.  
  70.  
  71.  
  72.  
  73.  
  74. /**
  75. * The code that runs during plugin deactivation.
  76. * This action is documented in includes/class-my-sms-deactivator.php
  77. */
  78. function deactivate_my_sms() {
  79. require_once plugin_dir_path( __FILE__ ) . 'includes/class-my-sms-deactivator.php';
  80. My_Sms_Deactivator::deactivate();
  81. }
  82.  
  83. register_activation_hook( __FILE__, 'activate_my_sms' );
  84. register_deactivation_hook( __FILE__, 'deactivate_my_sms' );
  85.  
  86. /**
  87. * The core plugin class that is used to define internationalization,
  88. * admin-specific hooks, and public-facing site hooks.
  89. */
  90. require plugin_dir_path( __FILE__ ) . 'includes/class-my-sms.php';
  91.  
  92. /**
  93. * Begins execution of the plugin.
  94. *
  95. * Since everything within the plugin is registered via hooks,
  96. * then kicking off the plugin from this point in the file does
  97. * not affect the page life cycle.
  98. *
  99. * @since 1.0.0
  100. */
  101. function run_my_sms() {
  102.  
  103. $plugin = new My_Sms();
  104. $plugin->run();
  105.  
  106. }
  107. run_my_sms();
Advertisement
Add Comment
Please, Sign In to add comment