Пример #1
0
 /**
  * Registration Form Dialog.
  *
  * Outputs the form for new user registration and existing user edits.
  *
  * @since 2.5.1
  *
  * @param  string $toggle       (optional) Toggles between new registration ('new') and user profile edit ('edit').
  * @param  string $heading      (optional) The heading text for the form, null (default) for new registration.
  * @global string $wpmem_regchk Used to determine if the form is in an error state.
  * @global array  $userdata     Used to get the user's registration data if they are logged in (user profile edit).
  * @return string $form         The HTML for the entire form as a string.
  */
 function wpmem_inc_registration($toggle = 'new', $heading = '', $redirect_to = null)
 {
     global $wpmem, $wpmem_regchk, $userdata;
     // Set up default wrappers.
     $defaults = array('heading_before' => '<legend>', 'heading_after' => '</legend>', 'fieldset_before' => '<fieldset>', 'fieldset_after' => '</fieldset>', 'main_div_before' => '<div id="wpmem_reg">', 'main_div_after' => '</div>', 'txt_before' => '[wpmem_txt]', 'txt_after' => '[/wpmem_txt]', 'row_before' => '', 'row_after' => '', 'buttons_before' => '<div class="button_div">', 'buttons_after' => '</div>', 'form_id' => '', 'form_class' => 'form', 'button_id' => '', 'button_class' => 'buttons', 'req_mark' => '<span class="req">*</span>', 'req_label' => '<span class="req">*</span>' . __('Required field', 'wp-members'), 'req_label_before' => '<div class="req-text">', 'req_label_after' => '</div>', 'show_clear_form' => false, 'clear_form' => __('Reset Form', 'wp-members'), 'submit_register' => __('Register'), 'submit_update' => __('Update Profile', 'wp-members'), 'strip_breaks' => true, 'use_nonce' => false, 'wrap_inputs' => true, 'n' => "\n", 't' => "\t");
     /**
      * Filter the default form arguments.
      *
      * This filter accepts an array of various elements to replace the form defaults. This
      * includes default tags, labels, text, and small items including various booleans.
      *
      * @since 2.9.0
      *
      * @param array           An array of arguments to merge with defaults. Default null.
      * @param string $toggle  Toggle new registration or profile update. new|edit.
      */
     $args = apply_filters('wpmem_register_form_args', '', $toggle);
     // Merge $args with defaults.
     $args = wp_parse_args($args, $defaults);
     // Username is editable if new reg, otherwise user profile is not.
     if ($toggle == 'edit') {
         // This is the User Profile edit - username is not editable.
         $val = $userdata->user_login;
         $label = '<label for="username" class="text">' . __('Username') . '</label>';
         $input = '<p class="noinput">' . $val . '</p>';
         $field_before = $args['wrap_inputs'] ? '<div class="div_text">' : '';
         $field_after = $args['wrap_inputs'] ? '</div>' : '';
     } else {
         // This is a new registration.
         $val = isset($_POST['log']) ? stripslashes($_POST['log']) : '';
         $label = '<label for="username" class="text">' . __('Choose a Username', 'wp-members') . $args['req_mark'] . '</label>';
         $input = wpmem_create_formfield('log', 'text', $val, '', 'username');
     }
     $field_before = $args['wrap_inputs'] ? '<div class="div_text">' : '';
     $field_after = $args['wrap_inputs'] ? '</div>' : '';
     // Add the username row to the array.
     $rows['username'] = array('order' => 0, 'meta' => 'username', 'type' => 'text', 'value' => $val, 'row_before' => $args['row_before'], 'label' => $label, 'field_before' => $field_before, 'field' => $input, 'field_after' => $field_after, 'row_after' => $args['row_after']);
     /**
      * Filter the array of form fields.
      *
      * The form fields are stored in the WP options table as wpmembers_fields. This
      * filter can filter that array after the option is retreived before the fields
      * are parsed. This allows you to change the fields that may be used in the form
      * on the fly.
      *
      * @since 2.9.0
      *
      * @param array           The array of form fields.
      * @param string $toggle  Toggle new registration or profile update. new|edit.
      */
     $wpmem_fields = apply_filters('wpmem_register_fields_arr', $wpmem->fields, $toggle);
     // Loop through the remaining fields.
     foreach ($wpmem_fields as $field) {
         // Start with a clean row.
         $val = '';
         $label = '';
         $input = '';
         $field_before = '';
         $field_after = '';
         // Skips user selected passwords for profile update.
         $pass_arr = array('password', 'confirm_password', 'password_confirm');
         $do_row = $toggle == 'edit' && in_array($field[2], $pass_arr) ? false : true;
         // Skips tos, makes tos field hidden on user edit page, unless they haven't got a value for tos.
         if ($field[2] == 'tos' && $toggle == 'edit' && get_user_meta($userdata->ID, 'tos', true)) {
             $do_row = false;
             $hidden_tos = wpmem_create_formfield($field[2], 'hidden', get_user_meta($userdata->ID, 'tos', true));
         }
         // If the field is set to display and we aren't skipping, construct the row.
         if ($field[4] == 'y' && $do_row == true) {
             // Label for all but TOS.
             if ($field[2] != 'tos') {
                 $class = $field[3] == 'password' ? 'text' : $field[3];
                 $label = '<label for="' . $field[2] . '" class="' . $class . '">' . __($field[1], 'wp-members');
                 $label = $field[5] == 'y' ? $label . $args['req_mark'] : $label;
                 $label = $label . '</label>';
             }
             // Gets the field value for both edit profile and submitted reg w/ error.
             if ($toggle == 'edit' && $wpmem_regchk != 'updaterr') {
                 switch ($field[2]) {
                     case 'description':
                         $val = htmlspecialchars(get_user_meta($userdata->ID, 'description', 'true'));
                         break;
                     case 'user_email':
                     case 'confirm_email':
                         $val = sanitize_email($userdata->user_email);
                         break;
                     case 'user_url':
                         $val = esc_url($userdata->user_url);
                         break;
                     case 'display_name':
                         $val = sanitize_text_field($userdata->display_name);
                         break;
                     default:
                         $val = sanitize_text_field(get_user_meta($userdata->ID, $field[2], 'true'));
                         break;
                 }
             } else {
                 $val = isset($_POST[$field[2]]) ? $_POST[$field[2]] : '';
             }
             // Does the tos field.
             if ($field[2] == 'tos') {
                 $val = isset($_POST[$field[2]]) ? $_POST[$field[2]] : '';
                 // Should be checked by default? and only if form hasn't been submitted.
                 $val = !$_POST && $field[8] == 'y' ? $field[7] : $val;
                 $input = wpmem_create_formfield($field[2], $field[3], $field[7], $val);
                 $input = $field[5] == 'y' ? $input . $args['req_mark'] : $input;
                 // Determine if TOS is a WP page or not.
                 $tos_content = stripslashes(get_option('wpmembers_tos'));
                 if (wpmem_test_shortcode($tos_content, 'wp-members')) {
                     $link = do_shortcode($tos_content);
                     $tos_pop = '<a href="' . $link . '" target="_blank">';
                 } else {
                     $tos_pop = "<a href=\"#\" onClick=\"window.open('" . WP_PLUGIN_URL . "/wp-members/wp-members-tos.php','mywindow');\">";
                 }
                 /**
                  * Filter the TOS link text.
                  *
                  * @since 2.7.5
                  *
                  * @param string          The link text.
                  * @param string $toggle  Toggle new registration or profile update. new|edit.
                  */
                 $input .= apply_filters('wpmem_tos_link_txt', sprintf(__('Please indicate that you agree to the %s TOS %s', 'wp-members'), $tos_pop, '</a>'), $toggle);
                 // In previous versions, the div class would end up being the same as the row before.
                 $field_before = $args['wrap_inputs'] ? '<div class="div_text">' : '';
                 $field_after = $args['wrap_inputs'] ? '</div>' : '';
             } else {
                 // For checkboxes.
                 if ($field[3] == 'checkbox') {
                     $valtochk = $val;
                     $val = $field[7];
                     // if it should it be checked by default (& only if form not submitted), then override above...
                     if ($field[8] == 'y' && (!$_POST && $toggle != 'edit')) {
                         $val = $valtochk = $field[7];
                     }
                 }
                 // For dropdown select.
                 if ($field[3] == 'select') {
                     $valtochk = $val;
                     $val = $field[7];
                 }
                 if (!isset($valtochk)) {
                     $valtochk = '';
                 }
                 // For all other input types.
                 $input = wpmem_create_formfield($field[2], $field[3], $val, $valtochk);
                 // Determine input wrappers.
                 $field_before = $args['wrap_inputs'] ? '<div class="div_' . $class . '">' : '';
                 $field_after = $args['wrap_inputs'] ? '</div>' : '';
             }
         }
         // If the row is set to display, add the row to the form array.
         if ($field[4] == 'y') {
             $rows[$field[2]] = array('order' => $field[0], 'meta' => $field[2], 'type' => $field[3], 'value' => $val, 'row_before' => $args['row_before'], 'label' => $label, 'field_before' => $field_before, 'field' => $input, 'field_after' => $field_after, 'row_after' => $args['row_after']);
         }
     }
     // If captcha is Really Simple CAPTCHA.
     if ($wpmem->captcha == 2 && $toggle != 'edit') {
         $row = wpmem_build_rs_captcha();
         $rows['captcha'] = array('order' => '', 'meta' => '', 'type' => 'text', 'value' => '', 'row_before' => $args['row_before'], 'label' => $row['label'], 'field_before' => $args['wrap_inputs'] ? '<div class="div_text">' : '', 'field' => $row['field'], 'field_after' => $args['wrap_inputs'] ? '</div>' : '', 'row_after' => $args['row_after']);
     }
     /**
      * Filter the array of form rows.
      *
      * This filter receives an array of the main rows in the form, each array element being
      * an array of that particular row's pieces. This allows making changes to individual 
      * parts of a row without needing to parse through a string of HTML.
      *
      * @since 2.9.0
      *
      * @param array  $rows    An array containing the form rows. 
      * @param string $toggle  Toggle new registration or profile update. new|edit.
      */
     $rows = apply_filters('wpmem_register_form_rows', $rows, $toggle);
     // Put the rows from the array into $form.
     $form = '';
     $enctype = '';
     foreach ($rows as $row_item) {
         $enctype = $row_item['type'] == 'file' ? "multipart/form-data" : $enctype;
         $row = $row_item['row_before'] != '' ? $row_item['row_before'] . $args['n'] . $row_item['label'] . $args['n'] : $row_item['label'] . $args['n'];
         $row .= $row_item['field_before'] != '' ? $row_item['field_before'] . $args['n'] . $args['t'] . $row_item['field'] . $args['n'] . $row_item['field_after'] . $args['n'] : $row_item['field'] . $args['n'];
         $row .= $row_item['row_after'] != '' ? $row_item['row_after'] . $args['n'] : '';
         $form .= $row;
     }
     // Do recaptcha if enabled.
     if (($wpmem->captcha == 1 || $wpmem->captcha == 3) && $toggle != 'edit') {
         // don't show on edit page!
         // Get the captcha options.
         $wpmem_captcha = get_option('wpmembers_captcha');
         // Start with a clean row.
         $row = '';
         $row = '<div class="clear"></div>';
         $row .= '<div align="right" class="captcha">' . wpmem_inc_recaptcha($wpmem_captcha['recaptcha']) . '</div>';
         // Add the captcha row to the form.
         /**
          * Filter the HTML for the CAPTCHA row.
          *
          * @since 2.9.0
          *
          * @param string          The HTML for the entire row (includes HTML tags plus reCAPTCHA).
          * @param string $toggle  Toggle new registration or profile update. new|edit.
          */
         $form .= apply_filters('wpmem_register_captcha_row', $args['row_before'] . $row . $args['row_after'], $toggle);
     }
     // Create hidden fields.
     $var = $toggle == 'edit' ? 'update' : 'register';
     $redirect_to = isset($_REQUEST['redirect_to']) ? esc_url($_REQUEST['redirect_to']) : ($redirect_to ? $redirect_to : get_permalink());
     $hidden = '<input name="a" type="hidden" value="' . $var . '" />' . $args['n'];
     $hidden .= '<input name="redirect_to" type="hidden" value="' . $redirect_to . '" />' . $args['n'];
     if ($redirect_to != get_permalink()) {
         $hidden .= '<input name="wpmem_reg_page" type="hidden" value="' . get_permalink() . '" />' . $args['n'];
     }
     $hidden = isset($hidden_tos) ? $hidden . $hidden_tos . $args['n'] : $hidden;
     /**
      * Filter the hidden field HTML.
      *
      * @since 2.9.0
      *
      * @param string $hidden The generated HTML of hidden fields.
      * @param string $toggle Toggle new registration or profile update. new|edit.
      */
     $hidden = apply_filters('wpmem_register_hidden_fields', $hidden, $toggle);
     // Add the hidden fields to the form.
     $form .= $hidden;
     // Create buttons and wrapper.
     $button_text = $toggle == 'edit' ? $args['submit_update'] : $args['submit_register'];
     $buttons = $args['show_clear_form'] ? '<input name="reset" type="reset" value="' . $args['clear_form'] . '" class="' . $args['button_class'] . '" /> ' . $args['n'] : '';
     $buttons .= '<input name="submit" type="submit" value="' . $button_text . '" class="' . $args['button_class'] . '" />' . $args['n'];
     /**
      * Filter the HTML for form buttons.
      *
      * The string passed through the filter includes the buttons, as well as the HTML wrapper elements.
      *
      * @since 2.9.0
      *
      * @param string $buttons The generated HTML of the form buttons.
      * @param string $toggle  Toggle new registration or profile update. new|edit.
      */
     $buttons = apply_filters('wpmem_register_form_buttons', $buttons, $toggle);
     // Add the buttons to the form.
     $form .= $args['buttons_before'] . $args['n'] . $buttons . $args['buttons_after'] . $args['n'];
     // Add the required field notation to the bottom of the form.
     $form .= $args['req_label_before'] . $args['req_label'] . $args['req_label_after'];
     // Apply the heading.
     /**
      * Filter the registration form heading.
      *
      * @since 2.8.2
      *
      * @param string $str
      * @param string $toggle Toggle new registration or profile update. new|edit.
      */
     $heading = !$heading ? apply_filters('wpmem_register_heading', __('New User Registration', 'wp-members'), $toggle) : $heading;
     $form = $args['heading_before'] . $heading . $args['heading_after'] . $args['n'] . $form;
     // Apply fieldset wrapper.
     $form = $args['fieldset_before'] . $args['n'] . $form . $args['n'] . $args['fieldset_after'];
     // Apply attribution if enabled.
     $form = $form . wpmem_inc_attribution();
     // Apply nonce.
     $form = defined('WPMEM_USE_NONCE') || $args['use_nonce'] ? wp_nonce_field('wpmem-validate-submit', 'wpmem-form-submit') . $args['n'] . $form : $form;
     // Apply form wrapper.
     $enctype = $enctype == 'multipart/form-data' ? ' enctype="multipart/form-data"' : '';
     $post_to = $redirect_to ? $redirect_to : get_permalink();
     $form = '<form name="form" method="post"' . $enctype . ' action="' . $post_to . '" id="' . $args['form_id'] . '" class="' . $args['form_class'] . '">' . $args['n'] . $form . $args['n'] . '</form>';
     // Apply anchor.
     $form = '<a name="register"></a>' . $args['n'] . $form;
     // Apply main div wrapper.
     $form = $args['main_div_before'] . $args['n'] . $form . $args['n'] . $args['main_div_after'] . $args['n'];
     // Apply wpmem_txt wrapper.
     $form = $args['txt_before'] . $form . $args['txt_after'];
     // Remove line breaks if enabled for easier filtering later.
     $form = $args['strip_breaks'] ? str_replace(array("\n", "\r", "\t"), array('', '', ''), $form) : $form;
     /**
      * Filter the generated HTML of the entire form.
      *
      * @since 2.7.4
      *
      * @param string $form   The HTML of the final generated form.
      * @param string $toggle Toggle new registration or profile update. new|edit.
      * @param array  $rows   The rows array
      * @param string $hidden The HTML string of hidden fields
      */
     $form = apply_filters('wpmem_register_form', $form, $toggle, $rows, $hidden);
     /**
      * Filter before the form.
      *
      * This rarely used filter allows you to stick any string onto the front of
      * the generated form.
      *
      * @since 2.7.4
      *
      * @param string $str    The HTML to add before the form. Default null.
      * @param string $toggle Toggle new registration or profile update. new|edit.
      */
     $form = apply_filters('wpmem_register_form_before', '', $toggle) . $form;
     // Return the generated form.
     return $form;
 }
