WordPress.org

Ready to get started?Download WordPress

Plugin Directory

Sensei Re-Ordering

Plugin Sensei Re-ordering allows you to re-order courses and lessons through a drag and drop interface that have been created with Wootheme- Sensei

Donation

If you like the plugin, consider showing your appreciation by saying thank you or making a small donation.

Known Issues

I have not created the translation table for other languages, but the code is written for translation.

Disclaimer

Ainsworth, Etc., LLC does not warrant the accuracy or completeness of any plugin and is not responsible for mistakes or omissions that may be caused as a result of using it.

Changes in Woothemes-Sensi to support this plugin.

To support this plugin, there are changes that will need to be made in the Woothemes-Sensi files to support the change in sort orders.

  1. Replace the file "./wp_content/plugins/woothemes- sensei/templates/wrappers/pagination-posts.php" with the one included zip file.

  2. Replace the file "./wp_content/plugins/woothemes- sensei/inc/woothemes-sensei-template.php" with the one included zip file.

  3. Replace the file "./wp_content/plugins/woothemes- sensei/classes/class-woothemes-sensei-course.php" with the one included zip file.

Note: If you have altered any of the above files,make the changes as noted below.

Following are the changes made to the files

'./woolthemes-sensei/classes/class-woothemes-sensei-course.php'

lines 492, 493 were changed: from 'orderby' => 'date', 'order' => 'DESC', to 'orderby' => 'menu_order', 'order' => 'ASC',

lines 521, 522 were changed: from 'orderby' => 'date', 'order' => 'DESC', to 'orderby' => 'menu_order', 'order' => 'ASC',

lines 572, 573 were changed: from 'orderby' => 'date', 'order' => 'DESC', to 'orderby' => 'menu_order', 'order' => 'ASC',

lines 604, 605 were changed: from 'orderby' => 'date', 'order' => 'DESC', to 'orderby' => 'menu_order', 'order' => 'ASC',

lines 617, 618 were changed: from 'orderby' => 'date', 'order' => 'DESC', to 'orderby' => 'menu_order', 'order' => 'ASC',

'./woothemes-sensei/inc/woothemes-sensei-template.php'

lines 38,39 from set_query_var( 'orderby', 'date' ); set_query_var( 'order', 'DESC' ); to set_query_var( 'orderby', 'menu_order' ); set_query_var( 'order', 'ASC' );

lines 42.43 from set_query_var( 'orderby', 'date' ); set_query_var( 'order', 'DESC' ); to set_query_var( 'orderby', 'menu_order' ); set_query_var( 'order', 'ASC' );

lines 49.50 from set_query_var( 'orderby', 'date' ); set_query_var( 'order', 'DESC' ); to set_query_var( 'orderby', 'menu_order' ); set_query_var( 'order', 'ASC' );

lines 56.57 from set_query_var( 'orderby', 'date' ); set_query_var( 'order', 'DESC' ); to set_query_var( 'orderby', 'menu_order' ); set_query_var( 'order', 'ASC' );

Following function inserted at line 489

/**
* sensei_get_prev_next_courses Returns the next and previous Courses
* since 1.0.9
* @param  integer $course_id
* @return array $return_values
*/
function sensei_get_prev_next_courses( $course_id = 0 ) {
  global $woothemes_sensei;

  $return_values = array();
  $return_values['prev_lesson'] = 0;
  $return_values['next_lesson'] = 0;

  if ( 0 < $course_id ) {
     // Get the List of Courses
     $args = array( 'post_type'       => 'course',
                 'numberposts'     => -1,
                 'orderby'            => 'menu_order',
                 'order'              => 'ASC',
                 'post_status'        => 'publish',
                 'suppress_filters'   => true
                 );

     $courses = get_posts( $args );

     // Index the Lessons
     if ( 0 < count( $courses ) ) {
        $found_index = false;
        foreach ($courses as $course){
           if ( $found_index && $return_values['next_lesson'] == 0 )
           {
              $return_values['next_lesson'] = $course->ID;
           } // End If Statement

           if ( $course->ID == $course_id ) {
              // Is the current post
              $found_index = true;
           } // End If Statement

           if ( !$found_index ) {
              $return_values['prev_lesson'] = $course->ID;
           } // End If Statement
        } // End For Loop
     } // End If Statement
  } // End If Statement
  return $return_values;

} // End sensei_get_prev_next_courses()

'./woothemes-sensei/templates/wrappers/pagination-posts.php'

Re-written

Requires: 2.8 or higher
Compatible up to: 3.9.1
Last Updated: 2014-2-28
Downloads: 458

Ratings

0 stars
0 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.