Home › Forums › WPLMS AddOns › Custom Learning Paths › Change/translate learningpath slug
- This topic has 10 replies, 3 voices, and was last updated 5 years, 10 months ago by Scott Lang.
Viewing 11 posts - 1 through 11 (of 11 total)
-
AuthorPosts
-
January 18, 2019 at 9:48 am #192946LMSfriendParticipantHi 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. ThanksJanuary 21, 2019 at 1:30 pm #193213Scott LangModeratoryes 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' );January 21, 2019 at 4:33 pm #193252LMSfriendParticipantThanks for your answer! define ( 'WPLMS_CLP_SLUG', 'myslug' ); is not working for me. Any other ideas? I need to change "learningpath" and "achievements".January 22, 2019 at 6:15 am #193302Anshuman SahuKeymasterPlease install this plugin to change the slug : https://bit.ly/2AZnX3I change the " myslug " in the plugin as mentioned : http://prntscr.com/maeihiJanuary 22, 2019 at 9:04 am #193340LMSfriendParticipantThanks 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" ThanksJanuary 22, 2019 at 11:22 am #193362LMSfriendParticipant2) Since I am not sure to use badges, it would be enough for me to just hide the achievements tab from view. ThanksJanuary 22, 2019 at 2:46 pm #193414Scott LangModeratorto 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/malsg6January 22, 2019 at 3:47 pm #193425LMSfriendParticipantThanks 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" ThanksJanuary 23, 2019 at 6:38 am #193497Scott LangModeratorhi, 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);January 23, 2019 at 9:36 am #193509LMSfriendParticipantThanks Scott, all things work now as requested. Thread can be closed.January 23, 2019 at 12:37 pm #193561Scott LangModeratorWe are closing this topic.
-
AuthorPosts
Viewing 11 posts - 1 through 11 (of 11 total)
- The topic ‘Change/translate learningpath slug’ is closed to new replies.