I am using a sensei plugin for course management.I need to overwrite the Learner Management modules which I have to add to some more fields in that list.I have tried with overwrite the class in function.php but I cannot success with that.

My Code in function.php

class Custom_Sensei_Learner_Management extends Sensei_Learner_Management {

    public $name;
    public $file;
    public $page_slug;

    /**
     * Constructor
     * @since  1.6.0
     * @return  void
     */
    public function __construct($file) {

        $this->name = __('Learner Management', 'woothemes-sensei');
        $this->file = $file;
        $this->page_slug = 'sensei_learners';


        // Admin functions
        if (is_admin()) {

            add_action('admin_menu', array($this, 'learners_admin_menu'), 30);
            add_action('learners_wrapper_container', array($this, 'wrapper_container'));
            if (isset($_GET['page']) && ( $_GET['page'] == $this->page_slug )) {
                add_action('admin_print_scripts', array($this, 'enqueue_scripts'));
                add_action('admin_print_styles', array($this, 'enqueue_styles'));
            }

            add_action('admin_init', array($this, 'add_new_learners'));
            add_action('admin_notices', array($this, 'add_learner_notices'));

        } // End If Statement
        // Ajax functions
        if (is_admin()) {

            add_action('wp_ajax_get_redirect_url_learners', array($this, 'get_redirect_url'));
            add_action('wp_ajax_remove_user_from_post', array($this, 'remove_user_from_post'));
            add_action('wp_ajax_sensei_json_search_users', array($this, 'json_search_users'));

        }


    }




    /**
     * learners_admin_menu function.
     * @since  1.6.0
     * @access public
     * @return void
     */
    public function learners_admin_menu() {

        global $menu;

        if (current_user_can('manage_sensei_grades')) {
            $learners_page = add_submenu_page('sensei', $this->name, $this->name, 'manage_sensei_grades', $this->page_slug, array($this, 'learners_page'));
        }
    }

// End learners_admin_menu()




    public function learners_page() {


        // Load Learners data
        $course_id = 0;
        $lesson_id = 0;


        if (isset($_GET['course_id'])) {
            $course_id = intval($_GET['course_id']);
        }

        if (isset($_GET['lesson_id'])) {
            $lesson_id = intval($_GET['lesson_id']);
        }


        $sensei_learners_main = $this->load_data_object('Main', $course_id, $lesson_id);

        // Wrappers
        do_action('learners_before_container');
        do_action('learners_wrapper_container', 'top');

        $this->learners_headers();
        ?>
        <div id="poststuff" class="sensei-learners-wrap this_is_test">
            <div class="sensei-learners-main">
                <?php $sensei_learners_main->display(); ?>
            </div>
            <div class="sensei-learners-extra">
                <?php do_action('sensei_learners_extra'); ?>
            </div>
        </div>
        <?php
        do_action('learners_wrapper_container', 'bottom');
        do_action('learners_after_container');
    }


// End learners_default_view()
}

$t = new Custom_Sensei_Learner_Management();
Any one help me on this.
Thanks in advance.

Read more here: Overwrite the sensei plugin in wordpress


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: