/** * Define the Media/Assistant submenu screen to the Admin Columns plugin * * @since 2.22 * * @param array $storage_models List of storage model class instances ( [key] => [CPAC_Storage_Model object] ) * @param object $cpac CPAC, the root CodePress Admin Columns object */ public static function admin_columns_support($storage_models, $cpac) { require_once MLA_PLUGIN_PATH . 'includes/class-mla-admin-columns-support.php'; MLACore::$admin_columns_storage_model = new CPAC_Storage_Model_MLA(); /* * Put MLA before/after WP Media Library so is_columns_screen() will work */ $new_models = array(); foreach ($storage_models as $key => $model) { if ('wp-media' == $key) { if (version_compare(CPAC_VERSION, '2.4.9', '>=')) { $new_models[$key] = $model; $new_models[MLACore::$admin_columns_storage_model->key] = MLACore::$admin_columns_storage_model; } else { $new_models[MLACore::$admin_columns_storage_model->key] = MLACore::$admin_columns_storage_model; $new_models[$key] = $model; } } else { $new_models[$key] = $model; } } /* * If we didn't find wp-media, add our entry to the end */ if (count($storage_models) == count($new_models)) { $new_models[$storage_model->key] = MLACore::$admin_columns_storage_model; } return $new_models; }