| Server IP : 130.225.57.55 / Your IP : 216.73.216.60 Web Server : Apache System : Linux wp-vhost07 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6 13:29:34 UTC 2026 x86_64 User : root ( 0) PHP Version : 8.1.2-1ubuntu2.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /srv/www/reco2st.eu/https/wp-content/plugins/mozaik-project-functionality/ |
Upload File : |
<?php
/**
* Class MCF_Core
*
*
*/
class MCF_Core {
/**
* @var array
*/
public $cpts = [ ];
/**
* @var array
*/
public $taxonomies = [ ];
/**
* Register all the action and
* filter hooks for the custom
* functionality plugin
*
*/
public function __construct() {
if ( ! class_exists( 'Mlib_CPT' ) || ! class_exists( 'Mlib_Taxonomy' ) ) {
return;
}
register_activation_hook( __FILE__, array( &$this, 'activate' ) );
register_deactivation_hook( __FILE__, 'flush_rewrite_rules' );
add_action( 'plugins_loaded', array( &$this, 'register_post_types' ), 11 );
add_action( 'plugins_loaded', array( &$this, 'register_taxonomies' ), 11 );
add_action( 'admin_menu', array( &$this, 'register_options_pages' ) );
add_action( 'admin_init', array( &$this, 'register_options_pages' ) );
add_action( 'admin_head', array( &$this, 'admin_styles' ) );
add_filter( 'upload_mimes', array( &$this, 'cc_mime_types' ) );
}
/**
* Do all the necessary things
* on plugin activation
*
*/
public function activate() {
// register the site's
// custom post types
self::register_post_types();
foreach ( $this->cpts as $cpt ) {
/** @var $cpt Mlib_CPT */
$cpt->register_post_type();
}
// and taxonomies
self::register_taxonomies();
foreach ( $this->taxonomies as $taxonomy ) {
/** @var $taxonomy Mlib_Taxonomy */
$taxonomy->register_taxonomy();
}
// register the site's
// options page
self::register_options_pages();
// flush rewrite rules so
// new rewrite rules take
// effect
flush_rewrite_rules();
}
/**
* Register the site's custom
* post types
*
*/
public function register_post_types() {
$custom_post_types = [
/*'news' => [
'name_singular' => __( 'News', 'lxm002' ),
'name_plural' => __( 'News', 'lxm002' ),
'slug' => 'lxm002_news',
'has_archive' => false
],*/
];
if ( ! empty( $custom_post_types ) ) {
foreach ( $custom_post_types as $post_type => $args ) {
$this->cpts[ $post_type ] = new Mlib_CPT( $post_type, $args );
}
}
}
/**
* Register the site's custom
* taxonomies
*
*/
public function register_taxonomies() {
$custom_taxonomies = [
/*'project_category' => [
'post_types' => 'project',
'name_singular' => __( 'Project Category', 'lxm002' ),
'name_plural' => __( 'Project Categories', 'lxm002' ),
]*/
];
if ( ! empty( $custom_taxonomies ) ) {
foreach ( $custom_taxonomies as $taxonomy => $args ) {
$post_types = isset( $args['post_types'] ) && ! empty( $args['post_types'] )
? $args['post_types']
: '';
$this->taxonomies[ $taxonomy ] = new Mlib_Taxonomy( $taxonomy, $post_types, $args );
}
}
}
/**
* Register the options
* pages to be used
*
*/
public function register_options_pages() {
if ( function_exists( 'acf_add_options_page' ) ) {
acf_add_options_page( array(
'position' => 59,
'page_title' => 'Site Options',
'redirect' => false
) );
}
}
/**
* Print some styles for the
* advanced custom fields in
* the admin
*
*/
public function admin_styles() {
?>
<style>
.acf-field-no-margin {
margin: 0 !important;
}
.acf-field-reusable-field-group > .acf-input {
margin: 0 -10px;
}
.acf-field {
padding: 10px;
}
</style>
<?php
}
/**
*
* Allow SVGs upload
*
*/
public function cc_mime_types( $mimes ) {
$mimes['svg'] = 'image/svg+xml';
return $mimes;
}
}