-
Notifications
You must be signed in to change notification settings - Fork 0
/
ttg-core.php
116 lines (104 loc) · 2.93 KB
/
ttg-core.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
<?php
/*
Plugin Name: Theme Core Plugin
Plugin URI: http://www.qantumthemes.com/
Description: Adds custom type and custom fields capabilities and extends customizer capabilities. Containes Metaboxes and Kirki cutom versions for Themes2Go
Author: qantumthemes
Version: 1.2.8
Text Domain: ttg-core
Domain Path: /languages
*/
/**
*
* For theme to check if is active
*
*/
if(!function_exists('ttg_core_active')){
function ttg_core_active() {
return true;
}
}
/**
*
* The plugin textdomain
*
*/
if(!function_exists('ttg_extensions_load_plugin_textdomain')){
function ttg_extensions_load_plugin_textdomain() {
load_plugin_textdomain( 'ttg-core', FALSE, basename( dirname( __FILE__ ) ) . '/languages' );
}}
add_action( 'plugins_loaded', 'ttg_extensions_load_plugin_textdomain' );
/**
*
* Metaboxes component
*
*/
if(!function_exists('custom_meta_box_field')){
require plugin_dir_path( __FILE__ ) . '/inc/backend/metaboxes/meta_box.php';
}
/**
* Kirki Framework Files Inclusion
* Customizer component
* Documentation: https://github.com/aristath/kirki/wiki
* Attention: this is a custom version with many fixes
*/
if ( ! function_exists( 'Kirki' ) ) {
require plugin_dir_path( __FILE__ ) . '/inc/backend/kirki/kirki.php';
require plugin_dir_path( __FILE__ ) . '/inc/backend/kirki-config-class/class-kirki2-kirki.php';
require plugin_dir_path( __FILE__ ) . '/inc/backend/kirki-config-class/include-kirki.php';
}
/**
*
* Metaboxes component
*
*/
if(!function_exists('qantumthemes_modify_contact_methods')){
require plugin_dir_path( __FILE__ ) . '/inc/backend/author/author-meta.php';
}
/**
*
* Custom types component
*
*/
if ( ! function_exists( 'ttg_custom_post_type' ) ) {
require plugin_dir_path( __FILE__ ) . '/inc/backend/posttypes/posttypes.php';
}
/**
*
* Custom shortcodes component
*
*/
if ( ! function_exists( 'ttg_custom_shortcode' ) ) {
require plugin_dir_path( __FILE__ ) . '/inc/frontend/shortcode-wrapper/shortcode-wrapper.php';
}
/*
* Scripts and styles Backend
*
*/
if(!function_exists("ttg_extensionsuite_loader_backend")){
function ttg_extensionsuite_loader_backend(){
wp_enqueue_style( 'qtExtensionSuiteStyle',plugins_url( '/assets/style.admin.css' , __FILE__ ),false);
}}
add_action("admin_enqueue_scripts",'ttg_extensionsuite_loader_backend');
/*
*
* We add some columns with featured images in the post archive so is easier
*
*/
if (function_exists( 'add_theme_support' )){
add_filter('manage_posts_columns', 'ttg_posts_columns', 5);
add_action('manage_posts_custom_column', 'ttg_posts_custom_columns', 5, 2);
}
function ttg_posts_columns($defaults){
$defaults['wps_post_thumbs'] = __('Thumbs',"ttg-core");
$defaults['wps_post_id'] = __('Post ID',"ttg-core");
return $defaults;
}
function ttg_posts_custom_columns($column_name, $id){
if($column_name === 'wps_post_thumbs'){
echo the_post_thumbnail( "thumbnail" );
}
if($column_name === 'wps_post_id'){
echo get_the_ID();
}
}