Пример #2
0
 /**
  * The Securify Content Filter
  *
  * This is the primary function that picks up where wpmem() leaves off.
  * Determines whether content is shown or hidden for both post and
  * pages.
  *
  * @since 2.0
  *
  * @uses apply_filters Calls 'wpmem_securify'
  *
  * @global var    $wpmem_a the action variable received from wpmem()
  * @global string $wpmem_regchk contains messages returned from wpmem() action functions
  * @global string $wpmem_themsg contains messages to be output
  * @global string $wpmem_captcha_err contains error message for reCAPTCHA
  * @global array  $post needed for protecting comments
  * @param  string $content
  * @return $content
  */
 function wpmem_securify($content = null)
 {
     $content = is_single() || is_page() ? $content : wpmem_do_excerpt($content);
     if (!wpmem_test_shortcode()) {
         global $wpmem_regchk, $wpmem_themsg, $wpmem_a;
         if ($wpmem_regchk == "captcha") {
             global $wpmem_captcha_err;
             $wpmem_themsg = __('There was an error with the CAPTCHA form.') . '<br /><br />' . $wpmem_captcha_err;
         }
         // Block/unblock Posts
         if (!is_user_logged_in() && wpmem_block() == true) {
             // protects comments if user is not logged in
             global $post;
             $post->post_password = apply_filters('wpmem_post_password', wp_generate_password());
             include_once 'wp-members-dialogs.php';
             // show the login and registration forms
             if ($wpmem_regchk) {
                 // empty content in any of these scenarios
                 $content = '';
                 switch ($wpmem_regchk) {
                     case "loginfailed":
                         $content = wpmem_inc_loginfailed();
                         break;
                     case "success":
                         $content = wpmem_inc_regmessage($wpmem_regchk, $wpmem_themsg);
                         $content = $content . wpmem_inc_login();
                         break;
                     default:
                         $content = wpmem_inc_regmessage($wpmem_regchk, $wpmem_themsg);
                         $content = $content . wpmem_inc_registration();
                         break;
                 }
             } else {
                 // toggle shows excerpt above login/reg on posts/pages
                 if (WPMEM_SHOW_EXCERPT == 1) {
                     if (!stristr($content, '<span id="more')) {
                         $content = wpmem_do_excerpt($content);
                     } else {
                         $len = strpos($content, '<span id="more');
                         $content = substr($content, 0, $len);
                     }
                 } else {
                     // empty all content
                     $content = '';
                 }
                 $content = $content . wpmem_inc_login();
                 $content = WPMEM_NO_REG != 1 ? $content . wpmem_inc_registration() : $content;
             }
             // Protects comments if expiration module is used and user is expired
         } elseif (is_user_logged_in() && wpmem_block() == true) {
             $content = WPMEM_USE_EXP == 1 ? wpmem_do_expmessage($content) : $content;
         }
     }
     $content = apply_filters('wpmem_securify', $content);
     return $content;
 }
 /**
  * The Securify Content Filter
  *
  * This is the primary function that picks up where wpmem() leaves off.
  * Determines whether content is shown or hidden for both post and
  * pages.
  *
  * @since 2.0
  *
  * @global var    $wpmem_a the action variable received from wpmem()
  * @global string $wpmem_regchk contains messages returned from wpmem() action functions
  * @global string $wpmem_themsg contains messages to be output
  * @global string $wpmem_captcha_err contains error message for reCAPTCHA
  * @global array  $post needed for protecting comments
  * @param  string $content
  * @return string $content
  */
 function wpmem_securify($content = null)
 {
     $content = is_single() || is_page() ? $content : wpmem_do_excerpt($content);
     if (!wpmem_test_shortcode($content, 'wp-members')) {
         global $wpmem_regchk, $wpmem_themsg, $wpmem_a;
         if ($wpmem_regchk == "captcha") {
             global $wpmem_captcha_err;
             $wpmem_themsg = __('There was an error with the CAPTCHA form.') . '<br /><br />' . $wpmem_captcha_err;
         }
         // Block/unblock Posts
         if (!is_user_logged_in() && wpmem_block() == true) {
             // protects comments if user is not logged in
             global $post;
             /**
              * Filter the post password.
              *
              * @since 2.8.0
              *
              * @param string The autogenerated post password.
              */
             $post->post_password = apply_filters('wpmem_post_password', wp_generate_password());
             include_once WPMEM_PATH . 'wp-members-dialogs.php';
             // show the login and registration forms
             if ($wpmem_regchk) {
                 // empty content in any of these scenarios
                 $content = '';
                 switch ($wpmem_regchk) {
                     case "loginfailed":
                         $content = wpmem_inc_loginfailed();
                         break;
                     case "success":
                         $content = wpmem_inc_regmessage($wpmem_regchk, $wpmem_themsg);
                         $content = $content . wpmem_inc_login();
                         break;
                     default:
                         $content = wpmem_inc_regmessage($wpmem_regchk, $wpmem_themsg);
                         $content = $content . wpmem_inc_registration();
                         break;
                 }
             } else {
                 // toggle shows excerpt above login/reg on posts/pages
                 if (WPMEM_SHOW_EXCERPT == 1) {
                     if (!stristr($content, '<span id="more')) {
                         $content = wpmem_do_excerpt($content);
                     } else {
                         $len = strpos($content, '<span id="more');
                         $content = substr($content, 0, $len);
                     }
                 } else {
                     // empty all content
                     $content = '';
                 }
                 $content = $content . wpmem_inc_login();
                 $content = WPMEM_NO_REG != 1 ? $content . wpmem_inc_registration() : $content;
             }
             // Protects comments if expiration module is used and user is expired
         } elseif (is_user_logged_in() && wpmem_block() == true) {
             $content = WPMEM_USE_EXP == 1 && function_exists('wpmem_do_expmessage') ? wpmem_do_expmessage($content) : $content;
         }
     }
     /**
      * Filter the value of $content after wpmem_securify has run.
      *
      * @since 2.7.7
      *
      * @param string $content The content after securify has run.
      */
     $content = apply_filters('wpmem_securify', $content);
     if (strstr($content, '[wpmem_txt]')) {
         // fix the wptexturize
         remove_filter('the_content', 'wpautop');
         remove_filter('the_content', 'wptexturize');
         add_filter('the_content', 'wpmem_texturize', 99);
     }
     return $content;
 }
