WordPress.org

Ready to get started?Download WordPress

Forums

TinyMCE Advanced
tadv_page definition should also include a call to tadv_paths (2 posts)

  1. Namely
    Member
    Posted 2 years ago #

    TADV_PATH is not initialised in the direct run and breaks on line 325 as plugins_loaded are loaded later than we define function tadv_page.

    Warning: include_once(TADV_PATHtadv_admin.php): failed to open stream: No such file or directory in /var/www/.../wp-content/plugins/tinymce-advanced/tinymce-advanced.php on line 325 Warning: include_once(): Failed opening 'TADV_PATHtadv_admin.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/.../wp-content/plugins/tinymce-advanced/tinymce-advanced.php on line 326

    Here is the related code from tinymce-advanced.php:

    if ( ! function_exists('tadv_paths') ) {
    	/*
    	If using domain mapping or plugins that change the path dinamically, edit these to set the proper path and URL.
    	*/
    	function tadv_paths() {
    		if ( !defined('TADV_URL') )
    			define('TADV_URL', plugin_dir_url(__FILE__));
    
    		if ( !defined('TADV_PATH') )
    			define('TADV_PATH', plugin_dir_path(__FILE__));
    	}
    	add_action( 'plugins_loaded', 'tadv_paths', 50 );
    }
    
    ...
    
    if ( ! function_exists('tadv_page') ) {
    	function tadv_page() {
    		if ( !defined('TADV_ADMIN_PAGE') )
    			define('TADV_ADMIN_PAGE', true);
    
    		include_once( TADV_PATH . 'tadv_admin.php');
    	}
    }

    Instead tadv_page definition should also include a call to tadv_paths:

    if ( ! function_exists('tadv_page') ) {
    	function tadv_page() {
    		if ( !defined('TADV_ADMIN_PAGE') )
    			define('TADV_ADMIN_PAGE', true);
    		tadv_paths (); // ADDED THIS LINE
    		include_once( TADV_PATH . 'tadv_admin.php');
    	}
    }
  2. Andrew Ozz
    WordPress Dev
    Plugin Author

    Posted 2 years ago #

    Thanks for the bug fix.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic