init(); } return self::$instance; } /** * Holds the sites data. * */ private function init() { $this->setup_editor(); $this->setup_beaver(); $this->setup_elementor(); $this->setup_sites_listing(); add_filter( 'themeisle_sdk_hide_dashboard_widget', '__return_true' ); add_filter( 'templates_patterns_collection_feedback_review_message', function ( $message ) { $message = "Hey, it's great to see you are using Neve's Starter Sites and Templates for a few days now. Which one is your favourite? If you can spare a few moments to rate our work on WordPress.org it would help us a lot (and boost our motivation). Cheers!

~ Mihai, curator of Neve's Starter Sites"; return $message; } ); if ( ! $this->should_load() ) { return; } $this->setup_admin(); $this->setup_api(); $this->setup_active_state(); } /** * Setup editor functionality. * * @return void */ private function setup_editor() { $this->editor = new Editor(); $this->editor->init(); } /** * Setup beaver functionality. * * @return void */ private function setup_beaver() { if ( ! class_exists( 'FLBuilder' ) ) { return; } $this->beaver = new TI_Beaver(); $this->beaver->init(); } /** * Setup Elementor functionality. * * @return void */ private function setup_elementor() { $this->elementor = new Elementor(); $this->elementor->init(); } /** * Setup sites listing. * * @return void */ private function setup_sites_listing() { $this->sites_listing = new Sites_Listing(); $this->sites_listing->init(); } /** * Utility to check if sites library should be loaded. * * @return bool */ private function should_load() { if ( ! current_user_can( 'manage_options' ) ) { return false; } return true; } /** * Setup admin functionality. * * @return void */ private function setup_admin() { $this->admin = new Admin(); $this->admin->init(); } /** * Setup the restful functionality. * * * @return void */ private function setup_api() { $api = new Rest_Server(); $api->init(); } /** * Setup Active State * * @return void; */ private function setup_active_state() { $active_state = new Active_State(); $active_state->init(); } /** * Get meta fields. * * @return array */ static public function get_meta_fields( $post_id, $type ) { $fields = apply_filters( 'ti_tpc_template_meta', array(), $post_id, $type ); $meta = array(); if ( sizeof( $fields ) > 0 ) { foreach ( $fields as $field ) { $value = get_post_meta( $post_id, $field, true ); if ( ! empty( $value ) ) { $meta[ $field ] = $value; } } } return $meta; } /** * Disallow object clone * * @access public * @return void * @since 1.0.0 */ public function __clone() { } /** * Disable un-serializing * * @access public * @return void * @since 1.0.0 */ public function __wakeup() { } }