| Server IP : 146.59.209.152 / Your IP : 216.73.216.46 Web Server : Apache System : Linux webm005.cluster131.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64 User : infrafs ( 43850) PHP Version : 8.2.29 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/infrafs/www/wp-content/plugins/eltd-core/ |
Upload File : |
<?php
/*
Plugin Name: Elated CPT
Description: Plugin that adds all post types needed by our theme
Author: Elated Themes
Version: 1.2.4
*/
require_once 'load.php';
add_action( 'after_setup_theme', array( ElatedCore\CPT\PostTypesRegister::getInstance(), 'register' ) );
if ( ! function_exists( 'eltd_core_activation' ) ) {
/**
* Triggers when plugin is activated. It calls flush_rewrite_rules
* and defines trackstore_elated_core_on_activate action
*/
function eltd_core_activation() {
do_action( 'trackstore_elated_core_on_activate' );
ElatedCore\CPT\PostTypesRegister::getInstance()->register();
flush_rewrite_rules();
}
register_activation_hook( __FILE__, 'eltd_core_activation' );
}
if ( ! function_exists( 'eltd_core_text_domain' ) ) {
/**
* Loads plugin text domain so it can be used in translation
*/
function eltd_core_text_domain() {
load_plugin_textdomain( 'eltd-core', false, ELATED_CORE_REL_PATH . '/languages' );
}
add_action( 'plugins_loaded', 'eltd_core_text_domain' );
}
if ( ! function_exists( 'eltd_core_version_class' ) ) {
/**
* Adds plugins version class to body
*
* @param $classes
*
* @return array
*/
function eltd_core_version_class( $classes ) {
$classes[] = 'eltd-core-' . ELATED_CORE_VERSION;
return $classes;
}
add_filter( 'body_class', 'eltd_core_version_class' );
}
if ( ! function_exists( 'eltd_core_theme_installed' ) ) {
/**
* Checks whether theme is installed or not
* @return bool
*/
function eltd_core_theme_installed() {
return defined( 'ELATED_ROOT' );
}
}
if ( ! function_exists( 'eltd_core_is_woocommerce_installed' ) ) {
/**
* Function that checks if woocommerce is installed
* @return bool
*/
function eltd_core_is_woocommerce_installed() {
return function_exists( 'is_woocommerce' );
}
}
if ( ! function_exists( 'eltd_core_is_woocommerce_integration_installed' ) ) {
//is Elated Woocommerce Integration installed?
function eltd_core_is_woocommerce_integration_installed() {
return defined( 'ELATED_WOOCOMMERCE_CHECKOUT_INTEGRATION' );
}
}
if ( ! function_exists( 'eltd_core_is_revolution_slider_installed' ) ) {
function eltd_core_is_revolution_slider_installed() {
return class_exists( 'RevSliderFront' );
}
}
if ( ! function_exists( 'eltd_core_theme_menu' ) ) {
/**
* Function that generates admin menu for options page.
* It generates one admin page per options page.
*/
function eltd_core_theme_menu() {
if ( eltd_core_theme_installed() ) {
global $trackstore_elated_Framework;
trackstore_elated_init_theme_options();
$page_hook_suffix = add_menu_page(
esc_html__( 'Elated Options', 'eltd-core' ), // The value used to populate the browser's title bar when the menu page is active
esc_html__( 'Elated Options', 'eltd-core' ), // The text of the menu in the administrator's sidebar
'administrator', // What roles are able to access the menu
'trackstore_elated_theme_menu', // The ID used to bind submenu items to this menu
array( $trackstore_elated_Framework->getSkin(), 'renderOptions' ), // The callback function used to render this menu
$trackstore_elated_Framework->getSkin()->getSkinURI() . '/assets/img/admin-logo-icon.png', // Icon For menu Item
100 // Position
);
foreach ( $trackstore_elated_Framework->eltdOptions->adminPages as $key => $value ) {
$slug = "";
if ( ! empty( $value->slug ) ) {
$slug = "_tab" . $value->slug;
}
$subpage_hook_suffix = add_submenu_page(
'trackstore_elated_theme_menu',
esc_html__( 'Elated Options - ', 'eltd-core' ) . $value->title, // The value used to populate the browser's title bar when the menu page is active
$value->title, // The text of the menu in the administrator's sidebar
'administrator', // What roles are able to access the menu
'trackstore_elated_theme_menu' . $slug, // The ID used to bind submenu items to this menu
array( $trackstore_elated_Framework->getSkin(), 'renderOptions' )
);
add_action( 'admin_print_scripts-' . $subpage_hook_suffix, 'trackstore_elated_enqueue_admin_scripts' );
add_action( 'admin_print_styles-' . $subpage_hook_suffix, 'trackstore_elated_enqueue_admin_styles' );
};
add_action( 'admin_print_scripts-' . $page_hook_suffix, 'trackstore_elated_enqueue_admin_scripts' );
add_action( 'admin_print_styles-' . $page_hook_suffix, 'trackstore_elated_enqueue_admin_styles' );
}
}
add_action( 'admin_menu', 'eltd_core_theme_menu' );
}
if ( ! function_exists( 'eltd_core_theme_menu_backup_options' ) ) {
/**
* Function that generates admin menu for options page.
* It generates one admin page per options page.
*/
function eltd_core_theme_menu_backup_options() {
if ( eltd_core_theme_installed() ) {
global $trackstore_elated_Framework;
$slug = "_backup_options";
$page_hook_suffix = add_submenu_page(
'trackstore_elated_theme_menu',
esc_html__( 'Elated Options - Backup Options', 'eltd-core' ), // The value used to populate the browser's title bar when the menu page is active
esc_html__( 'Backup Options', 'eltd-core' ), // The text of the menu in the administrator's sidebar
'administrator', // What roles are able to access the menu
'trackstore_elated_theme_menu' . $slug, // The ID used to bind submenu items to this menu
array( $trackstore_elated_Framework->getSkin(), 'renderBackupOptions' )
);
add_action( 'admin_print_scripts-' . $page_hook_suffix, 'trackstore_elated_enqueue_admin_scripts' );
add_action( 'admin_print_styles-' . $page_hook_suffix, 'trackstore_elated_enqueue_admin_styles' );
}
}
add_action( 'admin_menu', 'eltd_core_theme_menu_backup_options' );
}
if ( ! function_exists( 'eltd_core_theme_admin_bar_menu_options' ) ) {
/**
* Add a link to the WP Toolbar
*/
function eltd_core_theme_admin_bar_menu_options( $wp_admin_bar ) {
$args = array(
'id' => 'trackstore-admin-bar-options',
'title' => esc_html__( 'Elated Options', 'eltd-core' ),
'href' => admin_url('admin.php/?page=trackstore_elated_theme_menu')
);
$wp_admin_bar->add_node( $args );
}
add_action( 'admin_bar_menu', 'eltd_core_theme_admin_bar_menu_options', 999 );
}