Change/translate learningpath slug

Home Forums WPLMS AddOns Custom Learning Paths Change/translate learningpath slug

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #192946
    LMSfriend
    Participant
    Hi 1) I would like to change the learningpath slug in userprofile, because I can't find a way to do it with loco translate in language file. I want to translate this: mysite.com/user/"username"/learningpath mysite.com/user/"username"/learningpath/achievements Please tell me where and how to change it. Thanks
    #193213
    Scott Lang
    Moderator
    yes there is a way to change it but it will change the main learning path slug also : to change please add this given codei in wplms-customizer.php file in wplms customizer plugin .   define( 'WPLMS_CLP_SLUG', 'myslug' );
    #193252
    LMSfriend
    Participant
    Thanks for your answer! define ( 'WPLMS_CLP_SLUG', 'myslug' ); is not working for me. Any other ideas? I need to change "learningpath" and "achievements".
    #193302
    Anshuman Sahu
    Keymaster
    Please install this plugin to change the slug :   https://bit.ly/2AZnX3I    change the " myslug " in the plugin as mentioned : http://prntscr.com/maeihi  
    #193340
    LMSfriend
    Participant
    Thanks Alex, this plugin is working for "learningpath"!   2) I need to translate "achievements" too in: mysite.com/user/"username"/learningpath/achievements   3) If I create a learningpath, the permalink from the path is still containing "learningpath", so it was not globally translated through the plugin. The permalink is still: mysite.com/learningpath/"name of my path"   Thanks
    #193362
    LMSfriend
    Participant
    2) Since I am not sure to use badges, it would be enough for me to just hide the achievements tab from view.   Thanks  
    #193414
    Scott Lang
    Moderator
    to change achievements slug add this line just below the define( 'WPLMS_CLP_ACHIEVEMENT_SLUG', 'myachivementslug' ); refer : http://prntscr.com/malorl   for remove achivement : add this code to your wplms plugin - > wplms-customizer.php function bpcodex_remove_group_manager_subnav_tabs() { bp_core_remove_subnav_item( WPLMS_CLP_SLUG, WPLMS_CLP_ACHIEVEMENT_SLUG ); } add_action( 'bp_actions', 'bpcodex_remove_group_manager_subnav_tabs' ,999); refer  :http://prntscr.com/malsg6  
    #193425
    LMSfriend
    Participant
    Thanks Scott, all is working. 1) and 2) solved.   I still need help to solve 3) If I create a learningpath, the permalink from the path is still containing "learningpath", so it was not globally translated through the plugin. The permalink is still:mysite.com/learningpath/"name of my path" Thanks
    #193497
    Scott Lang
    Moderator
    hi, add this code to your wplms plugin - > wplms-customizer.php function learningpath_slug(){   $obj=get_post_type_object('learningpath'); $obj->rewrite['slug']='my-slug-customizer'; register_post_type( 'learningpath',(array)$obj); } Refer this :http://prntscr.com/mawdjq   add_action('init', 'learningpath_slug',10);  
    #193509
    LMSfriend
    Participant
    Thanks Scott, all things work now as requested. Thread can be closed.
    #193561
    Scott Lang
    Moderator
    We are closing this topic.
Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Change/translate learningpath slug’ is closed to new replies.