| 1 |
<?php |
| 2 |
/** |
| 3 |
* WP-Members Deprecated Functions |
| 4 |
* |
| 5 |
* These functions have been deprecated and are now obsolete. |
| 6 |
* Use alternative functions as these will be removed in a |
| 7 |
* future release. |
| 8 |
* |
| 9 |
* This file is part of the WP-Members plugin by Chad Butler |
| 10 |
* You can find out more about this plugin at https://rocketgeek.com |
| 11 |
* Copyright (c) 2006-2026 Chad Butler |
| 12 |
* WP-Members(tm) is a trademark of butlerblog.com |
| 13 |
* |
| 14 |
* @package WP-Members |
| 15 |
* @author Chad Butler |
| 16 |
* @copyright 2006-2026 |
| 17 |
*/ |
| 18 |
|
| 19 |
// Exit if accessed directly. |
| 20 |
if ( ! defined( 'ABSPATH' ) ) { |
| 21 |
exit(); |
| 22 |
} |
| 23 |
|
| 24 |
if ( ! function_exists( 'wpmem_selected' ) ): |
| 25 |
/** |
| 26 |
* Determines if a form field is selected (i.e. lists & checkboxes). |
| 27 |
* |
| 28 |
* @since 0.1.0 |
| 29 |
* @deprecated 3.1.0 Use selected() or checked() instead. |
| 30 |
* |
| 31 |
* @param string $value |
| 32 |
* @param string $valtochk |
| 33 |
* @param string $type |
| 34 |
* @return string $issame |
| 35 |
*/ |
| 36 |
function wpmem_selected( $value, $valtochk, $type = null ) { |
| 37 |
wpmem_write_log( "wpmem_selected() is deprecated as of WP-Members 3.1.0. Use selected() or checked() instead" ); |
| 38 |
$issame = ( $type == 'select' ) ? ' selected' : ' checked'; |
| 39 |
return ( $value == $valtochk ) ? $issame : ''; |
| 40 |
} |
| 41 |
endif; |
| 42 |
|
| 43 |
if ( ! function_exists( 'wpmem_inc_status' ) ): |
| 44 |
/** |
| 45 |
* Generate users login status if logged in and gives logout link. |
| 46 |
* |
| 47 |
* @since 1.8 |
| 48 |
* @deprecated 3.2.0 |
| 49 |
* |
| 50 |
* @global $user_login |
| 51 |
* @global object $wpmem |
| 52 |
* @return string $status |
| 53 |
*/ |
| 54 |
function wpmem_inc_status() { |
| 55 |
|
| 56 |
wpmem_write_log( "wpmem_inc_status() is deprecated in WP-Members 3.2.0. Use wpmem_login_status() instead." ); |
| 57 |
|
| 58 |
global $user_login, $wpmem; |
| 59 |
|
| 60 |
/** This filter is defined in /includes/api/api.php */ |
| 61 |
$logout = apply_filters( 'wpmem_logout_link', $url . '/?a=logout' ); |
| 62 |
|
| 63 |
$status = '<p>' . esc_html( sprintf( wpmem_get_text( 'sb_login_status' ) ), $user_login ) |
| 64 |
. ' | <a href="' . esc_url_raw( $logout ) . '">' . wpmem_get_text( 'sb_logout_link' ) . '</a></p>'; |
| 65 |
|
| 66 |
return $status; |
| 67 |
} |
| 68 |
endif; |
| 69 |
|
| 70 |
if ( ! function_exists( 'wpmem_do_sidebar' ) ): |
| 71 |
/** |
| 72 |
* Creates the sidebar login form and status. |
| 73 |
* |
| 74 |
* This function determines if the user is logged in and displays either |
| 75 |
* a login form, or the user's login status. Typically used for a sidebar. |
| 76 |
* You can call this directly, or with the widget. |
| 77 |
* |
| 78 |
* @since 2.4.0 |
| 79 |
* @since 3.0.0 Added $post_to argument. |
| 80 |
* @since 3.1.0 Changed $post_to to $redirect_to. |
| 81 |
* @deprecated 3.2.0 Use widget_wpmemwidget::do_sidebar() instead. |
| 82 |
* |
| 83 |
* @param string $redirect_to A URL to redirect to upon login, default null. |
| 84 |
* @global string $wpmem_regchk |
| 85 |
* @global string $user_login |
| 86 |
*/ |
| 87 |
function wpmem_do_sidebar( $redirect_to = null ) { |
| 88 |
wpmem_write_log( "wpmem_do_sidebar() is deprecated in WP-Members 3.2.0. Use wpmem_login_status() instead." ); |
| 89 |
widget_wpmemwidget::do_sidebar( $redirect_to ); |
| 90 |
} |
| 91 |
endif; |
| 92 |
|
| 93 |
if ( ! function_exists( 'wpmem_create_formfield' ) ): |
| 94 |
/** |
| 95 |
* Creates form fields |
| 96 |
* |
| 97 |
* Creates various form fields and returns them as a string. |
| 98 |
* |
| 99 |
* @since 1.8.0 |
| 100 |
* @since 3.1.0 Converted to wrapper for create_form_field() in utlities object. |
| 101 |
* @deprecated 3.2.0 Use wpmem_form_field() instead. |
| 102 |
* |
| 103 |
* @global object $wpmem The WP_Members object class. |
| 104 |
* @param string $name The name of the field. |
| 105 |
* @param string $type The field type. |
| 106 |
* @param string $value The default value for the field. |
| 107 |
* @param string $valtochk Optional for comparing the default value of the field. |
| 108 |
* @param string $class Optional for setting a specific CSS class for the field. |
| 109 |
* @return string $str The field returned as a string. |
| 110 |
*/ |
| 111 |
function wpmem_create_formfield( $name, $type, $value, $valtochk=null, $class='textbox' ) { |
| 112 |
$args = array( |
| 113 |
'name' => $name, |
| 114 |
'type' => $type, |
| 115 |
'value' => $value, |
| 116 |
'compare' => $valtochk, |
| 117 |
'class' => $class, |
| 118 |
); |
| 119 |
return wpmem_form_field( $args ); |
| 120 |
} |
| 121 |
endif; |
| 122 |
|
| 123 |
/** |
| 124 |
* Adds the successful registration message on the login page if reg_nonce validates. |
| 125 |
* |
| 126 |
* @since 3.1.7 |
| 127 |
* @deprecated 3.2.0 Use $wpmem->reg_securify() instead. |
| 128 |
* |
| 129 |
* @param string $content |
| 130 |
* @return string $content |
| 131 |
*/ |
| 132 |
function wpmem_reg_securify( $content ) { |
| 133 |
global $wpmem, $wpmem_themsg; |
| 134 |
$nonce = wpmem_get( 'reg_nonce', false, 'get' ); |
| 135 |
if ( $nonce && wp_verify_nonce( $nonce, 'register_redirect' ) ) { |
| 136 |
$content = wpmem_get_display_message( 'success', $wpmem_themsg ); |
| 137 |
$content = $content . wpmem_login_form(); |
| 138 |
} |
| 139 |
return $content; |
| 140 |
} |
| 141 |
|
| 142 |
if ( ! function_exists( 'wpmem_inc_regemail' ) ): |
| 143 |
/** |
| 144 |
* Builds emails for the user. |
| 145 |
* |
| 146 |
* @since 1.8.0 |
| 147 |
* @since 2.7.4 Added wpmem_email_headers and individual body/subject filters. |
| 148 |
* @since 2.9.7 Major overhaul, added wpmem_email_filter filter. |
| 149 |
* @since 3.1.0 Can filter in custom shortcodes with wpmem_email_shortcodes. |
| 150 |
* @since 3.1.1 Added $custom argument for custom emails. |
| 151 |
* @deprecated 3.2.0 Use wpmem_email_to_user() instead. |
| 152 |
* |
| 153 |
* @global object $wpmem The WP_Members object. |
| 154 |
* @global string $wpmem_mail_from The email from address. |
| 155 |
* @global string $wpmem_mail_from_name The email from name. |
| 156 |
* @param int $user_ID The User's ID. |
| 157 |
* @param string $password Password from the registration process. |
| 158 |
* @param string $toggle Toggle indicating the email being sent (newreg|newmod|appmod|repass|getuser). |
| 159 |
* @param array $wpmem_fields Array of the WP-Members fields (defaults to null). |
| 160 |
* @param array $fields Array of the registration data (defaults to null). |
| 161 |
* @param array $custom Array of custom email information (defaults to null). |
| 162 |
*/ |
| 163 |
function wpmem_inc_regemail( $user_id, $password, $toggle, $wpmem_fields = null, $field_data = null, $custom = null ) { |
| 164 |
global $wpmem; |
| 165 |
wpmem_write_log( "wpmem_inc_regemail() is deprecated since WP-Members 3.2.0. Use wpmem_email_to_user() instead" ); |
| 166 |
wpmem_email_to_user( $user_id, $password, $toggle, $wpmem_fields, $field_data, $custom ); |
| 167 |
return; |
| 168 |
} |
| 169 |
endif; |
| 170 |
|
| 171 |
if ( ! function_exists( 'wpmem_check_activated' ) ): |
| 172 |
/** |
| 173 |
* Checks if a user is activated. |
| 174 |
* |
| 175 |
* @since 2.7.1 |
| 176 |
* @deprecated 3.2.2 Use wpmem_is_user_activated() instead. |
| 177 |
* |
| 178 |
* @param object $user The WordPress User object. |
| 179 |
* @param string $username The user's username (user_login). |
| 180 |
* @param string $password The user's password. |
| 181 |
* @return object $user The WordPress User object. |
| 182 |
*/ |
| 183 |
function wpmem_check_activated( $user, $username, $password ) { |
| 184 |
wpmem_write_log( "wpmem_check_activated() is deprecated since WP-Members 3.2.2. Use wpmem_is_user_activated() instead" ); |
| 185 |
global $wpmem; |
| 186 |
$user = $wpmem->user->check_activated( $user, $username, $password ); |
| 187 |
return $user; |
| 188 |
} |
| 189 |
endif; |
| 190 |
|
| 191 |
/** |
| 192 |
* Activates a user. |
| 193 |
* |
| 194 |
* If registration is moderated, sets the activated flag |
| 195 |
* in the usermeta. Flag prevents login when $wpmem->mod_reg |
| 196 |
* is true (1). Function is fired from bulk user edit or |
| 197 |
* user profile update. |
| 198 |
* |
| 199 |
* @since 2.4 |
| 200 |
* @since 3.1.6 Dependencies now loaded by object. |
| 201 |
* @deprecated 3.2.4 Use wpmem_activate_user(). |
| 202 |
* |
| 203 |
* @param int $user_id |
| 204 |
* @param bool $chk_pass |
| 205 |
* @uses $wpdb WordPress Database object. |
| 206 |
*/ |
| 207 |
function wpmem_a_activate_user( $user_id, $chk_pass = false ) { |
| 208 |
wpmem_write_log( "wpmem_a_activate_user() is deprecated as of WP-Members 3.2.4. Use wpmem_activate_user instead" ); |
| 209 |
wpmem_activate_user( $user_id ); |
| 210 |
} |
| 211 |
|
| 212 |
/** |
| 213 |
* Deactivates a user. |
| 214 |
* |
| 215 |
* Reverses the active flag from the activation process |
| 216 |
* preventing login when registration is moderated. |
| 217 |
* |
| 218 |
* @since 2.7.1 |
| 219 |
* @depreacted 3.2.4 Use wpmem_deactivate_user(). |
| 220 |
* |
| 221 |
* @param int $user_id |
| 222 |
*/ |
| 223 |
function wpmem_a_deactivate_user( $user_id ) { |
| 224 |
wpmem_write_log( "wpmem_a_deactivate_user() is deprecated as of WP-Members 3.2.4. Use wpmem_deactivate_user instead" ); |
| 225 |
wpmem_deactivate_user( $user_id ); |
| 226 |
} |
| 227 |
|
| 228 |
if ( ! function_exists( 'wpmem_inc_changepassword' ) ): |
| 229 |
/** |
| 230 |
* Change Password Dialog. |
| 231 |
* |
| 232 |
* Loads the form for changing password. |
| 233 |
* |
| 234 |
* @since 2.0.0 |
| 235 |
* @since 3.2.0 Now an alias for $wpmem->forms->do_changepassword_form() |
| 236 |
* @deprecated 3.3.0 Use wpmem_change_password_form() instead. |
| 237 |
* |
| 238 |
* @global object $wpmem The WP_Members object. |
| 239 |
* @return string $str The generated html for the change password form. |
| 240 |
*/ |
| 241 |
function wpmem_inc_changepassword() { |
| 242 |
wpmem_write_log( "wpmem_inc_changepassword() is deprecated as of WP-Members 3.3.0. Use wpmem_inc_changepassword() instead" ); |
| 243 |
return wpmem_changepassword_form(); |
| 244 |
} |
| 245 |
endif; |
| 246 |
|
| 247 |
|
| 248 |
if ( ! function_exists( 'wpmem_inc_resetpassword' ) ): |
| 249 |
/** |
| 250 |
* Reset Password Dialog. |
| 251 |
* |
| 252 |
* Loads the form for resetting password. |
| 253 |
* |
| 254 |
* @since 2.1.0 |
| 255 |
* @since 3.2.0 Now an alias for $wpmem->forms->do_resetpassword_form() |
| 256 |
* @deprecated 3.3.0 Use wpmem_reset_password_form() instead. |
| 257 |
* |
| 258 |
* @global object $wpmem The WP_Members object. |
| 259 |
* @return string $str The generated html fo the reset password form. |
| 260 |
*/ |
| 261 |
function wpmem_inc_resetpassword() { |
| 262 |
wpmem_write_log( "wpmem_inc_resetpassword() is deprecated as of WP-Members 3.3.0. Use wpmem_inc_resetpassword() instead" ); |
| 263 |
return wpmem_reset_password_form(); |
| 264 |
} |
| 265 |
endif; |
| 266 |
|
| 267 |
/** |
| 268 |
* Forgot Username Form. |
| 269 |
* |
| 270 |
* Loads the form for retrieving a username. |
| 271 |
* |
| 272 |
* @since 3.0.8 |
| 273 |
* @since 3.2.0 Moved to forms.php. |
| 274 |
* @deprecated 3.3.0 Use wpmem_forgot_username_form() instead. |
| 275 |
* |
| 276 |
* @global object $wpmem The WP_Members object class. |
| 277 |
* @return string $str The generated html for the forgot username form. |
| 278 |
*/ |
| 279 |
function wpmem_inc_forgotusername() { |
| 280 |
wpmem_write_log( "wpmem_inc_forgotusername() is deprecated as of WP-Members 3.3.0. Use wpmem_forgot_username_form() instead" ); |
| 281 |
return wpmem_forgot_username_form(); |
| 282 |
} |
| 283 |
|
| 284 |
if ( ! function_exists( 'wpmem_inc_recaptcha' ) ): |
| 285 |
/** |
| 286 |
* Create reCAPTCHA form. |
| 287 |
* |
| 288 |
* @since 2.6.0 |
| 289 |
* @deprecated 3.3.0 Use WP_Members_Captcha::show( 'captcha_v2' ) instead. |
| 290 |
* |
| 291 |
* @param array $arr |
| 292 |
* @return string $str HTML for reCAPTCHA display. |
| 293 |
*/ |
| 294 |
function wpmem_inc_recaptcha( $arr ) { |
| 295 |
wpmem_write_log( "wpmem_inc_recaptcha() is deprecated as of WP-Members 3.3.0." ); |
| 296 |
return WP_Members_Captcha::recaptcha(); |
| 297 |
} |
| 298 |
endif; |
| 299 |
|
| 300 |
/** |
| 301 |
* Create Really Simple CAPTCHA. |
| 302 |
* |
| 303 |
* @since 2.9.5 |
| 304 |
* @deprecated 3.3.0 Use WP_Members_Captcha::show( 'rs_captcha' ) instead. |
| 305 |
* |
| 306 |
* @global object $wpmem The WP_Members object. |
| 307 |
* @return array { |
| 308 |
* HTML Form elements for Really Simple CAPTCHA. |
| 309 |
* |
| 310 |
* @type string label_text The raw text used for the label. |
| 311 |
* @type string label The HTML for the label. |
| 312 |
* @type string field The input tag and the CAPTCHA image. |
| 313 |
* } |
| 314 |
*/ |
| 315 |
function wpmem_build_rs_captcha() { |
| 316 |
wpmem_write_log( "wpmem_build_rs_captcha() is deprecated as of WP-Members 3.3.0." ); |
| 317 |
return ( defined( 'REALLYSIMPLECAPTCHA_VERSION' ) ) ? WP_Members_Captcha::show( 'rs_captcha' ) : ''; |
| 318 |
} |
| 319 |
|
| 320 |
/** |
| 321 |
* Load constants deprecated in 3.3.0 |
| 322 |
* |
| 323 |
* @since 3.3.0 |
| 324 |
*/ |
| 325 |
add_action( 'wpmem_after_init', 'wpmem_load_deprecated_constants' ); |
| 326 |
function wpmem_load_deprecated_constants() { |
| 327 |
global $wpmem; |
| 328 |
( ! defined( 'WPMEM_CSSURL' ) ) ? define( 'WPMEM_CSSURL', $wpmem->cssurl ) : ''; |
| 329 |
} |
| 330 |
|
| 331 |
if ( ! function_exists( 'wpmem_registration' ) ): |
| 332 |
/** |
| 333 |
* Register function. |
| 334 |
* |
| 335 |
* Handles registering new users and updating existing users. |
| 336 |
* |
| 337 |
* @since 2.2.1 |
| 338 |
* @since 2.7.2 Added pre/post process actions. |
| 339 |
* @since 2.8.2 Added validation and data filters. |
| 340 |
* @since 2.9.3 Added validation for multisite. |
| 341 |
* @since 3.0.0 Moved from wp-members-register.php to /inc/register.php. |
| 342 |
* @deprecated 3.3.0 Use wpmem_user_register() instead. |
| 343 |
* |
| 344 |
* @global int $user_ID |
| 345 |
* @global object $wpmem |
| 346 |
* @global string $wpmem_themsg |
| 347 |
* @global array $userdata |
| 348 |
* |
| 349 |
* @param string $tag Identifies 'register' or 'update'. |
| 350 |
* @return string $wpmem_themsg|success|editsuccess |
| 351 |
*/ |
| 352 |
function wpmem_registration( $tag ) { |
| 353 |
return wpmem_user_register( $tag ); |
| 354 |
} // End registration function. |
| 355 |
endif; |
| 356 |
|
| 357 |
if ( ! function_exists( 'wpmem_get_captcha_err' ) ): |
| 358 |
/** |
| 359 |
* Generate reCAPTCHA error messages. |
| 360 |
* |
| 361 |
* @since 2.4 |
| 362 |
* @deprecated 3.3.0 No replacement exists. |
| 363 |
* |
| 364 |
* @param string $wpmem_captcha_err The response from the reCAPTCHA API. |
| 365 |
* @return string $wpmem_captcha_err The appropriate error message. |
| 366 |
*/ |
| 367 |
function wpmem_get_captcha_err( $wpmem_captcha_err ) { |
| 368 |
|
| 369 |
switch ( $wpmem_captcha_err ) { |
| 370 |
|
| 371 |
case "invalid-site-public-key": |
| 372 |
$wpmem_captcha_err = esc_html__( 'We were unable to validate the public key.', 'wp-members' ); |
| 373 |
break; |
| 374 |
|
| 375 |
case "invalid-site-public-key": |
| 376 |
$wpmem_captcha_err = esc_html__( 'We were unable to validate the private key.', 'wp-members' ); |
| 377 |
break; |
| 378 |
|
| 379 |
case "invalid-request-cookie": |
| 380 |
$wpmem_captcha_err = esc_html__( 'The challenge parameter of the verify script was incorrect.', 'wp-members' ); |
| 381 |
break; |
| 382 |
|
| 383 |
case "incorrect-captcha-sol": |
| 384 |
$wpmem_captcha_err = esc_html__( 'The CAPTCHA solution was incorrect.', 'wp-members' ); |
| 385 |
break; |
| 386 |
|
| 387 |
case "verify-params-incorrect": |
| 388 |
$wpmem_captcha_err = esc_html__( 'The parameters to verify were incorrect', 'wp-members' ); |
| 389 |
break; |
| 390 |
|
| 391 |
case "invalid-referrer": |
| 392 |
$wpmem_captcha_err = esc_html__( 'reCAPTCHA API keys are tied to a specific domain name for security reasons.', 'wp-members' ); |
| 393 |
break; |
| 394 |
|
| 395 |
case "recaptcha-not-reachable": |
| 396 |
$wpmem_captcha_err = esc_html__( 'The reCAPTCHA server was not reached. Please try to resubmit.', 'wp-members' ); |
| 397 |
break; |
| 398 |
|
| 399 |
case 'really-simple': |
| 400 |
$wpmem_captcha_err = esc_html__( 'You have entered an incorrect code value. Please try again.', 'wp-members' ); |
| 401 |
break; |
| 402 |
} |
| 403 |
|
| 404 |
return $wpmem_captcha_err; |
| 405 |
} |
| 406 |
endif; |
| 407 |
|
| 408 |
if ( ! function_exists( 'wpmem_inc_login' ) ): |
| 409 |
/** |
| 410 |
* Login Dialog. |
| 411 |
* |
| 412 |
* Loads the login form for user login. |
| 413 |
* |
| 414 |
* @since 1.8 |
| 415 |
* @since 3.1.4 Global $wpmem_regchk no longer needed. |
| 416 |
* @since 3.2.0 Now an alias for $wpmem->forms->do_login_form(). |
| 417 |
* @deprecated 3.3.0 Use wpmem_login_form() instead. |
| 418 |
* |
| 419 |
* @global object $post The WordPress Post object. |
| 420 |
* @global object $wpmem The WP_Members object. |
| 421 |
* @param string $page If the form is being displayed in place of blocked content. Default: page. |
| 422 |
* @param string $redirect_to Redirect URL. Default: null. |
| 423 |
* @param string $show If the form is being displayed in place of blocked content. Default: show. |
| 424 |
* @return string $str The generated html for the login form. |
| 425 |
*/ |
| 426 |
function wpmem_inc_login( $page = "page", $redirect_to = null, $show = 'show' ) { |
| 427 |
wpmem_write_log( 'wpmem_inc_login() is deprecated as of WP-Members 3.3.0. Use wpmem_login_form() instead.' ); |
| 428 |
global $wpmem; |
| 429 |
return wpmem_login_form( 'login', array( 'redirect_to'=>$redirect_to ) ); //$wpmem->forms->do_login_form( $page, $redirect_to, $show ); |
| 430 |
} |
| 431 |
endif; |
| 432 |
|
| 433 |
if ( ! function_exists( 'wpmem_inc_registration' ) ): |
| 434 |
/** |
| 435 |
* Registration Form Dialog. |
| 436 |
* |
| 437 |
* Outputs the form for new user registration and existing user edits. |
| 438 |
* |
| 439 |
* @since 2.5.1 |
| 440 |
* @since 3.1.7 Now an alias for $wpmem->forms->register_form() |
| 441 |
* @since 3.2.0 Preparing for deprecation, use wpmem_register_form() instead. |
| 442 |
* @deprecated 3.3.0 Use wpmem_register_form() instead. |
| 443 |
* |
| 444 |
* @global object $wpmem The WP_Members object. |
| 445 |
* @param string $tag (optional) Toggles between new registration ('new') and user profile edit ('edit'). |
| 446 |
* @param string $heading (optional) The heading text for the form, null (default) for new registration. |
| 447 |
* @return string $form The HTML for the entire form as a string. |
| 448 |
*/ |
| 449 |
function wpmem_inc_registration( $tag = 'new', $heading = '', $redirect_to = null ) { |
| 450 |
wpmem_write_log( 'wpmem_inc_registration() is deprecated as of WP-Members 3.3.0. Use wpmem_register_form() instead.' ); |
| 451 |
global $wpmem; |
| 452 |
$args = array( 'tag' => $tag, 'heading' => $heading, 'redirect_to' => $redirect_to ); |
| 453 |
return $wpmem->forms->register_form( $args ); |
| 454 |
} // End wpmem_inc_registration. |
| 455 |
endif; |
| 456 |
|
| 457 |
if ( ! function_exists( 'wpmem_inc_loginfailed' ) ): |
| 458 |
/** |
| 459 |
* Login Failed Dialog. |
| 460 |
* |
| 461 |
* Returns the login failed error message. |
| 462 |
* |
| 463 |
* @since 1.8 |
| 464 |
* @deprecated 3.4.0 Use $wpmem->dialogs->login_failed(). |
| 465 |
* |
| 466 |
* @global object $wpmem The WP_Members object. |
| 467 |
* @return string $str The generated html for the login failed message. |
| 468 |
*/ |
| 469 |
function wpmem_inc_loginfailed() { |
| 470 |
wpmem_write_log( 'wpmem_inc_loginfailed() is deprecated as of WP-Members 3.4.0. Use $wpmem->dialogs->login_failed() instead.' ); |
| 471 |
global $wpmem; |
| 472 |
return $wpmem->dialogs->login_failed(); |
| 473 |
} |
| 474 |
endif; |
| 475 |
|
| 476 |
|
| 477 |
if ( ! function_exists( 'wpmem_inc_regmessage' ) ): |
| 478 |
/** |
| 479 |
* Message Dialog. |
| 480 |
* |
| 481 |
* Returns various dialogs and error messages. |
| 482 |
* |
| 483 |
* @since 1.8 |
| 484 |
* @since 3.3.0 Changed 'toggles' to 'tags' |
| 485 |
* @deprecated 3.4.0 Use wpmem_get_display_message() instead. |
| 486 |
* |
| 487 |
* @global object $wpmem |
| 488 |
* @param string $tag Error message tag to look for specific error messages. |
| 489 |
* @param string $msg A message that has no tag that is passed directly to the function. |
| 490 |
* @return string $str The final HTML for the message. |
| 491 |
*/ |
| 492 |
function wpmem_inc_regmessage( $tag, $msg = '' ) { |
| 493 |
wpmem_write_log( "wpmem_inc_regmessage() is deprecated as of WP-Members 3.4.0. Use wpmem_get_display_message() instead." ); |
| 494 |
global $wpmem; |
| 495 |
return $wpmem->dialogs->get_message( $tag, $msg ); |
| 496 |
} |
| 497 |
endif; |
| 498 |
|
| 499 |
|
| 500 |
if ( ! function_exists( 'wpmem_page_pwd_reset' ) ): |
| 501 |
/** |
| 502 |
* Password reset forms. |
| 503 |
* |
| 504 |
* This function creates both password reset and forgotten |
| 505 |
* password forms for page=password shortcode. |
| 506 |
* |
| 507 |
* @since 2.7.6 |
| 508 |
* @since 3.2.6 Added nonce validation. |
| 509 |
* @deprecated 3.4.0 Use $wpmem->shortcodes->render_pwd_reset() instead. |
| 510 |
* |
| 511 |
* @global object $wpmem |
| 512 |
* @param string $wpmem_regchk |
| 513 |
* @param string $content |
| 514 |
* @return string $content |
| 515 |
*/ |
| 516 |
function wpmem_page_pwd_reset( $wpmem_regchk, $content ) { |
| 517 |
wpmem_write_log( "wpmem_page_pwd_reset() is deprecated as of WP-Members 3.4.0." ); |
| 518 |
global $wpmem; |
| 519 |
$content = $wpmem->shortcodes->render_pwd_reset( $wpmem_regchk, $content ); |
| 520 |
return $content; |
| 521 |
|
| 522 |
} |
| 523 |
endif; |
| 524 |
|
| 525 |
|
| 526 |
if ( ! function_exists( 'wpmem_page_user_edit' ) ): |
| 527 |
/** |
| 528 |
* Creates a user edit page. |
| 529 |
* |
| 530 |
* @since 2.7.6 |
| 531 |
* @since 3.3.9 Added $atts |
| 532 |
* @deprecated 3.4.0 Use $wpmem->shortcodes->render_user_edit() instead. |
| 533 |
* |
| 534 |
* @global object $wpmem |
| 535 |
* @global string $wpmem_a |
| 536 |
* @global string $wpmem_themsg |
| 537 |
* @param string $wpmem_regchk |
| 538 |
* @param string $content |
| 539 |
* @return string $content |
| 540 |
*/ |
| 541 |
function wpmem_page_user_edit( $wpmem_regchk, $content, $atts = false ) { |
| 542 |
wpmem_write_log( "wpmem_page_user_edit() is deprecated as of WP-Members 3.4.0." ); |
| 543 |
global $wpmem, $wpmem_a, $wpmem_themsg; |
| 544 |
$content = $wpmem->shortcodes->render_user_edit( $wpmem_regchk, $content ); |
| 545 |
return $content; |
| 546 |
} |
| 547 |
endif; |
| 548 |
|
| 549 |
|
| 550 |
/** |
| 551 |
* Forgot username form. |
| 552 |
* |
| 553 |
* This function creates a form for retrieving a forgotten username. |
| 554 |
* |
| 555 |
* @since 3.0.8 |
| 556 |
* @deprecated 3.4.0 Use $wpmem->shortcodes->render_forgot_username() instead. |
| 557 |
* |
| 558 |
* @param string $wpmem_regchk |
| 559 |
* @param string $content |
| 560 |
* @return string $content |
| 561 |
*/ |
| 562 |
function wpmem_page_forgot_username( $wpmem_regchk, $content ) { |
| 563 |
wpmem_write_log( "wpmem_page_forgot_username() is deprecated as of WP-Members 3.4.0." ); |
| 564 |
global $wpmem; |
| 565 |
$content = $wpmem->shortcodes->render_forgot_username( $wpmem_regchk, $content ); |
| 566 |
return $content; |
| 567 |
|
| 568 |
} |
| 569 |
|
| 570 |
if ( ! function_exists( 'wpmem_inc_memberlinks' ) ): |
| 571 |
/** |
| 572 |
* Member Links Dialog. |
| 573 |
* |
| 574 |
* Outputs the links used on the members area. |
| 575 |
* |
| 576 |
* @since 2.0 |
| 577 |
* @since 3.4.0 "status" is technically deprecated. Use wpmem_login_status() instead. |
| 578 |
* @deprecated 3.4.0 Use $wpmem->shortocdes->render_links() instead. |
| 579 |
* |
| 580 |
* @gloabl $user_login |
| 581 |
* @global object $wpmem |
| 582 |
* @param string $page |
| 583 |
* @return string $str |
| 584 |
*/ |
| 585 |
function wpmem_inc_memberlinks( $page = 'member' ) { |
| 586 |
wpmem_write_log( "wpmem_inc_memberlinks() is deprecated as of WP-Members 3.4.0." ); |
| 587 |
global $wpmem; |
| 588 |
switch ( $page ) { |
| 589 |
|
| 590 |
case 'member': |
| 591 |
case 'register': |
| 592 |
case 'login': |
| 593 |
$str = $wpmem->shortcodes->render_links( $page ); |
| 594 |
break; |
| 595 |
case 'status': |
| 596 |
$str = wpmem_login_status(); |
| 597 |
break; |
| 598 |
|
| 599 |
} |
| 600 |
return $str; |
| 601 |
} |
| 602 |
endif; |
| 603 |
|
| 604 |
/** |
| 605 |
* Wrapper to return a string from the get_text function. |
| 606 |
* |
| 607 |
* @since 3.1.1 |
| 608 |
* @since 3.1.2 Added $echo argument. |
| 609 |
* @depreacted 3.4.0 Use wpmem_get_text() instead. |
| 610 |
* |
| 611 |
* @param string $str The string to retrieve. |
| 612 |
* @param bool $echo Print the string (default: false). |
| 613 |
* @return string $str The localized string. |
| 614 |
*/ |
| 615 |
function wpmem_gettext( $str, $echo = false ) { |
| 616 |
return wpmem_get_text( $str, $echo ); |
| 617 |
} |
| 618 |
|
| 619 |
/** |
| 620 |
* Returns http:// or https:// depending on ssl. |
| 621 |
* |
| 622 |
* @since 2.9.8 |
| 623 |
* @deprecated 3.2.3 Use wpmem_force_ssl() instead. |
| 624 |
* |
| 625 |
* @return string https://|http:// depending on whether ssl is being used. |
| 626 |
*/ |
| 627 |
function wpmem_use_ssl() { |
| 628 |
wpmem_write_log( 'wpmem_use_ssl() is deprecated. Use wpmem_force_ssl() instead' ); |
| 629 |
return ( is_ssl() ) ? 'https://' : 'http://'; |
| 630 |
} |