ms-deprecated.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <?php
  2. /**
  3. * Multisite: Deprecated admin functions from past versions and WordPress MU
  4. *
  5. * These functions should not be used and will be removed in a later version.
  6. * It is suggested to use for the alternatives instead when available.
  7. *
  8. * @package WordPress
  9. * @subpackage Deprecated
  10. * @since 3.0.0
  11. */
  12. /**
  13. * Outputs the WPMU menu.
  14. *
  15. * @deprecated 3.0.0
  16. */
  17. function wpmu_menu() {
  18. _deprecated_function( __FUNCTION__, '3.0.0' );
  19. // Deprecated. See #11763.
  20. }
  21. /**
  22. * Determines if the available space defined by the admin has been exceeded by the user.
  23. *
  24. * @deprecated 3.0.0 Use is_upload_space_available()
  25. * @see is_upload_space_available()
  26. */
  27. function wpmu_checkAvailableSpace() {
  28. _deprecated_function( __FUNCTION__, '3.0.0', 'is_upload_space_available()' );
  29. if ( ! is_upload_space_available() ) {
  30. wp_die( sprintf(
  31. /* translators: %s: Allowed space allocation. */
  32. __( 'Sorry, you have used your space allocation of %s. Please delete some files to upload more files.' ),
  33. size_format( get_space_allowed() * MB_IN_BYTES )
  34. ) );
  35. }
  36. }
  37. /**
  38. * WPMU options.
  39. *
  40. * @deprecated 3.0.0
  41. */
  42. function mu_options( $options ) {
  43. _deprecated_function( __FUNCTION__, '3.0.0' );
  44. return $options;
  45. }
  46. /**
  47. * Deprecated functionality for activating a network-only plugin.
  48. *
  49. * @deprecated 3.0.0 Use activate_plugin()
  50. * @see activate_plugin()
  51. */
  52. function activate_sitewide_plugin() {
  53. _deprecated_function( __FUNCTION__, '3.0.0', 'activate_plugin()' );
  54. return false;
  55. }
  56. /**
  57. * Deprecated functionality for deactivating a network-only plugin.
  58. *
  59. * @deprecated 3.0.0 Use deactivate_plugin()
  60. * @see deactivate_plugin()
  61. */
  62. function deactivate_sitewide_plugin( $plugin = false ) {
  63. _deprecated_function( __FUNCTION__, '3.0.0', 'deactivate_plugin()' );
  64. }
  65. /**
  66. * Deprecated functionality for determining if the current plugin is network-only.
  67. *
  68. * @deprecated 3.0.0 Use is_network_only_plugin()
  69. * @see is_network_only_plugin()
  70. */
  71. function is_wpmu_sitewide_plugin( $file ) {
  72. _deprecated_function( __FUNCTION__, '3.0.0', 'is_network_only_plugin()' );
  73. return is_network_only_plugin( $file );
  74. }
  75. /**
  76. * Deprecated functionality for getting themes network-enabled themes.
  77. *
  78. * @deprecated 3.4.0 Use WP_Theme::get_allowed_on_network()
  79. * @see WP_Theme::get_allowed_on_network()
  80. */
  81. function get_site_allowed_themes() {
  82. _deprecated_function( __FUNCTION__, '3.4.0', 'WP_Theme::get_allowed_on_network()' );
  83. return array_map( 'intval', WP_Theme::get_allowed_on_network() );
  84. }
  85. /**
  86. * Deprecated functionality for getting themes allowed on a specific site.
  87. *
  88. * @deprecated 3.4.0 Use WP_Theme::get_allowed_on_site()
  89. * @see WP_Theme::get_allowed_on_site()
  90. */
  91. function wpmu_get_blog_allowedthemes( $blog_id = 0 ) {
  92. _deprecated_function( __FUNCTION__, '3.4.0', 'WP_Theme::get_allowed_on_site()' );
  93. return array_map( 'intval', WP_Theme::get_allowed_on_site( $blog_id ) );
  94. }
  95. /**
  96. * Deprecated functionality for determining whether a file is deprecated.
  97. *
  98. * @deprecated 3.5.0
  99. */
  100. function ms_deprecated_blogs_file() {}
  101. if ( ! function_exists( 'install_global_terms' ) ) :
  102. /**
  103. * Install global terms.
  104. *
  105. * @since 3.0.0
  106. * @since 6.1.0 This function no longer does anything.
  107. * @deprecated 6.1.0
  108. */
  109. function install_global_terms() {
  110. _deprecated_function( __FUNCTION__, '6.1.0' );
  111. }
  112. endif;
  113. /**
  114. * Synchronizes category and post tag slugs when global terms are enabled.
  115. *
  116. * @since 3.0.0
  117. * @since 6.1.0 This function no longer does anything.
  118. * @deprecated 6.1.0
  119. *
  120. * @param WP_Term|array $term The term.
  121. * @param string $taxonomy The taxonomy for `$term`.
  122. * @return WP_Term|array Always returns `$term`.
  123. */
  124. function sync_category_tag_slugs( $term, $taxonomy ) {
  125. _deprecated_function( __FUNCTION__, '6.1.0' );
  126. return $term;
  127. }