| @@ 868-885 (lines=18) @@ | ||
| 865 | * @since 2.2.2 |
|
| 866 | * @return string Page object type name. |
|
| 867 | */ |
|
| 868 | public function current_object_type() { |
|
| 869 | global $pagenow; |
|
| 870 | $type = 'post'; |
|
| 871 | ||
| 872 | if ( in_array( $pagenow, array( 'user-edit.php', 'profile.php', 'user-new.php' ), true ) ) { |
|
| 873 | $type = 'user'; |
|
| 874 | } |
|
| 875 | ||
| 876 | if ( in_array( $pagenow, array( 'edit-comments.php', 'comment.php' ), true ) ) { |
|
| 877 | $type = 'comment'; |
|
| 878 | } |
|
| 879 | ||
| 880 | if ( in_array( $pagenow, array( 'edit-tags.php', 'term.php' ), true ) ) { |
|
| 881 | $type = 'term'; |
|
| 882 | } |
|
| 883 | ||
| 884 | return $type; |
|
| 885 | } |
|
| 886 | ||
| 887 | /** |
|
| 888 | * Set metabox property. |
|
| @@ 116-133 (lines=18) @@ | ||
| 113 | * @since 2.2.2 |
|
| 114 | * @return string Page object type name. |
|
| 115 | */ |
|
| 116 | public function current_object_type() { |
|
| 117 | global $pagenow; |
|
| 118 | $type = 'post'; |
|
| 119 | ||
| 120 | if ( in_array( $pagenow, array( 'user-edit.php', 'profile.php', 'user-new.php' ), true ) ) { |
|
| 121 | $type = 'user'; |
|
| 122 | } |
|
| 123 | ||
| 124 | if ( in_array( $pagenow, array( 'edit-comments.php', 'comment.php' ), true ) ) { |
|
| 125 | $type = 'comment'; |
|
| 126 | } |
|
| 127 | ||
| 128 | if ( in_array( $pagenow, array( 'edit-tags.php', 'term.php' ), true ) ) { |
|
| 129 | $type = 'term'; |
|
| 130 | } |
|
| 131 | ||
| 132 | return $type; |
|
| 133 | } |
|
| 134 | ||
| 135 | /** |
|
| 136 | * Set object property. |
|