label */ public static function editable() { $out = array(); $types = get_post_types( array(), 'objects' ); foreach ( $types as $slug => $obj ) { if ( in_array( $slug, self::$never, true ) ) { continue; } if ( str_starts_with( $slug, 'e_' ) || str_starts_with( $slug, 'elementor' ) ) { continue; } // Show public types + shop types + any type with UI. $is_candidate = ( ! empty( $obj->public ) || ! empty( $obj->show_ui ) ); if ( ! $is_candidate ) { continue; } if ( 'product_variation' === $slug ) { continue; // Variations are edited inside the product row expansion, not as a sheet. } $out[ $slug ] = $obj->labels->singular_name ? $obj->labels->singular_name . ' (' . $slug . ')' : $slug; } // Most useful first. $order = array( 'product', 'post', 'page', 'shop_order', 'shop_coupon' ); uksort( $out, function ( $a, $b ) use ( $order ) { $pa = array_search( $a, $order, true ); $pb = array_search( $b, $order, true ); $pa = false === $pa ? 99 : $pa; $pb = false === $pb ? 99 : $pb; if ( $pa === $pb ) { return strcmp( $a, $b ); } return $pa < $pb ? -1 : 1; } ); return $out; } }