0

I tried to insert code into my customizer_class.php file in Wordpress. I got code from this page: http://vibethemes.com/documentation/wplms/knowledge-base/removing-instructors-profile-link-from-name-in-course-page/ and saved my file with the code.

However the code didn't work. I deleted the code and updated the file. However I got this error:

Parse error: syntax error, unexpected 'return' (T_RETURN), expecting function (T_FUNCTION)

Now practically all of my website refused to work and spits back the above error on nearly every page I access. I can't even log in as admin on my Wordpress website due to this error.

Here is the code that I have right now with the code I originally tried to put in removed.

<?php

if(!class_exists('WPLMS_Customizer_Plugin_Class'))
{   
    class WPLMS_Customizer_Plugin_Class  // We'll use this just to avoid function name conflicts 
    {

        public function __construct(){   
            add_filter('wplms_course_nav_menu',array($this,'wplms_course_nav_menu'));
        } // END public function __construct
        public function activate(){
            // ADD Custom Code which you want to run when the plugin is activated
        }
        public function deactivate(){
            // ADD Custom Code which you want to run when the plugin is de-activated    
        }

        // ADD custom Code in clas
        function wplms_course_nav_menu($menu_array){
            $units = bp_course_get_curriculum_units(get_the_ID());
            if(!is_Array($units) || !count($units)){                
                unset($menu_array['curriculum']);    
            }              
            return $menu_array;        
        }  

    } // END class WPLMS_Customizer_Class
} // END if(!class_exists('WPLMS_Customizer_Class'))

?>

I think that I might have deleted necessary code when removing the ineffective extra code but I have no clue what the original file looked like. Even if I can find what it looked like, WP admin is not functioning due to the error so fixing it is difficult.

rblanco3
  • 9
  • 2
  • 2
    That error should end with "... on line X." Can you post that? – mopo922 Jan 27 '16 at 23:21
  • The code you've included doesn't seem to generate any syntax errors when I run it. – andrewsi Jan 27 '16 at 23:29
  • The error should also identify the file containing the error and hopefully a stack trace. **Look at it all** and show us to. Still now you know the dangers of testing on a live site. – RiggsFolly Jan 27 '16 at 23:32
  • EDIT: Got it fixed from somewhere else. Apparently I was missing `return $domain;` before closing the class – rblanco3 Jan 27 '16 at 23:53

0 Answers0