add_action('plugins_loaded','wplms_define_constants',5);
function wplms_define_constants(){
if ( ! defined( 'BP_COURSE_RESULTS_SLUG' ) )
define( 'BP_COURSE_RESULTS_SLUG', 'lesson-results' );
if ( ! defined( 'BP_COURSE_STATS_SLUG ' ) )
define( 'BP_COURSE_STATS_SLUG', 'lesson-stats' );
if ( ! defined( 'WPLMS_COURSE_SLUG' ) )
define( 'WPLMS_COURSE_SLUG', 'lessons' );
if ( ! defined( 'BP_COURSE_SLUG' ) )
define( 'BP_COURSE_SLUG', 'lessons' );
if ( ! defined( 'WPLMS_COURSE_CATEGORY_SLUG' ) )
define( 'WPLMS_COURSE_CATEGORY_SLUG', 'lesson-cat' );
}
These 2 fail:
if ( ! defined( 'WPLMS_COURSE_SLUG' ) )
define( 'WPLMS_COURSE_SLUG', 'lesson' );
if ( ! defined( 'BP_COURSE_SLUG' ) )
define( 'BP_COURSE_SLUG', 'lesson' );
Permalinks have been cleared multiple times and work, as the other defines stick
Regards
Alex
Had to move the defines to the wp-config :
# SLUGS
if ( ! defined( 'WPLMS_COURSE_SLUG' ) )
define( 'WPLMS_COURSE_SLUG', 'lesson' );
if ( ! defined( 'BP_COURSE_SLUG' ) )
define( 'BP_COURSE_SLUG', 'lesson' );
if ( ! defined( 'BP_COURSE_INSTRUCTOR_SLUG' ) )
define( 'BP_COURSE_INSTRUCTOR_SLUG', 'teacher-lessons');
Not ideal, but works for now :)
Regards
Alex
Yes you can paste the code in wp-config.php file as well as this file is not gets rewritten on updates .
The code works in this way :
It defines the constants if not defined .If the constants are defined before your custom code then it custom code will not define the new constants .
It means that your "custom slugs" code needs to run before the actual code runs .
Also we are adding the option to give custom slugs feature from the wp-admin itself in next update .