Source Code Documentation


s2member\includes\classes\user-new.inc.php


  1. <?php
  2. /**
  3. * New User handlers.
  4. *
  5. * Copyright: © 2009-2011
  6. * {@link http://www.websharks-inc.com/ WebSharks, Inc.}
  7. * (coded in the USA)
  8. *
  9. * Released under the terms of the GNU General Public License.
  10. * You should have received a copy of the GNU General Public License,
  11. * along with this software. In the main directory, see: /licensing/
  12. * If not, see: {@link http://www.gnu.org/licenses/}.
  13. *
  14. * @package s2Member\New_Users
  15. * @since 3.5
  16. */
  17. if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
  18. exit ("Do not access this file directly.");
  19.  
  20. if (!class_exists ("c_ws_plugin__s2member_user_new"))
  21. {
  22. /**
  23. * New User handlers.
  24. *
  25. * @package s2Member\New_Users
  26. * @since 3.5
  27. */
  28. class c_ws_plugin__s2member_user_new
  29. {
  30. /**
  31. * Adds Custom Fields to `/wp-admin/user-new.php`.
  32. *
  33. * We have to buffer because `/user-new.php` has NO Hooks.
  34. *
  35. * @package s2Member\New_Users
  36. * @since 3.5
  37. *
  38. * @attaches-to ``add_action("load-user-new.php");``
  39. *
  40. * @return null
  41. */
  42. public static function admin_user_new_fields ()
  43. {
  44. global $pagenow; // The current admin page file name.
  45.  
  46. do_action ("ws_plugin__s2member_before_admin_user_new_fields", get_defined_vars ());
  47.  
  48. if (is_blog_admin () && $pagenow === "user-new.php" && current_user_can ("create_users"))
  49. {
  50. ob_start ("c_ws_plugin__s2member_user_new_in::_admin_user_new_fields");
  51.  
  52. do_action ("ws_plugin__s2member_during_admin_user_new_fields", get_defined_vars ());
  53. }
  54.  
  55. do_action ("ws_plugin__s2member_after_admin_user_new_fields", get_defined_vars ());
  56.  
  57. return /* Return for uniformity. */;
  58. }
  59. }
  60. }
  61. ?>

s2member\includes\classes\user-new.inc.php

Source Code Documentation