403Webshell
Server IP : 172.67.147.195  /  Your IP : 216.73.216.142
Web Server : Apache/2
System : Linux hosting8537.lvs 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User : mienphi ( 1014)
PHP Version : 8.2.14
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/mienphi/public_html/wp-content/plugins/learnpress/inc/lesson/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/mienphi/public_html/wp-content/plugins/learnpress/inc/lesson/lp-lesson-functions.php
<?php
/**
 * Lession function.
 *
 * @author ThimPress
 * @version 4.0.0
 * @deprecated 4.2.2
 */

defined( 'ABSPATH' ) || exit();

function learn_press_lesson_comment_form_fields( $post_id ) {
	if ( empty( $_REQUEST['content-item-only'] ) ) {
		return;
	}
	?>

	<input type="hidden" name="content-item-only-redirect" value="<?php echo learn_press_get_current_url(); ?>"/>
	<input type="hidden" name="content-item-only" value="yes"/>

	<?php
}
//add_action( 'comment_form', 'learn_press_lesson_comment_form_fields' );

if ( ! function_exists( 'learn_press_get_only_content_permalink' ) ) {
	function learn_press_get_only_content_permalink( $redirect, $comment ) {
		if ( empty( $_REQUEST['content-item-only'] ) || sanitize_text_field( $_REQUEST['content-item-only'] ) !== 'yes' ) {
			return $redirect;
		}

		if ( empty( $_REQUEST['content-item-only-redirect'] ) ) {
			return $redirect;
		}

		if ( get_post_type( $comment->comment_post_ID ) != 'lp_lesson' ) {
			return $redirect;
		}

		return esc_url_raw( add_query_arg( 'content-item-only', 'yes', LP_Helper::sanitize_params_submitted( $_REQUEST['content-item-only-redirect'] ) ) );
	}
}
//add_filter( 'comment_post_redirect', 'learn_press_get_only_content_permalink', 10, 2 );

/*function learn_press_lesson_comment_form() {
	global $post;

	$course = learn_press_get_course();
	if ( ! $course ) {
		return;
	}

	$lesson = LP_Global::course_item();
	if ( ! $lesson ) {
		return;
	}

	$user = learn_press_get_current_user();

	if ( $lesson->setup_postdata() ) {
		if ( comments_open() || get_comments_number() ) {
			add_filter( 'deprecated_file_trigger_error', '__return_false' );
			comments_template();
			remove_filter( 'deprecated_file_trigger_error', '__return_false' );
		}

		$lesson->reset_postdata();
	}

}*/

/**
 * Remove data section after remove lesson
 */
function learn_press_lesson_before_delete_post( $post_id, $force = false ) {
	global $wpdb;

	if ( 'lp_lesson' === get_post_type( $post_id ) ) {
		$sql = 'DELETE FROM `' . $wpdb->prefix . 'learnpress_section_items` WHERE `item_id` = ' . $post_id . ' AND `item_type` = "lp_lesson"';
		$wpdb->query( $sql );
	}
}
//add_action( 'delete_post', 'learn_press_lesson_before_delete_post', 10, 2 );

Youez - 2016 - github.com/yon3zu
LinuXploit