ClassicPress 2.1.0 Release Notes

The problem here is that there are so many scripts being run here, that it seems if we upset one then the rest malfunctions. So, rather than attempt to get the scripts running in the correct order by manually specifying what depends on what, I think the best approach is to have Bricks simply reset the scripts to the order it’s expecting.

In order to do that, please revert that line to what it was before. Then, just above it, you’ll see a heading:

/**
 * Scripts
 */

Immediately under that, try adding this:

		global $wp_scripts;
		$deps = $wp_scripts->registered['media-views']->deps;
		foreach ( $deps as $key => $dep ) {
			if ( $dep === 'sortable-js' ) {
				unset( $deps[$key] );
				$deps[$key] = 'jquery-ui-sortable';
				ksort( $deps );
				$wp_scripts->registered['media-views']->deps = $deps;
				break;
			}
		}

Again, this won’t upset anything if Bricks is run on WP because the condition won’t be fulfilled there, so the code won’t do anything.

1 Like