public/wordpress/wp-content/plugins/wp-courseware/includes/functions/core.php
/**
 * Get permalink settings for things like courses and taxonomies.
 *
 * @since 4.4.0
 *
 * @return array $permalinks The permalink settings.
 */
Get permalink settings for things like courses and taxonomies.

@return array $permalinks The permalink settings.
Get permalink settings for things like courses and taxonomies . @return array $permalinks The permalink settings .
function wpcw_get_permalink_structure() {
	$saved_permalinks = (array) get_option( 'wpcw_permalinks', array() );
	$permalinks       = wp_parse_args( array_filter( $saved_permalinks ), array(
		'course_base'            => _x( 'course', 'slug', 'wp-courseware' ),
		'course_category_base'   => _x( 'course-category', 'slug', 'wp-courseware' ),
		'course_tag_base'        => _x( 'course-tag', 'slug', 'wp-courseware' ),
		'unit_base'              => '%module_number%',
		'unit_category_base'     => _x( 'unit-category', 'slug', 'wp-courseware' ),
		'unit_tag_base'          => _x( 'unit-tag', 'slug', 'wp-courseware' ),
		'use_verbose_page_rules' => false,
	) );
	if ( $saved_permalinks !== $permalinks ) {
		update_option( 'wpcw_permalinks', $permalinks );
	}
	$permalinks['course_rewrite_slug']          = untrailingslashit( $permalinks['course_base'] );
	$permalinks['course_category_rewrite_slug'] = untrailingslashit( $permalinks['course_category_base'] );
	$permalinks['course_tag_rewrite_slug']      = untrailingslashit( $permalinks['course_tag_base'] );
	$permalinks['unit_rewrite_slug']          = untrailingslashit( $permalinks['unit_base'] );
	$permalinks['unit_category_rewrite_slug'] = untrailingslashit( $permalinks['unit_category_base'] );
	$permalinks['unit_tag_rewrite_slug']      = untrailingslashit( $permalinks['unit_tag_base'] );
	return $permalinks;
}
function wpcw_get_permalink_structure ( ) { $ saved_permalinks = ( array ) get_option ( 'wpcw_permalinks' , array ( ) ) ; $ permalinks = wp_parse_args ( array_filter ( $ saved_permalinks ) , array ( 'course_base' => _x ( 'course' , 'slug' , 'wp-courseware' ) , 'course_category_base' => _x ( 'course-category' , 'slug' , 'wp-courseware' ) , 'course_tag_base' => _x ( 'course-tag' , 'slug' , 'wp-courseware' ) , 'unit_base' => '%module_number%' , 'unit_category_base' => _x ( 'unit-category' , 'slug' , 'wp-courseware' ) , 'unit_tag_base' => _x ( 'unit-tag' , 'slug' , 'wp-courseware' ) , 'use_verbose_page_rules' => false , ) ) ; if ( $ saved_permalinks !== $ permalinks ) { update_option ( 'wpcw_permalinks' , $ permalinks ) ; } $ permalinks [ 'course_rewrite_slug' ] = untrailingslashit ( $ permalinks [ 'course_base' ] ) ; $ permalinks [ 'course_category_rewrite_slug' ] = untrailingslashit ( $ permalinks [ 'course_category_base' ] ) ; $ permalinks [ 'course_tag_rewrite_slug' ] = untrailingslashit ( $ permalinks [ 'course_tag_base' ] ) ; $ permalinks [ 'unit_rewrite_slug' ] = untrailingslashit ( $ permalinks [ 'unit_base' ] ) ; $ permalinks [ 'unit_category_rewrite_slug' ] = untrailingslashit ( $ permalinks [ 'unit_category_base' ] ) ; $ permalinks [ 'unit_tag_rewrite_slug' ] = untrailingslashit ( $ permalinks [ 'unit_tag_base' ] ) ; return $ permalinks ; }
Get permalink settings for things like courses and taxonomies.
Get permalink settings for things like courses and taxonomies .
// Courses // Units