@@ 126-143 (lines=18) @@ | ||
123 | * @since 2.2.2 |
|
124 | * @return string Page object type name. |
|
125 | */ |
|
126 | public function current_object_type() { |
|
127 | global $pagenow; |
|
128 | $type = 'post'; |
|
129 | ||
130 | if ( in_array( $pagenow, array( 'user-edit.php', 'profile.php', 'user-new.php' ), true ) ) { |
|
131 | $type = 'user'; |
|
132 | } |
|
133 | ||
134 | if ( in_array( $pagenow, array( 'edit-comments.php', 'comment.php' ), true ) ) { |
|
135 | $type = 'comment'; |
|
136 | } |
|
137 | ||
138 | if ( in_array( $pagenow, array( 'edit-tags.php', 'term.php' ), true ) ) { |
|
139 | $type = 'term'; |
|
140 | } |
|
141 | ||
142 | return $type; |
|
143 | } |
|
144 | ||
145 | /** |
|
146 | * Set object property. |
@@ 940-957 (lines=18) @@ | ||
937 | * @since 2.2.2 |
|
938 | * @return string Page object type name. |
|
939 | */ |
|
940 | public function current_object_type() { |
|
941 | global $pagenow; |
|
942 | $type = 'post'; |
|
943 | ||
944 | if ( in_array( $pagenow, array( 'user-edit.php', 'profile.php', 'user-new.php' ), true ) ) { |
|
945 | $type = 'user'; |
|
946 | } |
|
947 | ||
948 | if ( in_array( $pagenow, array( 'edit-comments.php', 'comment.php' ), true ) ) { |
|
949 | $type = 'comment'; |
|
950 | } |
|
951 | ||
952 | if ( in_array( $pagenow, array( 'edit-tags.php', 'term.php' ), true ) ) { |
|
953 | $type = 'term'; |
|
954 | } |
|
955 | ||
956 | return $type; |
|
957 | } |
|
958 | ||
959 | /** |
|
960 | * Set metabox property. |