Media: Fix broken media modal following [57688]

Fix undefined TypeError overlooked in [57688].

Props antpb, swissspidy, joedolson.
Fixes #58973.
Built from https://develop.svn.wordpress.org/trunk@57691


git-svn-id: http://core.svn.wordpress.org/trunk@57192 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
joedolson 2024-02-21 20:57:12 +00:00
parent 83ba8ad091
commit f95f3e8334
3 changed files with 10 additions and 6 deletions

View File

@ -2282,12 +2282,16 @@ var State = Backbone.Model.extend(/** @lends wp.media.controller.State.prototype
_menu: function() {
var menu = this.frame.menu,
mode = this.get('menu'),
actionMenuItems = this.frame.menu.get('views'),
actionMenuLength = actionMenuItems ? actionMenuItems.views.get().length : 0,
actionMenuItems,
actionMenuLength,
view;
// Show action menu only if it is active and has more than one default element.
this.frame.$el.toggleClass( 'hide-menu', ! mode || actionMenuLength < 2 );
if ( this.frame.menu ) {
actionMenuItems = this.frame.menu.get('views'),
actionMenuLength = actionMenuItems ? actionMenuItems.views.get().length : 0,
// Show action menu only if it is active and has more than one default element.
this.frame.$el.toggleClass( 'hide-menu', ! mode || actionMenuLength < 2 );
}
if ( ! mode ) {
return;
}

File diff suppressed because one or more lines are too long

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.5-beta2-57690';
$wp_version = '6.5-beta2-57691';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.