mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-09-06 00:50:32 +00:00
Add @static* annotations where they are missing.
Initialize all static vars that are not, most to `null`. See #32444. git-svn-id: https://develop.svn.wordpress.org/trunk@32650 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -379,7 +379,7 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
|
||||
* @return string
|
||||
*/
|
||||
public function parselisting($line) {
|
||||
static $is_windows;
|
||||
static $is_windows = null;
|
||||
if ( is_null($is_windows) )
|
||||
$is_windows = stripos( ftp_systype($this->link), 'win') !== false;
|
||||
|
||||
|
||||
@@ -900,6 +900,8 @@ class WP_List_Table {
|
||||
* @since 3.1.0
|
||||
* @access public
|
||||
*
|
||||
* @staticvar int $cb_counter
|
||||
*
|
||||
* @param bool $with_id Whether to set the id attribute or not
|
||||
*/
|
||||
public function print_column_headers( $with_id = true ) {
|
||||
|
||||
@@ -162,7 +162,7 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
|
||||
* @return bool
|
||||
*/
|
||||
public function _search_callback( $theme ) {
|
||||
static $term;
|
||||
static $term = null;
|
||||
if ( is_null( $term ) )
|
||||
$term = wp_unslash( $_REQUEST['s'] );
|
||||
|
||||
|
||||
@@ -219,7 +219,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
||||
* @return boolean
|
||||
*/
|
||||
public function _search_callback( $plugin ) {
|
||||
static $term;
|
||||
static $term = null;
|
||||
if ( is_null( $term ) )
|
||||
$term = wp_unslash( $_REQUEST['s'] );
|
||||
|
||||
|
||||
@@ -1658,6 +1658,8 @@ class Language_Pack_Upgrader extends WP_Upgrader {
|
||||
* Hooked to the {@see 'upgrader_process_complete'} action by default.
|
||||
*
|
||||
* @since 3.7.0
|
||||
*
|
||||
* @static
|
||||
*/
|
||||
public static function async_upgrade( $upgrader = false ) {
|
||||
// Avoid recursion.
|
||||
@@ -2136,6 +2138,8 @@ class Core_Upgrader extends WP_Upgrader {
|
||||
*
|
||||
* @since 3.7.0
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @param string $offered_ver The offered version, of the format x.y.z.
|
||||
* @return bool True if we should update to the offered version, otherwise false.
|
||||
*/
|
||||
|
||||
@@ -732,6 +732,8 @@ function wp_dashboard_quick_press_output() {
|
||||
* @deprecated 3.3.0
|
||||
* @deprecated Use wp_editor()
|
||||
* @see wp_editor()
|
||||
*
|
||||
* @staticvar int $num
|
||||
*/
|
||||
function wp_tiny_mce( $teeny = false, $settings = false ) {
|
||||
_deprecated_function( __FUNCTION__, '3.3', 'wp_editor()' );
|
||||
|
||||
@@ -535,6 +535,8 @@ document.body.className = document.body.className.replace('no-js', 'js');
|
||||
*
|
||||
* @global int $post_ID
|
||||
*
|
||||
* @staticvar int $instance
|
||||
*
|
||||
* @param string $editor_id
|
||||
*/
|
||||
function media_buttons($editor_id = 'content') {
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
*
|
||||
* @since 2.7.0
|
||||
*
|
||||
* @staticvar array $column_headers
|
||||
*
|
||||
* @param string|WP_Screen $screen The screen you want the headers for
|
||||
* @return array Containing the headers in the format id => UI String
|
||||
*/
|
||||
@@ -327,6 +329,11 @@ final class WP_Screen {
|
||||
|
||||
/**
|
||||
* Stores old string-based help.
|
||||
*
|
||||
* @static
|
||||
* @access private
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private static $_old_compat_help = array();
|
||||
|
||||
@@ -343,8 +350,11 @@ final class WP_Screen {
|
||||
* The screen object registry.
|
||||
*
|
||||
* @since 3.3.0
|
||||
* @var array
|
||||
*
|
||||
* @static
|
||||
* @access private
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private static $_registry = array();
|
||||
|
||||
@@ -372,6 +382,8 @@ final class WP_Screen {
|
||||
* @since 3.3.0
|
||||
* @access public
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @global string $hook_suffix
|
||||
*
|
||||
* @param string|WP_Screen $hook_name Optional. The hook name (also known as the hook suffix) used to determine the screen.
|
||||
@@ -588,6 +600,8 @@ final class WP_Screen {
|
||||
*
|
||||
* @since 3.3.0
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @param WP_Screen $screen A screen object.
|
||||
* @param string $help Help text.
|
||||
*/
|
||||
@@ -974,7 +988,7 @@ final class WP_Screen {
|
||||
/**
|
||||
*
|
||||
* @global array $wp_meta_boxes
|
||||
*
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function show_screen_options() {
|
||||
|
||||
@@ -605,17 +605,19 @@ function list_meta( $meta ) {
|
||||
*
|
||||
* @since 2.5.0
|
||||
*
|
||||
* @staticvar string $update_nonce
|
||||
*
|
||||
* @param array $entry
|
||||
* @param int $count
|
||||
* @return string
|
||||
*/
|
||||
function _list_meta_row( $entry, &$count ) {
|
||||
static $update_nonce = false;
|
||||
static $update_nonce = '';
|
||||
|
||||
if ( is_protected_meta( $entry['meta_key'], 'post' ) )
|
||||
return '';
|
||||
|
||||
if ( !$update_nonce )
|
||||
if ( ! $update_nonce )
|
||||
$update_nonce = wp_create_nonce( 'add-meta' );
|
||||
|
||||
$r = '';
|
||||
@@ -1991,6 +1993,8 @@ final class WP_Internal_Pointers {
|
||||
* Individual pointers (e.g. wp390_widgets) can be disabled using the following:
|
||||
* remove_action( 'admin_print_footer_scripts', array( 'WP_Internal_Pointers', 'pointer_wp390_widgets' ) );
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @param string $hook_suffix The current admin page.
|
||||
*/
|
||||
public static function enqueue_scripts( $hook_suffix ) {
|
||||
@@ -2047,6 +2051,8 @@ final class WP_Internal_Pointers {
|
||||
*
|
||||
* @since 3.3.0
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @param string $pointer_id The pointer ID.
|
||||
* @param string $selector The HTML elements, on which the pointer should be attached.
|
||||
* @param array $args Arguments to be passed to the pointer JS (see wp-pointer.js).
|
||||
@@ -2094,6 +2100,9 @@ final class WP_Internal_Pointers {
|
||||
public static function pointer_wp350_media() {}
|
||||
public static function pointer_wp360_revisions() {}
|
||||
|
||||
/**
|
||||
* @static
|
||||
*/
|
||||
public static function pointer_wp360_locks() {
|
||||
if ( ! is_multi_author() ) {
|
||||
return;
|
||||
@@ -2108,6 +2117,9 @@ final class WP_Internal_Pointers {
|
||||
) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @static
|
||||
*/
|
||||
public static function pointer_wp390_widgets() {
|
||||
if ( ! current_theme_supports( 'widgets' ) ) {
|
||||
return;
|
||||
@@ -2165,6 +2177,8 @@ final class WP_Internal_Pointers {
|
||||
*
|
||||
* @since 3.3.0
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @param int $user_id User ID.
|
||||
*/
|
||||
public static function dismiss_pointers_for_new_users( $user_id ) {
|
||||
|
||||
@@ -136,11 +136,13 @@ function theme_update_available( $theme ) {
|
||||
*
|
||||
* @since 3.8.0
|
||||
*
|
||||
* @staticvar object $themes_update
|
||||
*
|
||||
* @param WP_Theme $theme WP_Theme object.
|
||||
* @return false|string HTML for the update link, or false if invalid info was passed.
|
||||
*/
|
||||
function get_theme_update_available( $theme ) {
|
||||
static $themes_update;
|
||||
static $themes_update = null;
|
||||
|
||||
if ( !current_user_can('update_themes' ) )
|
||||
return false;
|
||||
|
||||
@@ -104,6 +104,8 @@ function wp_list_widget_controls( $sidebar, $sidebar_name = '' ) {
|
||||
*
|
||||
* @global array $wp_registered_widgets
|
||||
*
|
||||
* @staticvar int $i
|
||||
*
|
||||
* @param array $params
|
||||
* @return array
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user