Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions classes/Options_V2.php
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,15 @@ public function get_setting_fields() {
'slug' => 'course',
'block_type' => 'uniform',
'fields' => array(
array(
'key' => 'course_permalink_base',
'type' => 'text',
'label' => __( 'Course Slug', 'tutor' ),
'placeholder' => __( 'Course Slug', 'tutor' ),
'label_title' => '',
'default' => tutor()->course_post_type,
'desc' => __( 'Update the permalink when changing the course slug', 'tutor' ),
),
array(
'key' => 'student_must_login_to_view_course',
'type' => 'toggle_switch',
Expand Down
4 changes: 1 addition & 3 deletions classes/Post_types.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ public function __construct() {
* @return void
*/
public function register_course_post_types() {
$course_post_type = $this->course_post_type;

$labels = array(
'name' => _x( 'Courses', 'post type general name', 'tutor' ),
'singular_name' => _x( 'Course', 'post type singular name', 'tutor' ),
Expand All @@ -112,7 +110,7 @@ public function register_course_post_types() {
// 'show_in_menu' => 'tutor',
'query_var' => true,
'rewrite' => array(
'slug' => tutor_utils()->get_option( 'course_permalink_base', $course_post_type ),
'slug' => tutor_utils()->get_option( 'course_permalink_base', $this->course_post_type ),
'with_front' => true,
),
'menu_icon' => 'dashicons-book-alt',
Expand Down