<?php

namespace MatthiasWeb\RealMediaLibrary\lite;

use MatthiasWeb\RealMediaLibrary\Vendor\DevOwl\Freemium\CorePro;
use MatthiasWeb\RealMediaLibrary\lite\folder\Collection;
use MatthiasWeb\RealMediaLibrary\lite\folder\Creatable;
use MatthiasWeb\RealMediaLibrary\lite\folder\Gallery;
use MatthiasWeb\RealMediaLibrary\lite\order\Sortable;
// @codeCoverageIgnoreStart
\defined('ABSPATH') or die('No script kiddies please!');
// Avoid direct file request
// @codeCoverageIgnoreEnd
trait Core {
    use CorePro;
    /**
     * Updater instance.
     *
     * @see https://github.com/Capevace/wordpress-plugin-updater
     */
    private $updater;
    // Documented in IOverrideCore
    public function overrideConstruct() {
        wp_rml_register_creatable(\MatthiasWeb\RealMediaLibrary\lite\folder\Collection::class, RML_TYPE_COLLECTION);
        wp_rml_register_creatable(\MatthiasWeb\RealMediaLibrary\lite\folder\Gallery::class, RML_TYPE_GALLERY);
    }
    // Documented in IOverrideCore
    public function overrideInit() {
        add_filter(
            'mla_media_modal_query_final_terms',
            [\MatthiasWeb\RealMediaLibrary\lite\order\Sortable::class, 'mla_media_modal_query_final_terms'],
            10,
            2
        );
        add_filter('posts_clauses', [\MatthiasWeb\RealMediaLibrary\lite\order\Sortable::class, 'posts_clauses'], 10, 2);
        add_action(
            'RML/Item/MoveFinished',
            [\MatthiasWeb\RealMediaLibrary\lite\order\Sortable::class, 'item_move_finished'],
            1,
            4
        );
        add_action(
            'deleted_realmedialibrary_meta',
            [\MatthiasWeb\RealMediaLibrary\lite\folder\Creatable::class, 'deleted_realmedialibrary_meta'],
            10,
            3
        );
    }
}
