Dre4m Shell
Server IP : 85.214.239.14  /  Your IP : 3.145.84.128
Web Server : Apache/2.4.62 (Debian)
System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.18
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/wordpress/wp-content/plugins/paid-member-subscriptions/extend/learndash/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /var/www/wordpress/wp-content/plugins/paid-member-subscriptions/extend/learndash/functions.php
<?php

// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) exit;

// Return if LearnDash Plugin is not active
if ( ! is_plugin_active('sfwd-lms/sfwd_lms.php') ) return;

// Return if LearnDash meta-box is disabled
if ( apply_filters( 'pms_post_content_restriction_learndash_meta_box_disable', false ) ) return;


/**
 * Remove PMS Content Restriction meta-box from LearnDash: courses, lessons, and quizzes
 *
 */
function pms_content_restriction_remove_learndash_cpts( $post_types ) {
    $learndash_post_types = array( 'sfwd-courses', 'sfwd-lessons', 'sfwd-quiz' );

    foreach ( $post_types as $key => $slug ) {
        if ( in_array( $slug, $learndash_post_types) )
            unset( $post_types[$key] );
    }

    return $post_types;
}
add_filter( 'pms_post_content_restriction_post_types', 'pms_content_restriction_remove_learndash_cpts' );


/**
 * Initializes the LearnDash meta-box
 *
 */
function pms_init_learndash_meta_box() {
    $post_types = array( 'sfwd-courses', 'sfwd-lessons', 'sfwd-quiz' );

    foreach( $post_types as $post_type ) {
        add_meta_box( 'pms_post_content_restriction_learndash', __( 'Content Restriction', 'paid-member-subscriptions' ), 'pms_learndash_meta_box_content', $post_type, 'normal' );
    }

}
add_action( 'add_meta_boxes', 'pms_init_learndash_meta_box' );


/**
 * Output callback for the LearnDash meta-box
 *
 */
function pms_learndash_meta_box_content() {
    echo '<div class="pms-icon-wrapper">
              <img id="pms-icon" src="'. esc_url( PMS_PLUGIN_DIR_URL ) . 'assets/images/pms-logo.svg" alt="Paid Member Subscriptions PRO" title="Paid Member Subscriptions PRO">
              <span class="dashicons dashicons-plus"></span>
              <img id="learndash-logo" src="' . esc_url( PMS_PLUGIN_DIR_URL ) . 'assets/images/learn-dash-logo.png" alt="">
          </div>';

    echo '<h4>' . esc_html( __( 'Create member only content with just a few clicks.', 'paid-member-subscriptions' ) ) . '</h4>';

    echo '<p>' . esc_html( __( "Allow only members to have access to courses, lessons and quizzes with Paid Member Subscriptions PRO.", 'paid-member-subscriptions' ) ). '</p>';

    echo '<a href="https://www.cozmoslabs.com/wordpress-paid-member-subscriptions/?utm_source=wpbackend&utm_medium=clientsite&utm_content=content-restriction-learndash&utm_campaign=PMSFree#pricing" target="_blank" class="button-primary">' . esc_html( __( 'Upgrade to PRO', 'paid-member-subscriptions' ) ) . '</a>';
}

Anon7 - 2022
AnonSec Team