Home › Forums › Legacy Support › Support queries › Setup issues › Setting a Course End Date
Tagged: Course End Date
- This topic has 9 replies, 2 voices, and was last updated 4 years, 9 months ago by Veronica.
Viewing 10 posts - 1 through 10 (of 10 total)
-
AuthorPosts
-
March 1, 2020 at 11:07 am #244224kamhangParticipantHi, I follow the instruction here to set a course end date. I add two pieces of code in customizer_class.php, but my site crashed, any idea? <?php /* Plugin Name: WPLMS Customizer Plugin Plugin URI: http://www.Vibethemes.com Description: A simple WordPress plugin to modify WPLMS template Version: 1.0 Author: VibeThemes Author URI: http://www.vibethemes.com License: GPL2 */ /* Copyright 2014 VibeThemes (email : [email protected]) wplms_customizer program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation. wplms_customizer program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 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 */ include_once 'classes/customizer_class.php'; if(class_exists('WPLMS_Customizer_Plugin_Class')) { // instantiate the plugin class $wplms_customizer = new WPLMS_Customizer_Plugin_Class(); } add_filter('wplms_course_metabox',array($this,'wplms_custom_course_meta')); add_filter('wplms_course_details_widget',array($this,'wplms_custom_course_details_widget')); add_filter('wplms_take_course_page',array($this,'wplms_custom_take_course_page'),10,2); add_filter('wplms_course_product_id',array($this,'wplms_custom_take_course_page'),10,2); add_action('wplms_course_before_front_main',array($this,'wplms_custom_course_before_main')); add_action('wplms_course_subscribed',array($this,'set_expiry_end_date'),10,2); add_filter('wplms_course_creation_tabs',array($this,'switch_wplms_front_end_tabs123'),1); function wplms_custom_course_meta($course_meta){ $prefix = 'vibe_'; $course_meta[]=array( // Text Input 'label' => __('Course End Date','vibe-customtypes'), // <label> 'desc' => __('Date from which Course End','vibe-customtypes'), // description 'id' => $prefix.'end_date', // field id and name 'type' => 'date', // type of field ); return $course_meta; } function wplms_custom_course_details_widget($details){ $course_id = get_the_ID(); $end_date=get_post_meta($course_id,'vibe_end_date',true); if(isset($end_date) && $end_date!=''){ $end_date= date_i18n( get_option( 'date_format' ),strtotime($end_date)); $extra = array('end_date'=>'
- <i>'.$end_date.'</i>End Date
March 1, 2020 at 11:15 am #244225kamhangParticipantHi, Sorry, it seems that something wrong in my post How can i show you the content of php file?March 2, 2020 at 11:58 am #244286VeronicaModeratorhi, you can simply make use of this setting to set the end date for the course: http://prntscr.com/raa4a8 in the EDIT COURSE section. you can revert back if I misunderstood your query.March 2, 2020 at 2:35 pm #244329kamhangParticipantHi Veronica, That is exactly I want to set. But in the course section, I see all fields except course end date. Any prerequisite setting in order to show course end date?March 3, 2020 at 6:10 am #244373VeronicaModeratorYES, the above is this the result of the code provided here: https://wplms.io/support/knowledge-base/setting-a-course-end-date/ maybe you have not followed the instruction carefully/you have misplaced the code. add the code like this: http://prntscr.com/raotdm http://prntscr.com/raouxa please try the above one and then let us know. if you are not able to do the same then I will check it. I have tried to log in with your previous credentials but they are not working at all so please provide the working one if you are not able to apply the above code.March 5, 2020 at 3:58 am #244621kamhangParticipantThis reply has been marked as private.March 5, 2020 at 6:38 am #244635VeronicaModeratorThis reply has been marked as private.March 5, 2020 at 7:14 am #244642VeronicaModeratorBIG MISTAKE!!!! you have added the code in the WPLMS-CUSTOMIZER.PHP you have to add the code in the CUSTOMIZER_CLASS.PHP GOTO>>WPLMS-CUSTOMIZER PLUGIN>>CLASSES>>CUSTOMIZER_CLASS.PHP this is what you exactly missed here. refer this: http://prntscr.com/rbu73eMarch 5, 2020 at 9:14 am #244658kamhangParticipantThis reply has been marked as private.March 5, 2020 at 10:07 am #244665VeronicaModeratorI have updated the path in the TIP. but as you know, it was very clear that we have to add the code in customizer-class.php anyways it is resolved now. BIG CHEERS! closing the topic. -
AuthorPosts
Viewing 10 posts - 1 through 10 (of 10 total)
- The topic ‘Setting a Course End Date’ is closed to new replies.