Source Code Documentation


s2member\includes\classes\meta-boxes.inc.php


  1. <?php
  2. /**
  3. * Administrative Meta Boxes.
  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\Meta_Boxes
  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_meta_boxes"))
  21. {
  22. /**
  23. * Administrative Meta Boxes.
  24. *
  25. * @package s2Member\Meta_Boxes
  26. * @since 3.5
  27. */
  28. class c_ws_plugin__s2member_meta_boxes
  29. {
  30. /**
  31. * Adds meta boxes to Post/Page editing stations.
  32. *
  33. * Note: WordPress® also calls this Hook with ``$type`` set to: `link` and `comment`. Possibly others.
  34. * Thus, the need for: ``in_array ($type, array_keys (get_post_types ()))``.
  35. *
  36. * @package s2Member\Meta_Boxes
  37. * @since 3.5
  38. *
  39. * @attaches-to ``add_action("add_meta_boxes");``
  40. *
  41. * @param str $type String indicating type of Post, or another classification *( i.e. `nav_menu_item` )*.
  42. * @return null
  43. */
  44. public static function add_meta_boxes ($type = FALSE)
  45. {
  46. do_action ("ws_plugin__s2member_before_add_meta_boxes", get_defined_vars ());
  47.  
  48. $excluded_types = array ("link", "comment", "revision", "attachment", "nav_menu_item");
  49. $excluded_types = apply_filters ("ws_plugin__s2member_add_meta_boxes_excluded_types", $excluded_types, get_defined_vars ());
  50.  
  51. if (in_array ($type, array_keys (get_post_types ())) && !in_array ($type, $excluded_types))
  52. add_meta_box ("ws-plugin--s2member-security", "s2Member®", "c_ws_plugin__s2member_meta_box_security::security_meta_box", $type, "side", "high");
  53.  
  54. do_action ("ws_plugin__s2member_after_add_meta_boxes", get_defined_vars ());
  55.  
  56. return /* Return for uniformity. */;
  57. }
  58. }
  59. }
  60. ?>

s2member\includes\classes\meta-boxes.inc.php

Source Code Documentation