Пример #4
0
 /**
  * The Securify Content Filter.
  *
  * This is the primary function that picks up where get_action() leaves off.
  * Determines whether content is shown or hidden for both post and pages.
  *
  * @since 3.0
  *
  * @global string $wpmem_themsg      Contains messages to be output.
  * @global string $wpmem_captcha_err Contains error message for reCAPTCHA.
  * @global object $post              The post object.
  * @param  string $content
  * @return string $content
  */
 function do_securify($content = null)
 {
     global $wpmem_themsg, $post;
     $content = is_single() || is_page() ? $content : wpmem_do_excerpt($content);
     if (!wpmem_test_shortcode($content, 'wp-members')) {
         if ($this->regchk == "captcha") {
             global $wpmem_captcha_err;
             $wpmem_themsg = __('There was an error with the CAPTCHA form.') . '<br /><br />' . $wpmem_captcha_err;
         }
         // Block/unblock Posts.
         if (!is_user_logged_in() && $this->is_blocked() == true) {
             include_once WPMEM_PATH . 'inc/dialogs.php';
             //Show the login and registration forms.
             if ($this->regchk) {
                 // Empty content in any of these scenarios.
                 $content = '';
                 switch ($this->regchk) {
                     case "loginfailed":
                         $content = wpmem_inc_loginfailed();
                         break;
                     case "success":
                         $content = wpmem_inc_regmessage($this->regchk, $wpmem_themsg);
                         $content = $content . wpmem_inc_login();
                         break;
                     default:
                         $content = wpmem_inc_regmessage($this->regchk, $wpmem_themsg);
                         $content = $content . wpmem_inc_registration();
                         break;
                 }
             } else {
                 // Toggle shows excerpt above login/reg on posts/pages.
                 global $wp_query;
                 if (isset($wp_query->query_vars['page']) && $wp_query->query_vars['page'] > 1) {
                     // Shuts down excerpts on multipage posts if not on first page.
                     $content = '';
                 } elseif ($this->show_excerpt[$post->post_type] == 1) {
                     if (!stristr($content, '<span id="more')) {
                         $content = wpmem_do_excerpt($content);
                     } else {
                         $len = strpos($content, '<span id="more');
                         $content = substr($content, 0, $len);
                     }
                 } else {
                     // Empty all content.
                     $content = '';
                 }
                 $content = $this->show_login[$post->post_type] == 1 ? $content . wpmem_inc_login() : $content . wpmem_inc_login('page', '', 'hide');
                 $content = $this->show_reg[$post->post_type] == 1 ? $content . wpmem_inc_registration() : $content;
             }
             // Protects comments if expiration module is used and user is expired.
         } elseif (is_user_logged_in() && $this->is_blocked() == true) {
             $content = $this->use_exp == 1 && function_exists('wpmem_do_expmessage') ? wpmem_do_expmessage($content) : $content;
         }
     }
     /**
      * Filter the value of $content after wpmem_securify has run.
      *
      * @since 2.7.7
      *
      * @param string $content The content after securify has run.
      */
     $content = apply_filters('wpmem_securify', $content);
     if (strstr($content, '[wpmem_txt]')) {
         // Fix the wptexturize.
         remove_filter('the_content', 'wpautop');
         remove_filter('the_content', 'wptexturize');
         add_filter('the_content', 'wpmem_texturize', 99);
     }
     return $content;
 }