[ Index ]

PHP Cross Reference of WordPress 3.0 beta 1

[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/wp-includes/ -> ms-deprecated.php (source)

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


Generated: Mon Apr 5 14:26:09 2010 Cross-referenced by PHPXref 0.7