]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/includes/plugin.php
WordPress 4.2
[autoinstalls/wordpress.git] / wp-admin / includes / plugin.php
index e2e37761d8b872e635089cdb48dbda9d0aad82f1..bb16117fb7d192efb9b5924e1331459324164834 100644 (file)
@@ -22,7 +22,7 @@
  *     Author URI: Link to the author's web site
  *     Version: Must be set in the plugin for WordPress 2.3+
  *     Text Domain: Optional. Unique identifier, should be same as the one used in
  *     Author URI: Link to the author's web site
  *     Version: Must be set in the plugin for WordPress 2.3+
  *     Text Domain: Optional. Unique identifier, should be same as the one used in
- *             plugin_text_domain()
+ *             load_plugin_textdomain()
  *     Domain Path: Optional. Only useful if the translations are located in a
  *             folder above the plugin's base path. For example, if .mo files are
  *             located in the locale folder then Domain Path will be "/locale/" and
  *     Domain Path: Optional. Only useful if the translations are located in a
  *             folder above the plugin's base path. For example, if .mo files are
  *             located in the locale folder then Domain Path will be "/locale/" and
@@ -805,9 +805,6 @@ function delete_plugins( $plugins, $deprecated = '' ) {
 
        $plugins_dir = trailingslashit( $plugins_dir );
 
 
        $plugins_dir = trailingslashit( $plugins_dir );
 
-       $translations_dir = $wp_filesystem->wp_lang_dir();
-       $translations_dir = trailingslashit( $translations_dir );
-
        $plugin_translations = wp_get_installed_translations( 'plugins' );
 
        $errors = array();
        $plugin_translations = wp_get_installed_translations( 'plugins' );
 
        $errors = array();
@@ -884,7 +881,7 @@ function validate_active_plugins() {
        }
 
        if ( empty( $plugins ) )
        }
 
        if ( empty( $plugins ) )
-               return;
+               return array();
 
        $invalid = array();
 
 
        $invalid = array();
 
@@ -1542,11 +1539,10 @@ function get_admin_page_parent( $parent = '' ) {
                        } elseif ( $submenu_array[2] == $pagenow && empty($typenow) && ( empty($parent_file) || false === strpos($parent_file, '?') ) ) {
                                $parent_file = $parent;
                                return $parent;
                        } elseif ( $submenu_array[2] == $pagenow && empty($typenow) && ( empty($parent_file) || false === strpos($parent_file, '?') ) ) {
                                $parent_file = $parent;
                                return $parent;
-                       } else
-                               if ( isset( $plugin_page ) && ($plugin_page == $submenu_array[2] ) ) {
-                                       $parent_file = $parent;
-                                       return $parent;
-                               }
+                       } elseif ( isset( $plugin_page ) && ($plugin_page == $submenu_array[2] ) ) {
+                               $parent_file = $parent;
+                               return $parent;
+                       }
                }
        }
 
                }
        }
 
@@ -1576,11 +1572,10 @@ function get_admin_page_title() {
                                if ( $menu_array[2] == $pagenow ) {
                                        $title = $menu_array[3];
                                        return $menu_array[3];
                                if ( $menu_array[2] == $pagenow ) {
                                        $title = $menu_array[3];
                                        return $menu_array[3];
-                               } else
-                                       if ( isset( $plugin_page ) && ($plugin_page == $menu_array[2] ) && ($hook == $menu_array[3] ) ) {
-                                               $title = $menu_array[3];
-                                               return $menu_array[3];
-                                       }
+                               } elseif ( isset( $plugin_page ) && ($plugin_page == $menu_array[2] ) && ($hook == $menu_array[3] ) ) {
+                                       $title = $menu_array[3];
+                                       return $menu_array[3];
+                               }
                        } else {
                                $title = $menu_array[0];
                                return $title;
                        } else {
                                $title = $menu_array[0];
                                return $title;
@@ -1647,12 +1642,12 @@ function get_plugin_page_hookname( $plugin_page, $parent_page ) {
 
        $page_type = 'admin';
        if ( empty ( $parent_page ) || 'admin.php' == $parent_page || isset( $admin_page_hooks[$plugin_page] ) ) {
 
        $page_type = 'admin';
        if ( empty ( $parent_page ) || 'admin.php' == $parent_page || isset( $admin_page_hooks[$plugin_page] ) ) {
-               if ( isset( $admin_page_hooks[$plugin_page] ) )
+               if ( isset( $admin_page_hooks[$plugin_page] ) ) {
                        $page_type = 'toplevel';
                        $page_type = 'toplevel';
-               else
-                       if ( isset( $admin_page_hooks[$parent] ))
-                               $page_type = $admin_page_hooks[$parent];
-       } else if ( isset( $admin_page_hooks[$parent] ) ) {
+               } elseif ( isset( $admin_page_hooks[$parent] )) {
+                       $page_type = $admin_page_hooks[$parent];
+               }
+       } elseif ( isset( $admin_page_hooks[$parent] ) ) {
                $page_type = $admin_page_hooks[$parent];
        }
 
                $page_type = $admin_page_hooks[$parent];
        }
 
@@ -1713,7 +1708,7 @@ function user_can_access_admin_page() {
                                        return true;
                                else
                                        return false;
                                        return true;
                                else
                                        return false;
-                       } else if ( $submenu_array[2] == $pagenow ) {
+                       } elseif ( $submenu_array[2] == $pagenow ) {
                                if ( current_user_can( $submenu_array[1] ))
                                        return true;
                                else
                                if ( current_user_can( $submenu_array[1] ))
                                        return true;
                                else