WP Manifestindependent plugin directory
manifest / users / pms-locked-posts

Paid Member Subscriptions - Locked Posts

#192600 - Joana - Paid Member Subscriptions Customization - Timewall

★ 0stars
v1.1.0latest · 2 years ago

Install

Download pms-locked-posts.zip From the v1.1.0 release on GitHub, Jun 1, 2024

Upload it under Plugins → Add New Plugin → Upload Plugin, then activate.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/altprjcts/pms-locked-posts/releases/download/v1.1.0/pms-locked-posts.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

This repository holds the source codes of the plugin. To be able to install the plugin in WP, you would need to build it first.

You can also download the installable plugin from each release.

How to build the plugin

Make sure Node.js is installed on your system.

  1. In the plugin root directory, run:
    npm install
  2. Then run the following command, it generates a folder with name of the plugin. You can zip it and install it in WP.
    npm run release

You can also check package.json file for more commands.

Theme modifications

Some of the modifications are inside the theme.

  • banner_contentrestriction.php

This is provided by the client, I modified it to add the custom fields' options.

  • template_geral.php

This is provided by the client, I modified it to add lock feature for pages' block.

<!-- Lock feature. -->
<?php
    $preview_blocks = [];
    $is_page_locked = false;

    if ( function_exists( 'pmslp_get_page_preview_blocks' ) ) {
        $preview_blocks = pmslp_get_page_preview_blocks();
    }

    if ( function_exists( 'pmslp_get_page_preview_blocks' ) ) {
        $is_page_locked = pmslp_is_page_locked();

        if ( 
            is_user_logged_in() 
            && current_user_can( 'manage_options' )
        ) {
            $is_page_locked = false;
        }
    }
?>

// Checks if page is locked to show preview blocks and content restriction banner.
    if ( $is_page_locked ) {
        $block = get_row_index() . '-' . get_row_layout();

        if ( ! in_array( $block, $preview_blocks, true ) ) {

            if ( function_exists( 'pmslp_load_content_restriction_banner' ) ) {
                pmslp_load_content_restriction_banner();
            }

            break;
        }
    }

Releases

2 releases. Each count is every asset in that release; expand a row for the breakdown.

Tag
Published
Assets
Downloads
v1.1.0 latest
Jun 1, 2024 2 years ago
pms-locked-posts.zip
0
Jun 1, 2024 2 years ago
tag only
—