Membership Plugin

WordPress Membership Plugin

  • Home
  • Documentation
  • Addons
  • Support
    • Quick Setup
    • Documentation
    • Premium Addon Support
    • Paid Support
    • Support Forum
    • Support Forum Search
    • Forum Login
    • Forum Registration
  • Contact
You are here: Home

juntgw

  • Profile
  • Topics Started
  • Replies Created
  • Engagements
  • Favorites

Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • April 29, 2018 at 1:25 am in reply to: Before login redirect #14320
    juntgw
    Participant

    Hi,

    I typed the single quote correctly, but it does not work.
    I also tried copy and pase, but the results were the same.

    April 28, 2018 at 11:08 am in reply to: Before login redirect #14316
    juntgw
    Participant

    Hi,

    My site is here. https://test0.pikule.jp/?
    And login page is https://test0.pikule.jp/login/
    Protected page (my-page) is http://test0.pikule.jp/my-page/

    If user access my-page when he is not logged in, I want to redirect him to the login page.

    functions.php is is below.

    —————-
    <?php
    /**
    * Javo Themes functions and definitions
    *
    * @package WordPress
    * @subpackage Javo
    * @since Javo Themes 1.0
    */

    // Path Initialize
    define( ‘JVFRM_SPOT_APP_PATH’ , get_template_directory() ); // Get Theme Folder URL : hosting absolute path
    define( ‘JVFRM_SPOT_THEME_DIR’ , get_template_directory_uri() ); // Get http URL : ex) http://www.abc.com/
    define( ‘JVFRM_SPOT_SYS_DIR’ , JVFRM_SPOT_APP_PATH.”/library”); // Get Library path
    define( ‘JVFRM_SPOT_TP_DIR’ , JVFRM_SPOT_APP_PATH.”/templates”); // Get Tempate folder
    define( ‘JVFRM_SPOT_ADM_DIR’ , JVFRM_SPOT_SYS_DIR.”/admin”); // Administrator Page
    define( ‘JVFRM_SPOT_IMG_DIR’ , JVFRM_SPOT_THEME_DIR.”/assets/images”); // Images folder
    define( ‘JVFRM_SPOT_WG_DIR’ , JVFRM_SPOT_SYS_DIR.”/widgets”); // Widgets Folder
    define( ‘JVFRM_SPOT_HDR_DIR’ , JVFRM_SPOT_SYS_DIR.”/header”); // Get Headers
    define( ‘JVFRM_SPOT_CLS_DIR’ , JVFRM_SPOT_SYS_DIR.”/classes”); // Classes
    define( ‘JVFRM_SPOT_DSB_DIR’ , JVFRM_SPOT_SYS_DIR.”/dashboard”); // Dash Board
    define( ‘JVFRM_SPOT_FUC_DIR’ , JVFRM_SPOT_SYS_DIR.”/functions”); // Functions
    define( ‘JVFRM_SPOT_PLG_DIR’ , JVFRM_SPOT_SYS_DIR.”/plugins”); // Plugin folder
    define( ‘JVFRM_SPOT_ADO_DIR’ , JVFRM_SPOT_SYS_DIR . “/addons”); // Addons folder

    define( ‘JVFRM_SPOT_CUSTOM_HEADER’, false );

    // Includes : Basic or default functions and included files
    require_once JVFRM_SPOT_SYS_DIR . “/define.php”; // defines
    require_once JVFRM_SPOT_SYS_DIR . “/load.php”; // loading functions, classes, shotcode, widgets
    require_once JVFRM_SPOT_SYS_DIR . “/enqueue.php”; // enqueue js, css
    require_once JVFRM_SPOT_SYS_DIR . “/wp_init.php”; // post-types, taxonomies
    require_once JVFRM_SPOT_ADM_DIR . “/class-admin-theme-settings.php”; // theme options
    require_once JVFRM_SPOT_DSB_DIR . “/class-dashboard.php”; // theme screen options tab.

    $jvfrm_spot_core_include = apply_filters( ‘jvfrm_spot_core_function_path’, JVFRM_SPOT_APP_PATH .’/includes/class-core.php’ );

    if( file_exists( $jvfrm_spot_core_include ) ) require_once $jvfrm_spot_core_include;

    do_action( ‘jvfrm_spot_themes_loaded’ );

    // update_option( ‘wp_less_cached_files’, ” );

    if( !function_exists( ‘wcs_dequeue_quantity’ ) ) {
    add_action( ‘wp_enqueue_scripts’, ‘wcs_dequeue_quantity’ );
    function wcs_dequeue_quantity() {
    wp_dequeue_style( ‘wcqi-css’ );
    }
    }

    if( !function_exists( ‘jvfrm_spot_custom_lava_listing_meta’ ) ) {
    add_action( ‘lava_lv_listing_field_init’, ‘jvfrm_spot_custom_lava_listing_meta’ );
    function jvfrm_spot_custom_lava_listing_meta( $field=”, $args=array() ) {
    remove_filter( ‘lava_lv_listing_field_output’, ‘__return_false’, 99 );
    if( in_array( $field, Array( ‘_logo’ ) ) ) {
    add_filter( ‘lava_lv_listing_field_output’, ‘__return_false’, 99 );
    }
    }
    }

    global $post;
    $post_id = $post->ID;//Grab the post ID
    $protection_ctrl = SwpmProtection::get_instance();
    //Check if the current visitor has access to this post.
    $is_protected = $protection_ctrl->is_protected($post_id);
    if($is_protected) {
    //This user doesn’t have permission to see this post. Redirect the user.
    $redirect_url = ‘https://test0.pikule.jp/login/&#8217;;
    wp_redirect($redirect_url);
    exit;
    }

    April 28, 2018 at 9:33 am in reply to: Before login redirect #14314
    juntgw
    Participant

    Hi,

    Thank you kindly for your reply.

    I checked the documentation and added code to function.php, but it does not work.
    I wonder what’s wrong. . .

    April 28, 2018 at 3:51 am in reply to: Before login redirect #14312
    juntgw
    Participant

    Hi,

    I am not good at English, I’m sorry I could not explain well.

    I am talking about protected pages.

    Thank you.

    April 28, 2018 at 1:03 am in reply to: Before login redirect #14310
    juntgw
    Participant

    Hi,

    This add-on does not solve my problem.

    When the user is not logged in, if he accesses the membership page, I want to redirect him to the login page.

    Thank you

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
Next Page »

Please read this message before using our plugin.

Search

Featured Addons and Extensions

  • Membership Form Builder Addon
  • Member Directory Listing Addon
  • WooCommerce Payment Integration
  • Member Data Exporter Addon

Documentation

  • Documentation Index Page

Copyright © 2026 | Simple Membership Plugin | Privacy Policy