/wp-includes/ms-deprecated.php

https://gitlab.com/endomorphosis/reservationtelco · PHP · 151 lines · 70 code · 12 blank · 69 comment · 5 complexity · 14e870d0519fa962f839bd8d2196801b MD5 · raw file

  1. <?php
  2. /**
  3. * Deprecated functions from WordPress MU and the multisite feature. You shouldn't
  4. * use these functions and look for the alternatives instead. The functions will be
  5. * removed in a later version.
  6. *
  7. * @package WordPress
  8. * @subpackage Deprecated
  9. * @since 3.0.0
  10. */
  11. /*
  12. * Deprecated functions come here to die.
  13. */
  14. /**
  15. * @since unknown
  16. * @deprecated 3.0.0
  17. * @deprecated Use wp_generate_password()
  18. * @see wp_generate_password()
  19. */
  20. function generate_random_password( $len = 8 ) {
  21. _deprecated_function( __FUNCTION__, '3.0', 'wp_generate_password()' );
  22. return wp_generate_password( $len );
  23. }
  24. /**
  25. * Determine if user is a site admin.
  26. *
  27. * Plugins should use is_multisite() instead of checking if this function exists
  28. * to determine if multisite is enabled.
  29. *
  30. * This function must reside in a file included only if is_multisite() due to
  31. * legacy function_exists() checks to determine if multisite is enabled.
  32. *
  33. * @since MU
  34. * @deprecated 3.0.0
  35. * @deprecated Use is_super_admin()
  36. * @see is_super_admin()
  37. * @see is_multisite()
  38. *
  39. */
  40. function is_site_admin( $user_login = '' ) {
  41. _deprecated_function( __FUNCTION__, '3.0', 'is_super_admin()' );
  42. if ( empty( $user_login ) ) {
  43. $user_id = get_current_user_id();
  44. if ( !$user_id )
  45. return false;
  46. } else {
  47. $user = new WP_User( null, $user_login) ;
  48. if ( empty( $user->id ) )
  49. return false;
  50. $user_id = $user->id;
  51. }
  52. return is_super_admin( $user_id );
  53. }
  54. if ( !function_exists( 'graceful_fail' ) ) :
  55. /**
  56. * @since MU
  57. * @deprecated 3.0.0
  58. * @deprecated Use wp_die()
  59. * @see wp_die()
  60. */
  61. function graceful_fail( $message ) {
  62. _deprecated_function( __FUNCTION__, '3.0', 'wp_die()' );
  63. $message = apply_filters( 'graceful_fail', $message );
  64. $message_template = apply_filters( 'graceful_fail_template',
  65. '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  66. <html xmlns="http://www.w3.org/1999/xhtml"><head profile="http://gmpg.org/xfn/11">
  67. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  68. <title>Error!</title>
  69. <style type="text/css">
  70. img {
  71. border: 0;
  72. }
  73. body {
  74. line-height: 1.6em; font-family: Georgia, serif; width: 390px; margin: auto;
  75. text-align: center;
  76. }
  77. .message {
  78. font-size: 22px;
  79. width: 350px;
  80. margin: auto;
  81. }
  82. </style>
  83. </head>
  84. <body>
  85. <p class="message">%s</p>
  86. </body>
  87. </html>' );
  88. die( sprintf( $message_template, $message ) );
  89. }
  90. endif;
  91. /**
  92. * @since MU
  93. * @deprecated 3.0.0
  94. * @deprecated Use $GLOBALS['current_user']->ID
  95. */
  96. function get_current_user_id() {
  97. _deprecated_function( __FUNCTION__, '3.0', '$GLOBALS[\'current_user\']->ID' );
  98. return $GLOBALS['current_user']->ID;
  99. }
  100. /**
  101. * @since MU
  102. * @deprecated 3.0.0
  103. * @deprecated Use get_user_by()
  104. * @see get_user_by()
  105. */
  106. function get_user_details( $username ) {
  107. _deprecated_function( __FUNCTION__, '3.0', 'get_user_by()' );
  108. return get_user_by('login', $username);
  109. }
  110. /**
  111. * @since MU
  112. * @deprecated 3.0.0
  113. * @deprecated Use clean_post_cache()
  114. * @see clean_post_cache()
  115. */
  116. function clear_global_post_cache( $post_id ) {
  117. _deprecated_function( __FUNCTION__, '3.0', 'clean_post_cache()' );
  118. }
  119. /**
  120. * @since MU
  121. * @deprecated 3.0.0
  122. * @deprecated Use is_main_site()
  123. * @see is_main_site()
  124. */
  125. function is_main_blog() {
  126. _deprecated_function( __FUNCTION__, '3.0', 'is_main_site()' );
  127. return is_main_site();
  128. }
  129. /**
  130. * @since MU
  131. * @deprecated 3.0.0
  132. * @deprecated Use is_email()
  133. * @see is_email()
  134. */
  135. function validate_email( $email, $check_domain = true) {
  136. _deprecated_function( __FUNCTION__, '3.0', 'is_email()' );
  137. return is_email( $email, $check_domain );
  138. }
  139. ?>