Plugin Directory

Changeset 3303056


Ignore:
Timestamp:
05/29/2025 02:57:59 PM (10 months ago)
Author:
avi.megladon
Message:

Bug fixes

Location:
wp-register-profile-with-shortcode
Files:
77 added
3 edited

Legend:

Unmodified
Added
Removed
  • wp-register-profile-with-shortcode/trunk/readme.txt

    r3018102 r3303056  
    44Tags: register, responsive user registration, wp register, profile, register widget, widget, user register, register user, responsive form, responsive register form, custom fields, profile image, date, time, user image, custom profile fields, profile data
    55Requires at least: 2.0.2
    6 Tested up to: 6.4.2
    7 Stable tag: 3.6.0
     6Tested up to: 6.8.1
     7Stable tag: 3.6.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8989== Changelog ==
    9090
     91= 3.6.1 =
     92* Bug fixes.
     93
    9194= 3.6.0 =
    9295* Bug fixes and improvements.
  • wp-register-profile-with-shortcode/trunk/register-widget-shortcode.php

    r2393730 r3303056  
    11<?php
    22
    3 function register_widget_shortcode( $atts ) {
    4      global $post;
    5      extract( shortcode_atts( array(
    6           'title' => '',
    7      ), $atts ) );
    8      
    9     ob_start();
    10     if($title){
    11         echo '<h2>'.$title.'</h2>';
    12     }
    13     $rf = new Register_Form;
    14     $rf->registration_form();
    15     $ret = ob_get_contents();   
    16     ob_end_clean();
    17     return $ret;
     3function register_widget_shortcode($atts)
     4{
     5    global $post;
     6    extract(shortcode_atts([
     7        'title' => '',
     8    ], $atts));
     9
     10    ob_start();
     11    if ($title) {
     12        echo '<h2>' . $title . '</h2>';
     13    }
     14    $rf = new Register_Form;
     15    $rf->registration_form();
     16    $ret = ob_get_contents();
     17    ob_end_clean();
     18    return $ret;
    1819}
    1920
    20 function user_profile_edit_shortcode( $atts ) {
    21      global $post;
    22      extract( shortcode_atts( array(
    23           'title' => '',
    24      ), $atts ) );
    25      
    26     ob_start();
    27     $pea = new Register_Profile_Edit;
    28     if($title){
    29         echo '<h2>'.$title.'</h2>';
    30     }
    31     $pea->profile_edit();
    32     $ret = ob_get_contents();   
    33     ob_end_clean();
    34     return $ret;
     21function user_profile_edit_shortcode($atts)
     22{
     23    global $post;
     24    extract(shortcode_atts([
     25        'title' => '',
     26    ], $atts));
     27
     28    ob_start();
     29    $pea = new Register_Profile_Edit;
     30    if ($title) {
     31        echo '<h2>' . $title . '</h2>';
     32    }
     33    $pea->profile_edit();
     34    $ret = ob_get_contents();
     35    ob_end_clean();
     36    return $ret;
    3537}
    3638
    37 function update_password_shortcode( $atts ) {
    38      global $post;
    39      extract( shortcode_atts( array(
    40           'title' => '',
    41      ), $atts ) );
    42      
    43     ob_start();
    44     $up = new Register_Update_Password;
    45     if($title){
    46         echo '<h2>'.$title.'</h2>';
    47     }
    48     $up->update_password_form();
    49     $ret = ob_get_contents();   
    50     ob_end_clean();
    51     return $ret;
     39function update_password_shortcode($atts)
     40{
     41    global $post;
     42    extract(shortcode_atts([
     43        'title' => '',
     44    ], $atts));
     45
     46    ob_start();
     47    $up = new Register_Update_Password;
     48    if ($title) {
     49        echo '<h2>' . $title . '</h2>';
     50    }
     51    $up->update_password_form();
     52    $ret = ob_get_contents();
     53    ob_end_clean();
     54    return $ret;
    5255}
    5356
    54 function wprp_get_user_data( $atts ) {
    55      global $post;
    56      extract( shortcode_atts( array(
    57           'field' => '',
    58           'user_id' => '',
    59      ), $atts ) );
    60      
    61      $error = false;
    62      if( empty($atts['user_id']) and is_user_logged_in()){
    63         $user_id = get_current_user_id();
    64      } elseif( !empty($atts['user_id'])){
    65         $user_id = $atts['user_id'];
    66      } else if( empty($atts['user_id']) and !is_user_logged_in() ){
    67         $error = true;
    68      }
    69      if(!$error){
    70         $ret = get_the_author_meta( $atts['field'], $user_id );
    71      } else {
    72         $ret = __('Sorry. no user was found!','wp-register-profile-with-shortcode');
    73      }
    74        
    75      return $ret;
     57function wprp_get_user_data($atts)
     58{
     59    global $post, $wrrp_na_fields;
     60    extract(shortcode_atts([
     61        'field'   => '',
     62        'user_id' => '',
     63    ], $atts));
     64
     65    $error = false;
     66    if (empty($atts['user_id']) and is_user_logged_in()) {
     67        $user_id = get_current_user_id();
     68    } elseif (! empty($atts['user_id'])) {
     69        $user_id = $atts['user_id'];
     70    } else if (empty($atts['user_id']) and ! is_user_logged_in()) {
     71        $error = true;
     72    }
     73    if (is_array($wrrp_na_fields) and in_array($atts['field'], $wrrp_na_fields)) {
     74        $error = true;
     75    }
     76    if (! $error) {
     77        $ret = get_the_author_meta($atts['field'], $user_id);
     78    } else {
     79        $ret = __('Sorry. no user was found!', 'wp-register-profile-with-shortcode');
     80    }
     81
     82    return $ret;
    7683}
    7784
    78 function rp_user_data_func($field='',$user_id=''){
    79     echo do_shortcode('[rp_user_data field="'.$field.'" user_id="'.$user_id.'"]');
     85function rp_user_data_func($field = '', $user_id = '')
     86{
     87    echo do_shortcode('[rp_user_data field="' . $field . '" user_id="' . $user_id . '"]');
    8088}
  • wp-register-profile-with-shortcode/trunk/register.php

    r3018102 r3303056  
    44Plugin URI: https://wordpress.org/plugins/wp-register-profile-with-shortcode/
    55Description: This is a simple registration form in the widget. just install the plugin and add the register widget in the sidebar. Thats it. :)
    6 Version: 3.6.0
     6Version: 3.6.1
    77Text Domain: wp-register-profile-with-shortcode
    88Domain Path: /languages
     
    3737        exit;
    3838    }
     39
     40    global $wrrp_na_fields;
     41    $wrrp_na_fields[] = 'user_pass';
     42
    3943    include_once WPRPWS_DIR_PATH . '/includes/class-settings.php';
    4044    include_once WPRPWS_DIR_PATH . '/includes/class-scripts.php';
Note: See TracChangeset for help on using the changeset viewer.