Home › Forums › Chit Chat › WPLMS customizations › Draft & Pending lessons showing at frontend
- This topic has 11 replies, 6 voices, and was last updated 8 years, 10 months ago by areyera.
Viewing 12 posts - 1 through 12 (of 12 total)
-
AuthorPosts
-
December 8, 2015 at 6:38 pm #12874jerdudeParticipantHi, When I'm logged in to my site as an instructor, and I navigate to the All Courses page, I can see Pending/Draft courses, regardless of those courses are created by me or not. Those are mainly courses submitted to the site but have yet to be approved by admin. I shouldn't be able to see those courses in the front right? Please help. Thanks!December 9, 2015 at 10:30 am #12975Anshuman SahuKeymasterThe courses which are not published and in drafts can be seen by the instructors on all courses page but these courses cannot be seen by the students on all courses page .December 9, 2015 at 10:31 am #12977jerdudeParticipantHow do I hide it from everyone? So that only published courses can be seen?December 10, 2015 at 8:04 am #13158Anshuman SahuKeymasterTry adding the given code in your wplms-customizer.php file in wplms customizer plugin : add_filter('bp_course_wplms_filters','wplms_hide_draft_courses',99); function wplms_hide_draft_courses($query_args){ if(!current_user_can('manage_options')){ $query_args['post_status'] = array('publish'); } return $query_args; }December 10, 2015 at 10:10 am #13183jerdudeParticipantHi, thanks for the help but it didn't work. I added the code as such to wplms-customizer/wplms-customizer.php You should have received a copy of the GNU General Public License along with wplms_customizer program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ add_filter('bp_course_wplms_filters','wplms_hide_draft_courses',99); function wplms_hide_draft_courses($query_args){ if(!current_user_can('manage_options')){ $query_args['post_status'] = array('publish'); } return $query_args; } Appreciate your further help. Thanks!December 11, 2015 at 10:40 am #13421Anshuman SahuKeymasterPlease note that only admins will see the courses on the all courses page if the above code added . Also you have to add the code at the end of the wplms-customizer.php file before " ?> " .February 8, 2016 at 7:26 am #26358foxycleopSpectatorHi Alex: The code you have provided works to hide all draft/pending courses from instructors (which is good) However, it also hides an instructor's own PENDING courses from the front end (course directory etc.). The instructor can't even preview THEIR OWN course (until it is published). That is NOT good user experience or workflow, Is it possible to modify the code in some way so that an instructor is able to see/preview their own "pending courses". It is NOT going to work because let's say an instructor created a new course and sent to be approved by admin. But then he/she can't find a trace of it anywhere - firstly it will confuse the hell out of the instructor, secondly let's say the instructor wants to make some changes to the course (before it is published), there is no way for him/her to do that - because the pending course is just not visible. The ideal situation is that an instructor is not able to see other instructors' Draft/Pending courses but should be able to see their own. thanks!February 9, 2016 at 1:11 pm #26868H.K. LatiyanParticipantThis is not possible as of now. There is only one query which runs for fetching courses, what you're suggesting would require two WP Querys and we'll then have to merge results into one. So, unfortunately it is not possible as of now.February 9, 2016 at 5:00 pm #26961foxycleopSpectatorI don't know much about databases, is it not possible to have a separate page where we query for the draft and pending posts for instructors? Is there some workaround or creative solution to this?February 9, 2016 at 6:23 pm #26975foxycleopSpectatorCan we not create something like this on a separate page and connect this to view course button as shown here -> https://cloudup.com/cDAW6kXICfY This page will live separately from Course Directory page and will create a separate link for easy access in instructor menu etc?? Is this not a viable solution for the time being? <?php //if a certain page, then display posts authored by the logged in user $page_title = 'Contributors Page'; if ( is_user_logged_in() && is_page($page_title) ) { global $current_user; get_currentuserinfo(); echo 'User ID: ' . $current_user->ID . "\n"; $args=array( 'author' => $current_user->ID, 'post_type' => 'course', 'post_status' => 'pending',February 11, 2016 at 10:05 am #27550espineteSpectatorI agree with foxycleop. I need a solution to this. Thanks.February 18, 2016 at 1:24 am #29708areyeraParticipantme too i agree , we need a solution for this. thanks.
-
AuthorPosts
Viewing 12 posts - 1 through 12 (of 12 total)
- The topic ‘Draft & Pending lessons showing at frontend’ is closed to new replies.