| @@ 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. |
|
| @@ 896-913 (lines=18) @@ | ||
| 893 | * @since 2.2.2 |
|
| 894 | * @return string Page object type name. |
|
| 895 | */ |
|
| 896 | public function current_object_type() { |
|
| 897 | global $pagenow; |
|
| 898 | $type = 'post'; |
|
| 899 | ||
| 900 | if ( in_array( $pagenow, array( 'user-edit.php', 'profile.php', 'user-new.php' ), true ) ) { |
|
| 901 | $type = 'user'; |
|
| 902 | } |
|
| 903 | ||
| 904 | if ( in_array( $pagenow, array( 'edit-comments.php', 'comment.php' ), true ) ) { |
|
| 905 | $type = 'comment'; |
|
| 906 | } |
|
| 907 | ||
| 908 | if ( in_array( $pagenow, array( 'edit-tags.php', 'term.php' ), true ) ) { |
|
| 909 | $type = 'term'; |
|
| 910 | } |
|
| 911 | ||
| 912 | return $type; |
|
| 913 | } |
|
| 914 | ||
| 915 | /** |
|
| 916 | * Set metabox property. |
|