~canonical-sysadmins/wordpress/4.2.4

« back to all changes in this revision

Viewing changes to wp-admin/includes/plugin.php

  • Committer: Paul Gear
  • Date: 2015-04-24 01:35:20 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: paul.gear@canonical.com-20150424013520-w4p9ksth76zh6opw
Merge new upstream release 4.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 *     Author URI: Link to the author's web site
23
23
 *     Version: Must be set in the plugin for WordPress 2.3+
24
24
 *     Text Domain: Optional. Unique identifier, should be same as the one used in
25
 
 *              plugin_text_domain()
 
25
 *              load_plugin_textdomain()
26
26
 *     Domain Path: Optional. Only useful if the translations are located in a
27
27
 *              folder above the plugin's base path. For example, if .mo files are
28
28
 *              located in the locale folder then Domain Path will be "/locale/" and
805
805
 
806
806
        $plugins_dir = trailingslashit( $plugins_dir );
807
807
 
808
 
        $translations_dir = $wp_filesystem->wp_lang_dir();
809
 
        $translations_dir = trailingslashit( $translations_dir );
810
 
 
811
808
        $plugin_translations = wp_get_installed_translations( 'plugins' );
812
809
 
813
810
        $errors = array();
884
881
        }
885
882
 
886
883
        if ( empty( $plugins ) )
887
 
                return;
 
884
                return array();
888
885
 
889
886
        $invalid = array();
890
887
 
1542
1539
                        } elseif ( $submenu_array[2] == $pagenow && empty($typenow) && ( empty($parent_file) || false === strpos($parent_file, '?') ) ) {
1543
1540
                                $parent_file = $parent;
1544
1541
                                return $parent;
1545
 
                        } else
1546
 
                                if ( isset( $plugin_page ) && ($plugin_page == $submenu_array[2] ) ) {
1547
 
                                        $parent_file = $parent;
1548
 
                                        return $parent;
1549
 
                                }
 
1542
                        } elseif ( isset( $plugin_page ) && ($plugin_page == $submenu_array[2] ) ) {
 
1543
                                $parent_file = $parent;
 
1544
                                return $parent;
 
1545
                        }
1550
1546
                }
1551
1547
        }
1552
1548
 
1576
1572
                                if ( $menu_array[2] == $pagenow ) {
1577
1573
                                        $title = $menu_array[3];
1578
1574
                                        return $menu_array[3];
1579
 
                                } else
1580
 
                                        if ( isset( $plugin_page ) && ($plugin_page == $menu_array[2] ) && ($hook == $menu_array[3] ) ) {
1581
 
                                                $title = $menu_array[3];
1582
 
                                                return $menu_array[3];
1583
 
                                        }
 
1575
                                } elseif ( isset( $plugin_page ) && ($plugin_page == $menu_array[2] ) && ($hook == $menu_array[3] ) ) {
 
1576
                                        $title = $menu_array[3];
 
1577
                                        return $menu_array[3];
 
1578
                                }
1584
1579
                        } else {
1585
1580
                                $title = $menu_array[0];
1586
1581
                                return $title;
1647
1642
 
1648
1643
        $page_type = 'admin';
1649
1644
        if ( empty ( $parent_page ) || 'admin.php' == $parent_page || isset( $admin_page_hooks[$plugin_page] ) ) {
1650
 
                if ( isset( $admin_page_hooks[$plugin_page] ) )
 
1645
                if ( isset( $admin_page_hooks[$plugin_page] ) ) {
1651
1646
                        $page_type = 'toplevel';
1652
 
                else
1653
 
                        if ( isset( $admin_page_hooks[$parent] ))
1654
 
                                $page_type = $admin_page_hooks[$parent];
1655
 
        } else if ( isset( $admin_page_hooks[$parent] ) ) {
 
1647
                } elseif ( isset( $admin_page_hooks[$parent] )) {
 
1648
                        $page_type = $admin_page_hooks[$parent];
 
1649
                }
 
1650
        } elseif ( isset( $admin_page_hooks[$parent] ) ) {
1656
1651
                $page_type = $admin_page_hooks[$parent];
1657
1652
        }
1658
1653
 
1713
1708
                                        return true;
1714
1709
                                else
1715
1710
                                        return false;
1716
 
                        } else if ( $submenu_array[2] == $pagenow ) {
 
1711
                        } elseif ( $submenu_array[2] == $pagenow ) {
1717
1712
                                if ( current_user_can( $submenu_array[1] ))
1718
1713
                                        return true;
1719
1714
                                else