WordPress.org

Ready to get started?Download WordPress

Forums

Ultimate Metabox Tabs
[resolved] Class "acf_options_page" not found (3 posts)

  1. Mestika
    Member
    Posted 1 year ago #

    Hi,

    I'm experiencing a problem with the plugin when I install it. It throws the error: Class "acf_options_page" not found within the file:
    /ultimate-metabox-tabs/extensions/acf/options_page_mod.php

    Do I need to have the Options Page plugin for ACF installed in order to use this plugin?

    I'm using version 4.0.2 of the Advanced Custom Fields plugin.

    Cheers,
    - Emil

    http://wordpress.org/extend/plugins/ultimate-metabox-tabs/

  2. SilbinaryWolf
    Member
    Plugin Author

    Posted 1 year ago #

    You do not the Options Page plugin for this to work. I'll work on a patch to fix this, in the meantime, replace the file code with this. (simply adding the class_exists() check)

    if (class_exists('acf_options_page'))
    {
    
    class umt_acf_options_page extends acf_options_page
    {
    	var $umt;
    
    	function __construct($parent)
    	{
    		$this->umt = $parent;
    
    		// Setup Addon
    		global $acf;
    		if (isset($acf->options_page))
    		{
    			// call the original acf_options_page constructor
    			parent::__construct($acf);
    
    			// setup initiation procedure
    			add_action('init',array($this,'init'),99);
    
    			// setup register options page init
    			add_action('admin_init',array($this,'umt_admin_init'));
    		}
    		else
    		{
    			trigger_error("ACF Options Page support for Ultimate Metabox Tabs has become broken. Please contact the developer. For now, disable the extension.");
    		}
    	}
    
    	function init()
    	{
    		global $acf;
    		// remove the admin menu hook
    		remove_action('admin_menu', array($acf->options_page,'admin_menu'));
    
    		// override the original options page
    		$acf->options_page = $this;
    	}
    
    	function admin_body_class($classes)
    	{
    		$classes = str_replace(" umt_no_margin","",$classes);
    		return $classes;
    	}
    
    	function umt_admin_init()
    	{
    		// register metatabs page
    		umt_register_settings_page($this->umt_slug,$this->umt_name);
    	}
    
    	function admin_head() {
    		$this->umt->metatab_load_settings_page($this->umt_slug);
      		$this->umt->admin_head();
    
    		add_filter('admin_body_class',array($this,'admin_body_class'));
    
    		parent::admin_head();
    	}
    
    	function admin_print_scripts() {
    		$this->umt->metatab_load_settings_page($this->umt_slug);
    		parent::admin_print_scripts();
    		// remove original filter, only if on the 'options page'
    		remove_filter('richedit_pre', array($this->umt,'richedit_pre'),99);
    
      		$this->umt->admin_print_scripts();
    	}
    
    	function admin_print_styles() {
    		parent::admin_print_styles();
    		$this->umt->admin_print_styles();
    	}
    
    	function html()
    	{
    		parent::html();
    		// append metabox tabs
    		$this->umt->metatab_create();
    	}
    }
    }
  3. Mestika
    Member
    Posted 1 year ago #

    Hi,

    thanks for your quick response.

    Well this was actually my initially thought to do but when I do that I get following error (which is displayed at the top of the admin page, but still makes it possible for me to use the system):

    Warning: Attempt to assign property of non-object in /wp-content/plugins/ultimate-metabox-tabs/ultimate-metabox-tabs.php on line 300
    Warning: Attempt to assign property of non-object in /wp-content/plugins/ultimate-metabox-tabs/ultimate-metabox-tabs.php on line 301
    Warning: Attempt to assign property of non-object in /wp-content/plugins/ultimate-metabox-tabs/ultimate-metabox-tabs.php on line 302
    Warning: Attempt to assign property of non-object in /wp-content/plugins/ultimate-metabox-tabs/ultimate-metabox-tabs.php on line 303
    Warning: Attempt to assign property of non-object in /wp-content/plugins/ultimate-metabox-tabs/ultimate-metabox-tabs.php on line 304

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic