| 1 |
<?php |
| 2 |
// @codingStandardsIgnoreFile |
| 3 |
/** |
| 4 |
* Administrative Meta Boxes. |
| 5 |
* |
| 6 |
* Copyright: © 2009-2011 |
| 7 |
* {@link http://websharks-inc.com/ WebSharks, Inc.} |
| 8 |
* (coded in the USA) |
| 9 |
* |
| 10 |
* Released under the terms of the GNU General Public License. |
| 11 |
* You should have received a copy of the GNU General Public License, |
| 12 |
* along with this software. In the main directory, see: /licensing/ |
| 13 |
* If not, see: {@link http://www.gnu.org/licenses/}. |
| 14 |
* |
| 15 |
* @package s2Member\Meta_Boxes |
| 16 |
* @since 3.5 |
| 17 |
*/ |
| 18 |
if(!defined('WPINC')) // MUST have WordPress. |
| 19 |
exit ("Do not access this file directly."); |
| 20 |
|
| 21 |
if (!class_exists ("c_ws_plugin__s2member_meta_boxes")) |
| 22 |
{ |
| 23 |
/** |
| 24 |
* Administrative Meta Boxes. |
| 25 |
* |
| 26 |
* @package s2Member\Meta_Boxes |
| 27 |
* @since 3.5 |
| 28 |
*/ |
| 29 |
class c_ws_plugin__s2member_meta_boxes |
| 30 |
{ |
| 31 |
/** |
| 32 |
* Adds meta boxes to Post/Page editing stations. |
| 33 |
* |
| 34 |
* Note: WordPress also calls this Hook with ``$type`` set to: `link` and `comment`. Possibly others. |
| 35 |
* Thus, the need for: ``in_array($type, array_keys (get_post_types ()))``. |
| 36 |
* |
| 37 |
* @package s2Member\Meta_Boxes |
| 38 |
* @since 3.5 |
| 39 |
* |
| 40 |
* @attaches-to ``add_action("add_meta_boxes");`` |
| 41 |
* |
| 42 |
* @param string $type String indicating type of Post, or another classification *( i.e., `nav_menu_item` )*. |
| 43 |
* @return null |
| 44 |
*/ |
| 45 |
public static function add_meta_boxes ($type = FALSE) |
| 46 |
{ |
| 47 |
do_action("ws_plugin__s2member_before_add_meta_boxes", get_defined_vars ()); |
| 48 |
|
| 49 |
$excluded_types = array("link", "comment", "revision", "attachment", "nav_menu_item", "snippet", "redirect"); |
| 50 |
$excluded_types = apply_filters("ws_plugin__s2member_add_meta_boxes_excluded_types", $excluded_types, get_defined_vars ()); |
| 51 |
|
| 52 |
if (in_array($type, array_keys (get_post_types ())) && !in_array($type, $excluded_types)) |
| 53 |
add_meta_box ("ws-plugin--s2member-security", "s2Member™", "c_ws_plugin__s2member_meta_box_security::security_meta_box", $type, "side", "high"); |
| 54 |
|
| 55 |
do_action("ws_plugin__s2member_after_add_meta_boxes", get_defined_vars ()); |
| 56 |
|
| 57 |
return /* Return for uniformity. */; |
| 58 |
} |
| 59 |
} |
| 60 |
} |
| 61 |
|