Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter Biyans

    (@biyanpasau)

    Exactly what I need. Thank you!

    Thread Starter Biyans

    (@biyanpasau)

    I think I didn’t explain my question very detail. What I’m trying to do is to show certain content only for expired member. For example:

    <?php if account_is_expired() {
      echo 'Only expired account can see this text';
    } else {
      echo 'Text only for active member';
    } ?>

    How do i do that on this plugin?

    Thread Starter Biyans

    (@biyanpasau)

    I got it now, but still weird tho ??

    My account is the only admin and the only editor. I don’t have this account registered as a member in the plugin. Also, my theme is really basic, just like skeleton template and no builder plugin installed — really sure I don’t have any function that can execute this shortcode on admin end. I’m not experiencing this issues on the classic editor but only on Gutenberg.

    Since the shortcode is working just fine on member end, would be any update that instead of showing error and disable the post editor, it will execute a fallback like an empty value?

    Thread Starter Biyans

    (@biyanpasau)

    The error isn’t on the user front-end, but on the page editor of the admin dashboard. Despite the update appeared to be failed, the value of the [expiry_date] is still displayed correctly for all user on the front-end. It’s just that when I try to edit the page again, the fatal error that I sent before will appear.

    Screenshot: https://i.postimg.cc/MZbDnX7p/Capture.jpg

    Perhaps this problem is on the instance I was using when installing WP, not the plugin. Thank you for helping anyway

    Thread Starter Biyans

    (@biyanpasau)

    This is the error I get

    Warning: Attempt to read property "membership_level" on null in /bitnami/wordpress/wp-content/plugins/simple-membership/classes/class.swpm-utils.php on line 78
    
    Fatal error: Uncaught Exception: subcript_period parameter must be integer in SwpmUtils::calculate_subscription_period_days method in /bitnami/wordpress/wp-content/plugins/simple-membership/classes/class.swpm-utils.php:59 Stack trace: #0 /bitnami/wordpress/wp-content/plugins/simple-membership/classes/class.swpm-utils.php(82): SwpmUtils::calculate_subscription_period_days() #1 /bitnami/wordpress/wp-content/plugins/simple-membership/classes/class.swpm-utils-member.php(98): SwpmUtils::get_expiration_timestamp() #2 /bitnami/wordpress/wp-content/plugins/swpm-show-member-info/swpm-show-member-info.php(63): SwpmMemberUtils::get_expiry_date_timestamp_by_user_id() #3 /bitnami/wordpress/wp-content/plugins/swpm-show-member-info/swpm-show-member-info.php(38): swpm_smi_get_member_info_by_id() #4 /opt/bitnami/wordpress/wp-includes/shortcodes.php(356): swpm_smi_show_member_info() #5 [internal function]: do_shortcode_tag() #6 /opt/bitnami/wordpress/wp-includes/shortcodes.php(228): preg_replace_callback() #7 /opt/bitnami/wordpress/wp-includes/class-wp-hook.php(307): do_shortcode() #8 /opt/bitnami/wordpress/wp-includes/plugin.php(191): WP_Hook->apply_filters() #9 /opt/bitnami/wordpress/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php(1811): apply_filters() #10 /opt/bitnami/wordpress/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php(560): WP_REST_Posts_Controller->prepare_item_for_response() #11 /opt/bitnami/wordpress/wp-includes/rest-api/class-wp-rest-server.php(1143): WP_REST_Posts_Controller->get_item() #12 /opt/bitnami/wordpress/wp-includes/rest-api/class-wp-rest-server.php(990): WP_REST_Server->respond_to_request() #13 /opt/bitnami/wordpress/wp-includes/rest-api.php(519): WP_REST_Server->dispatch() #14 /opt/bitnami/wordpress/wp-includes/rest-api.php(2868): rest_do_request() #15 [internal function]: rest_preload_api_request() #16 /opt/bitnami/wordpress/wp-includes/block-editor.php(601): array_reduce() #17 /opt/bitnami/wordpress/wp-admin/edit-form-blocks.php(75): block_editor_rest_api_preload() #18 /opt/bitnami/wordpress/wp-admin/post.php(187): require('...') #19 {main} thrown in /bitnami/wordpress/wp-content/plugins/simple-membership/classes/class.swpm-utils.php on line 59
    
    There has been a critical error on this website. Please check your site admin email inbox for instructions.
    Thread Starter Biyans

    (@biyanpasau)

    Already done that. I disabled all plugin and switch the theme back to default, but the problem persisted. Any chance this might be caused by the PHP version? I’m using 8.0.17.

    Open Loop.php

    <?php if ( is_archive() || is_search() ) : // Only display Excerpts for archives & search ?>
    			<div class="entry-summary">
    				<?php the_excerpt( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?>
    			</div><!-- .entry-summary -->
    	<?php else : ?>
    			<div class="entry-content">
    				<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?>
    				<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
    			</div><!-- .entry-content -->
    	<?php endif; ?>

    Replace with this:

    <?php if ( is_archive() || is_search() ) : // Only display Excerpts for archives & search ?>
    			<div class="entry-summary">
    				<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?>
    				<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
    			</div><!-- .entry-content -->
    			</div><!-- .entry-summary -->
    	<?php else : ?>
    			<div class="entry-content">
    				<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?>
    				<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
    			</div><!-- .entry-content -->
    	<?php endif; ?>
Viewing 7 replies - 1 through 7 (of 7 total)