-
Notifications
You must be signed in to change notification settings - Fork 1
/
custom-url-to-featured-image.php
118 lines (103 loc) · 2.77 KB
/
custom-url-to-featured-image.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?php
/*
Plugin Name: Add Featured Image Custom Link
Plugin URI: https://viitorcloud.com/blog/
Description: Featured Image Custom Link plugin is useful to add custom link to featured image of single post/page/custom post type which automatically links to image in front.
Version: 1.1.0
Author: Viitorcloud
Author URI:https://viitorcloud.com/
Text Domain: custom-url-to-featured-image
*/
/**
* Basic plugin definitions
*
* @package Custom Url to Featured Image
* @since 1.1.0
*/
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;
global $wpdb;
if( !defined( 'CUST_LI_FI_DIR' ) ) {
define( 'CUST_LI_FI_DIR', dirname( __FILE__ ) ); // plugin dir
}
if( !defined( 'CUST_LI_FI_URL' ) ) {
define( 'CUST_LI_FI_URL', plugin_dir_url( __FILE__ ) ); // plugin url
}
if( !defined( 'CUST_LI_FI_DOMAIN' )) {
define( 'CUST_LI_FI_DOMAIN', 'cust_li_fi' ); // text domain for languages
}
if( !defined( 'CUST_LI_FI_PLUGIN_URL' ) ) {
define( 'CUST_LI_FI_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); // plugin url
}
if( !defined( 'CUST_LI_FI_ADMIN_DIR' ) ) {
define( 'CUST_LI_FI_ADMIN_DIR', CUST_LI_FI_DIR . '//admin' ); // plugin admin dir
}
if( !defined( 'CUST_LI_FI_BASENAME') ) {
define( 'CUST_LI_FI_BASENAME', 'cust-li-fi' );
}
//subtitle prefix
if( !defined( 'CUST_LI_FI_META_PREFIX' )) {
define( 'CUST_LI_FI_META_PREFIX', '_cust_li_fi_' );
}
/**
* Load Text Domain
*
* This gets the plugin ready for translation.
*
* @package Custom Url to Featured Image
* @since 1.1.0
*/
//load_plugin_textdomain( 'cust_li_fi', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
load_plugin_textdomain( 'custom-url-to-featured-image', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
/**
* Activation hook
*
* Register plugin activation hook.
*
* @package Custom Url to Featured Image
* @since 1.1.0
*/
register_activation_hook( __FILE__, 'cust_li_fi_install' );
/**
* Deactivation hook
*
* Register plugin deactivation hook.
*
* @package Custom Url to Featured Image
* @since 1.1.0
*/
register_deactivation_hook( __FILE__, 'cust_li_fi_uninstall' );
/**
* Plugin Setup Activation hook call back
*
* Initial setup of the plugin setting default options
* and database tables creations.
*
* @package Custom Url to Featured Image
* @since 1.1.0
*/
function cust_li_fi_install() {
global $wpdb;
}
/**
* Plugin Setup (On Deactivation)
*
* Does the drop tables in the database and
* delete plugin options.
*
* @package Custom Url to Featured Image
* @since 1.1.0
*/
function cust_li_fi_uninstall() {
global $wpdb;
}
/**
* Includes
*
* Includes all the needed files for our plugin
*
* @package Custom Url to Featured Image
* @since 1.1.0
*/
//includes model class file
require_once ( CUST_LI_FI_ADMIN_DIR . '/class-cust-li-fi-admin.php');