Overwrite the sensei plugin in wordpress

Clash Royale CLAN TAG#URR8PPP
Overwrite the sensei plugin in wordpress
I am using a sensei plugin for course management.I need to overwrite the Learner Management modules which I have to add some more fields in that list.I have tried with overwriting the class in function.php but I cannot the 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();
I have added image
In admin leaner management I have list with "Course", " #Leaner" and "Last Updated " details. Now I need to add a extra column like "User name" ,"Email Address" etc
– Stackoverflow questions
May 23 '17 at 6:59
And what have you tried? How have you approached it? What didn't work?
– Ceisc
May 23 '17 at 7:28
I have tried to add a class and render the output as same but it is displaying two time in the list One is from the plugin and another I have added class list
– Stackoverflow questions
May 23 '17 at 7:53
1 Answer
1
In order to overwrite sensei files, just follow what you would normally do with woocommerce. Create a folder called sensei (not woothemes-sensei) inside the root of your theme (/wp-content/themes/sensei/...) and create the file exactly the same path as in plugin folder. Simple as that.
sensei
(/wp-content/themes/sensei/...)
---ALERT(UPDATE)----
it only works for template (changing the layout) and not the function.. which i completely got wrong about your question..
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
It'd be nice if you went into a bit more detail about what you've tried and what exactly isn't working with it.
– Ceisc
May 23 '17 at 0:14