-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathupgrade-for-unattach-re-attach-media-attachments.php
52 lines (46 loc) · 1.4 KB
/
upgrade-for-unattach-re-attach-media-attachments.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
/**
* Plugin Name: Upgrade for Unattach & Re-Attach Media Attachments
* Plugin URI: https://github.com/bahiirwa/Upgrade-for-Unattach-Re-Attach-Media-Attachments/
* Description: Safely unattach and Re-attach images and other attachments from within the media library.
* Version: 1.2.2
* Author: Laurence Bahiirwa
* Author URI: https://omukiguy.com
* Requires at least: 4.9
* Tested up to: 6.0
* Tags: Attachments, Unattach, Re-Attach, Media Library, Upgrade
* Text Domain: lurma
* License: GPL2 or later
*
* @package Lurma
*/
/**
* Basic Security: Exit plugin if accessed directly.
*/
defined( 'ABSPATH' ) || exit;
/**
* Define constants
*/
if ( ! defined( 'LURMA_PLUGIN_DIR' ) ) {
define( 'LURMA_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
}
add_action( 'plugins_loaded', 'lurma_load_plugin_textdomain' );
/**
* Load gettext translate for text domain.
*
* @since 1.2.0
*
* @return void
*/
function lurma_load_plugin_textdomain() {
load_plugin_textdomain( 'lurma' );
}
/**
* The plugin needs to run in two pages that is media and tools.
*/
global $pagenow;
if ( 'upload.php' === $pagenow || 'tools.php' === $pagenow ) {
require_once LURMA_PLUGIN_DIR . '/includes/functions.php';
require_once LURMA_PLUGIN_DIR . '/includes/bulk-functions.php';
require_once LURMA_PLUGIN_DIR . '/includes/manage-columns.php';
}