Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter phokat

    (@phokat)

    Yes I did thanks David. I responded and sent you a link.

    Thread Starter phokat

    (@phokat)

    Hi David,

    Thanks for getting back to me. I have followed your instructions as stated and am awaiting your response.

    Thanks again

    Thread Starter phokat

    (@phokat)

    Hi David,

    I managed to get it to work activate at last but I don’t think it’s a proper fix. I vared out part of the “Register metaboxes” function so that it does not declare on the core.php declaration as loader.php runs. This has worked a bit but I don’t think it’s a proper fix as mentioned. Would you be willing to give some insight?

    Thread Starter phokat

    (@phokat)

    Hi David,

    Thought this would be of assistance. The Brooks Core plugin is a theme plugin. It serves as the Core Plugin for Brooks Theme. I tried deactivating it and installing Media Library Assistant and it worked for a little while then the site went down. The Brooks Core plugin consists of two php files, namely the brooks_core/brooks_core.php and the brooks_core/inc/profi-cpt.php

    I have pasted the brooks_core/brooks_core.php code below:

    “<?php
    /*
    Plugin Name: Brooks Core
    Plugin URI: http://www.iondigi.com
    Description: Core Plugin for Brooks Theme
    Version: 1.1.2
    Author: ION Digital
    Author URI: http://www.iondigi.com
    */

    if( !class_exists( ‘Brooks_Core’ ) ) {

    class Brooks_Core {

    /**
    * Plugin version, used for cache-busting of style and script file references.
    *
    * @since 1.0.0
    *
    * @var string
    */
    protected $version = ‘1.1.2’;

    /**
    * Unique identifier for your plugin.
    *
    * Use this value (not the variable name) as the text domain when internationalizing strings of text. It should
    * match the Text Domain file header in the main plugin file.
    *
    * @since 1.0.0
    *
    * @var string
    */
    protected $plugin_slug = ‘brooks-core’;

    /**
    * Instance of this class.
    *
    * @since 1.0.0
    *
    * @var object
    */
    protected static $instance = null;

    /**
    * This method adds other methods to specific hooks within WordPress.
    *
    * @since 1.0.0
    */
    public function __construct() {
    $this->init();
    }

    /**
    * Initialize the plugin by setting localization and loading public scripts
    *
    * @since 1.0.0
    */
    function init() {

    /**
    * Register metaboxes
    */
    if( !class_exists(‘RWMB_Autoloader’) )
    include_once( ‘inc/meta-box/meta-box.php’ );

    include_once( ‘inc/meta-box-group/meta-box-group.php’ );
    include_once( ‘inc/meta-box-tooltip/meta-box-tooltip.php’ );
    include_once( ‘inc/meta-box-columns/meta-box-columns.php’ );
    include_once( ‘inc/meta-box-tabs/meta-box-tabs.php’ );
    include_once( ‘inc/meta-box-include-exclude/meta-box-include-exclude.php’ );
    include_once( ‘inc/meta-box-show-hide/meta-box-show-hide.php’ );
    include_once( ‘inc/meta-box-conditional-logic/meta-box-conditional-logic.php’ );
    include_once( ‘inc/meta-box-settings-page/meta-box-settings-page.php’ );
    include_once( ‘inc/meta-term/mb-term-meta.php’ );
    include_once( ‘inc/meta-box-google-fonts/meta-box-google-fonts.php’ );
    include_once( ‘inc/meta-box-custom-output/meta-box-custom-output.php’ );
    include_once( ‘inc/meta-box-alpha-color/meta-box-alpha-color.php’ );
    include_once( ‘inc/ion-progress-importer/ion-progress-importer.php’ );

    add_action( ‘init’, array($this, ‘register_post_types’) );

    $plugin_dir = plugin_dir_path(__FILE__);

    /** CPT **/
    include_once $plugin_dir. ‘/inc/profi-cpt.php’;

    $this->extend_vc();

    }

    /**
    * Return an instance of this class.
    *
    * @since 1.0.0
    *
    * @return object A single instance of this class.
    */
    public static function get_instance() {

    // If the single instance hasn’t been set, set it now.
    if ( null == self::$instance ) {
    self::$instance = new self;
    }

    return self::$instance;
    }

    /**
    * Register custom post types
    *
    * @since 1.0.0
    */
    function register_post_types() {
    new Profi_Post_Types();
    }

    function extend_vc() {
    function get_font_id($variant){
    return str_replace( ‘400’, ‘regular’, str_replace(‘400italic’,’italic’,$variant[‘id’]) );
    }

    function get_font_type($id){
    static $types = array(
    ‘100’ => ‘100 light regular:100:normal’,
    ‘100italic’ => ‘100 light italic:100:italic’,
    ‘200’ => ‘200 light regular:200:normal’,
    ‘200italic’ => ‘200 light italic:200:italic’,
    ‘300’ => ‘300 light regular’,
    ‘300italic’ => ‘300 light italic:300:italic’,
    ‘regular’ => ‘400 regular:400:normal’,
    ‘italic’ => ‘400 italic:400:italic’,
    ‘500’ => ‘500 bold regular’,
    ‘500italic’ => ‘300 light italic:300:italic’,
    ‘600’ => ‘600 bold regular:600:normal’,
    ‘600italic’ => ‘600 bold italic:600:italic’,
    ‘700’ => ‘700 bold regular:700:normal’,
    ‘700italic’ => ‘700 bold italic:700:italic’,
    ‘800’ => ‘800 bold regular:800:normal’,
    ‘800italic’ => ‘800 bold italic:800:italic’,
    ‘900’ => ‘900 bold regular:900:normal’,
    ‘900italic’ => ‘900 bold italic:900:italic’
    );

    return $types[$id];
    }

    function update_fonts($fonts){
    $fonts = array();
    $google_fonts = RWMB_Google_Fonts_Field::get_google_array();

    foreach($google_fonts as $font) {
    $fontObj = new stdClass();
    $fontObj->font_family = $font[‘name’];
    $variants = array_map(‘get_font_id’, $font[‘variants’]);

    $fontObj->font_styles = implode( ‘,’, $variants );
    $fontObj->font_types = implode( ‘,’, array_map(‘get_font_type’, $variants) );

    $fonts[] = $fontObj;
    }

    return $fonts;
    }

    add_filter( ‘vc_google_fonts_get_fonts_filter’, ‘update_fonts’ );
    }
    }

    // Instantiate the class
    $profi_core = new Brooks_Core();

    }

    This is the brooks_core/inc/profi-cpt.php code below:

    “<?php
    /**
    * Register Custom Post Types
    */

    class Profi_Post_Types {

    public function __construct()
    {
    $this->register_post_types();
    $this->register_taxonomies();
    }

    public function post_types()
    {
    $args = array();

    // Buildings
    $args[‘building’] = array(
    ‘labels’ => array(
    ‘name’ => esc_html__( ‘Buildings’, ‘brooks’ ),
    ‘singular_name’ => esc_html__( ‘Building’, ‘brooks’ ),
    ‘add_new’ => esc_html__( ‘Add New’, ‘brooks’ ),
    ‘add_new_item’ => esc_html__( ‘Add New Building’, ‘brooks’ ),
    ‘edit_item’ => esc_html__( ‘Edit Building’, ‘brooks’ ),
    ‘new_item’ => esc_html__( ‘New Building’, ‘brooks’ ),
    ‘view_item’ => esc_html__( ‘View Building’, ‘brooks’ ),
    ‘search_items’ => esc_html__( ‘Search Buildings’, ‘brooks’ ),
    ‘not_found’ => esc_html__( ‘No buildings found’, ‘brooks’ ),
    ‘not_found_in_trash’ => esc_html__( ‘No buildings found in Trash’, ‘brooks’ ),
    ‘parent_item_colon’ => esc_html__( ‘Parent building:’, ‘brooks’ ),
    ),
    ‘hierarchical’ => false,
    ‘description’ => esc_html__( ‘Add Your Building Items’, ‘brooks’ ),
    ‘supports’ => array( ‘title’, ‘thumbnail’, ‘editor’ ),
    ‘menu_icon’ => ‘dashicons-admin-home’,
    ‘public’ => true,
    ‘publicly_queryable’ => true,
    ‘exclude_from_search’ => false,
    ‘query_var’ => true,
    ‘rewrite’ => true
    );

    // Portfolio
    $args[‘portfolio’] = array(
    ‘labels’ => array(
    ‘name’ => esc_html__( ‘Portfolio’, ‘brooks’ ),
    ‘singular_name’ => esc_html__( ‘Portfolio’, ‘brooks’ ),
    ‘add_new’ => esc_html__( ‘Add New’, ‘brooks’ ),
    ‘add_new_item’ => esc_html__( ‘Add New Portfolio’, ‘brooks’ ),
    ‘edit_item’ => esc_html__( ‘Edit Portfolio’, ‘brooks’ ),
    ‘new_item’ => esc_html__( ‘New Portfolio’, ‘brooks’ ),
    ‘view_item’ => esc_html__( ‘View Portfolio’, ‘brooks’ ),
    ‘search_items’ => esc_html__( ‘Search Portfolio’, ‘brooks’ ),
    ‘not_found’ => esc_html__( ‘No buildings found’, ‘brooks’ ),
    ‘not_found_in_trash’ => esc_html__( ‘No buildings found in Trash’, ‘brooks’ ),
    ‘parent_item_colon’ => esc_html__( ‘Parent building:’, ‘brooks’ ),
    ),
    ‘hierarchical’ => false,
    ‘description’ => esc_html__( ‘Add Your Portfolio Items’, ‘brooks’ ),
    ‘supports’ => array( ‘title’, ‘thumbnail’, ‘editor’ ),
    ‘menu_icon’ => ‘dashicons-admin-appearance’,
    ‘public’ => true,
    ‘publicly_queryable’ => true,
    ‘exclude_from_search’ => false,
    ‘query_var’ => true,
    ‘rewrite’ => true
    );

    // Portfolio
    $args[‘team’] = array(
    ‘labels’ => array(
    ‘name’ => esc_html__( ‘Team’, ‘brooks’ ),
    ‘singular_name’ => esc_html__( ‘Team Member’, ‘brooks’ ),
    ‘add_new’ => esc_html__( ‘Add New’, ‘brooks’ ),
    ‘add_new_item’ => esc_html__( ‘Add New Member’, ‘brooks’ ),
    ‘edit_item’ => esc_html__( ‘Edit Member’, ‘brooks’ ),
    ‘new_item’ => esc_html__( ‘New Member’, ‘brooks’ ),
    ‘view_item’ => esc_html__( ‘View Member’, ‘brooks’ ),
    ‘search_items’ => esc_html__( ‘Search Member’, ‘brooks’ ),
    ‘not_found’ => esc_html__( ‘No team members found’, ‘brooks’ ),
    ‘not_found_in_trash’ => esc_html__( ‘No team members found in Trash’, ‘brooks’ ),
    ‘parent_item_colon’ => esc_html__( ‘Parent member:’, ‘brooks’ ),
    ),
    ‘hierarchical’ => false,
    ‘description’ => esc_html__( ‘Add Your Team Members’, ‘brooks’ ),
    ‘supports’ => array( ‘title’, ‘thumbnail’, ‘editor’ ),
    ‘menu_icon’ => ‘dashicons-groups’,
    ‘public’ => true,
    ‘publicly_queryable’ => true,
    ‘exclude_from_search’ => false,
    ‘query_var’ => true,
    ‘rewrite’ => true
    );

    // Testimonials
    $args[‘testimonials’] = array(
    ‘labels’ => array(
    ‘name’ => esc_html__( ‘Testimonials’, ‘brooks’ ),
    ‘singular_name’ => esc_html__( ‘Testimonial’, ‘brooks’ ),
    ‘add_new’ => esc_html__( ‘Add New’, ‘brooks’ ),
    ‘add_new_item’ => esc_html__( ‘Add New Testimonial’, ‘brooks’ ),
    ‘edit_item’ => esc_html__( ‘Edit Testimonial’, ‘brooks’ ),
    ‘new_item’ => esc_html__( ‘New Testimonial’, ‘brooks’ ),
    ‘view_item’ => esc_html__( ‘View Testimonial’, ‘brooks’ ),
    ‘search_items’ => esc_html__( ‘Search Through Testimonials’, ‘brooks’ ),
    ‘not_found’ => esc_html__( ‘No testimonials found’, ‘brooks’ ),
    ‘not_found_in_trash’ => esc_html__( ‘No testimonials found in Trash’, ‘brooks’ ),
    ‘parent_item_colon’ => esc_html__( ‘Parent Testimonial:’, ‘brooks’ ),
    ‘menu_name’ => esc_html__( ‘Testimonials’, ‘brooks’ ),

    ),
    ‘hierarchical’ => false,
    ‘description’ => esc_html__( ‘Add a Testimonial’, ‘brooks’ ),
    ‘supports’ => array( ‘title’, ‘thumbnail’, ‘editor’),
    ‘menu_icon’ => ‘dashicons-testimonial’,
    ‘public’ => true,
    ‘publicly_queryable’ => false,
    ‘exclude_from_search’ => true,
    ‘query_var’ => true,
    ‘rewrite’ => true
    );

    return $args;
    }

    public function register_taxonomies() {
    $post_taxonomies = $this->taxonomies();

    foreach($post_taxonomies as $post_type => $taxonomies) {
    foreach($taxonomies as $slug => $settings) {
    register_taxonomy($slug, array($post_type), $settings);
    register_taxonomy_for_object_type($slug, $post_type);
    }
    }
    }

    public function register_post_types() {
    $post_types = $this->post_types();

    foreach($post_types as $post_type => $settings) {
    register_post_type($post_type, $settings);
    }
    }

    private function taxonomies() {
    $taxonomies = array();
    $taxonomies[‘building’] = array();

    $taxonomies[‘building’][‘building_category’] = array(
    ‘labels’ => array(
    ‘name’ => esc_html__( ‘Category’, ‘brooks’ ),
    ‘singular_name’ => esc_html__( ‘Category’, ‘brooks’ ),
    ‘search_items’ => esc_html__( ‘Search Categories’, ‘brooks’ ),
    ‘all_items’ => esc_html__( ‘All Categories’, ‘brooks’ ),
    ‘parent_item’ => esc_html__( ‘Parent Category’, ‘brooks’ ),
    ‘parent_item_colon’ => esc_html__( ‘Parent Category:’, ‘brooks’ ),
    ‘edit_item’ => esc_html__( ‘Edit Category’, ‘brooks’ ),
    ‘update_item’ => esc_html__( ‘Update Category’, ‘brooks’ ),
    ‘add_new_item’ => esc_html__( ‘Add New Category’, ‘brooks’ ),
    ‘new_item_name’ => esc_html__( ‘New Category Name’, ‘brooks’ ),
    ‘choose_from_most_used’ => esc_html__( ‘Choose from the most used categories’, ‘brooks’ )
    ),
    ‘hierarchical’ => true,
    ‘show_ui’ => true,
    ‘public’ => true,
    ‘show_in_nav_menus’ => true,
    ‘show_admin_column’ => true,
    );

    $taxonomies[‘building’][‘location’] = array(
    ‘labels’ => array(
    ‘name’ => esc_html__( ‘Location’, ‘brooks’ ),
    ‘singular_name’ => esc_html__( ‘Location’, ‘brooks’ ),
    ‘search_items’ => esc_html__( ‘Search Locations’, ‘brooks’ ),
    ‘all_items’ => esc_html__( ‘All Locations’, ‘brooks’ ),
    ‘parent_item’ => esc_html__( ‘Parent Country’, ‘brooks’ ),
    ‘parent_item_colon’ => esc_html__( ‘Parent Country:’, ‘brooks’ ),
    ‘edit_item’ => esc_html__( ‘Edit Location’, ‘brooks’ ),
    ‘update_item’ => esc_html__( ‘Update Location’, ‘brooks’ ),
    ‘add_new_item’ => esc_html__( ‘Add New Location’, ‘brooks’ ),
    ‘new_item_name’ => esc_html__( ‘New Location Name’, ‘brooks’ ),
    ‘choose_from_most_used’ => esc_html__( ‘Choose from the most used locations’, ‘brooks’ )
    ),
    ‘hierarchical’ => true,
    ‘show_ui’ => true,
    ‘public’ => true,
    ‘show_in_nav_menus’ => true,
    ‘show_admin_column’ => true,
    );

    $taxonomies[‘building’][‘types’] = array(
    ‘labels’ => array(
    ‘name’ => esc_html__( ‘Building Types’, ‘brooks’ ),
    ‘singular_name’ => esc_html__( ‘Building Type’, ‘brooks’ ),
    ‘search_items’ => esc_html__( ‘Search Building Types’, ‘brooks’ ),
    ‘all_items’ => esc_html__( ‘All Building Types’, ‘brooks’ ),
    ‘parent_item’ => esc_html__( ‘Parent Building Type’, ‘brooks’ ),
    ‘parent_item_colon’ => esc_html__( ‘Parent Building Type:’, ‘brooks’ ),
    ‘edit_item’ => esc_html__( ‘Edit Building Type’, ‘brooks’ ),
    ‘update_item’ => esc_html__( ‘Update Building Type’, ‘brooks’ ),
    ‘add_new_item’ => esc_html__( ‘Add New Building Type’, ‘brooks’ ),
    ‘new_item_name’ => esc_html__( ‘New Building Type Name’, ‘brooks’ ),
    ‘choose_from_most_used’ => esc_html__( ‘Choose from the most used building types’, ‘brooks’ )
    ),
    ‘hierarchical’ => true,
    ‘show_ui’ => true,
    ‘public’ => true,
    ‘show_in_nav_menus’ => true,
    ‘show_admin_column’ => true,
    );

    $taxonomies[‘portfolio’][‘portfolio_category’] = array(
    ‘labels’ => array(
    ‘name’ => esc_html__( ‘Category’, ‘brooks’ ),
    ‘singular_name’ => esc_html__( ‘Category’, ‘brooks’ ),
    ‘search_items’ => esc_html__( ‘Search Categories’, ‘brooks’ ),
    ‘all_items’ => esc_html__( ‘All Categories’, ‘brooks’ ),
    ‘parent_item’ => esc_html__( ‘Parent Category’, ‘brooks’ ),
    ‘parent_item_colon’ => esc_html__( ‘Parent Category:’, ‘brooks’ ),
    ‘edit_item’ => esc_html__( ‘Edit Category’, ‘brooks’ ),
    ‘update_item’ => esc_html__( ‘Update Category’, ‘brooks’ ),
    ‘add_new_item’ => esc_html__( ‘Add New Category’, ‘brooks’ ),
    ‘new_item_name’ => esc_html__( ‘New Category Name’, ‘brooks’ ),
    ‘choose_from_most_used’ => esc_html__( ‘Choose from the most used categories’, ‘brooks’ )
    ),
    ‘hierarchical’ => true,
    ‘show_ui’ => true,
    ‘public’ => true,
    ‘show_in_nav_menus’ => true,
    ‘show_admin_column’ => true,
    );

    return $taxonomies;
    }

    }

    Hope this helps

    Thanks again

    Thread Starter phokat

    (@phokat)

    Hi David,

    Thank you for getting back to me. Oh ok, that makes things a little bit more heisty doesn’t it.

    A little bit more about the website. It’s running on a Brooks Creative Multi-Purpose Theme, so I would think that the conflict is happening on the themes php core file?

    It’s running WordPress v4.8.1 and 14 Plugins enabled and activated. The plugins are namely Brooks Core, Contact Form 7, Instagram Feed,
    Premium SEO pack – WordPress Plugin, Really Simple SSL, Slider Revolution,
    Smart Google Analytics Code, UpdraftPlus – Backup/Restore, WooCommerce, WP Smush, WP Super Cache, WP-SpamShield, WPBakery Visual Composer and
    YITH WooCommerce Catalog Mode.

    I have not contacted the author of the brooks core plugin yet, given that I noticed the error only when trying to activate Media Library Assistant.

    I have just taken over looking over the website a few days ago. Apparently Media Library Assistant was installed on this system and deleted again. After some cleaning up I said they could install it again and that’s when we came across this error.

    Thanks again David

Viewing 5 replies - 1 through 5 (of 5 total)