function include_update() { // Update LearnPress from 0.9.x to 1.0 if (version_compare(LP()->db_version, '1.0', '<')) { learn_press_include('updates/learnpress-update-1.0.php'); } }
static function include_update() { if (!self::$_update_files) { return; } $latest_version = end(array_keys(self::$_update_files)); // Update LearnPress from 0.9.x to 1.0 if (version_compare(learn_press_get_current_version(), $latest_version, '=')) { add_action('admin_notices', array(__CLASS__, 'hide_other_notices'), -100); learn_press_include('updates/' . self::$_update_files[$latest_version]); } }
<?php /** * Class LP_Assets * * @author ThimPress * @package LearnPress/Classes * @version 1.0 * @extends LP_Abstract_Assets */ if (!defined('ABSPATH')) { exit; // Exit if accessed directly } learn_press_include('abstracts/abstract-lp-assets.php'); class LP_Assets extends LP_Abstract_Assets { protected static $_minify = array('assets/js/admin/question.js' => 'assets/js/admin/question.min.js', 'assets/js/global.js' => 'assets/js/global.min.js'); static function init() { add_action('learn_press_print_assets', array(__CLASS__, '_print_assets')); add_filter('script_loader_src', array(__CLASS__, 'script_loader_src'), 10, 2); add_action('learn_press_settings_save_general', array(__CLASS__, '_minify_source')); parent::init(); } static function script_loader_src($src, $handle) { if (LP_Settings::instance()->get('debug') == 'yes') { return $src; } $minify = self::$_minify;
<?php if (!defined('ABSPATH')) { exit; // Exit if accessed directly } if (!class_exists('LP_Course_Post_Type')) { // Base class for custom post type to extends learn_press_include('custom-post-types/abstract.php'); // class LP_Course_Post_Type final class LP_Course_Post_Type extends LP_Abstract_Post_Type { /** * Constructor */ function __construct() { add_action('rwmb_course_curriculum_before_save_post', array($this, 'before_save_curriculum')); add_filter('manage_lp_course_posts_columns', array($this, 'columns_head')); add_filter('manage_lp_course_posts_custom_column', array($this, 'columns_content')); add_filter("rwmb__lpr_course_price_html", array($this, 'currency_symbol'), 5, 3); add_action('edit_form_after_editor', array($this, 'toggle_editor_button'), -10); add_action('add_meta_boxes', array($this, 'review_logs_meta_box')); add_action('post_submitbox_start', array($this, 'post_review_message_box')); add_action('learn_press_transition_course_status', array($this, 'review_log'), 10, 3); add_action('load-post.php', array($this, 'post_actions')); parent::__construct(); } /** * Process request actions on post.php loaded */