Changeset 12776
- Timestamp:
- 08/01/2023 10:18:53 PM (16 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/photo-directory/inc/admin.php
r12772 r12776 70 70 add_action( 'edit_form_top', [ __CLASS__, 'show_moderation_message' ] ); 71 71 add_filter( 'redirect_post_location', [ __CLASS__, 'redirect_to_next_post_after_moderation' ], 5, 2 ); 72 73 // Add class(es) to body tag. 74 add_filter( 'admin_body_class', [ __CLASS__, 'add_body_class' ] ); 72 75 } 73 76 … … 1249 1252 } 1250 1253 1254 /** 1255 * Amends body tag with additional classes. 1256 * 1257 * @param string $classes Body classes. 1258 * @return string 1259 */ 1260 public static function add_body_class( $classes ) { 1261 $post_type = Registrations::get_post_type(); 1262 if ( 1263 // Post listing of photos. 1264 filter_input(INPUT_GET, 'post_type') === $post_type 1265 || 1266 // Editing a photo post. 1267 ( ( $post_id = filter_input(INPUT_GET, 'post', FILTER_SANITIZE_NUMBER_INT) ) && get_post_type( $post_id ) === $post_type ) 1268 ) { 1269 $classes .= ' post-type-photo'; 1270 } 1271 1272 return $classes; 1273 } 1274 1251 1275 } 1252 1276
Note: See TracChangeset
for help on using the changeset viewer.