Plugin Directory

Changeset 1763060

Timestamp:
11/10/2017 02:57:25 PM (7 years ago)
Author:
simison
Message:

Clean out

Location:
admin-bar-languages/trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • admin-bar-languages/trunk/README.md

    r1010539 r1763060  
    88
    991. Unzip plugin and upload `admin-bar-blog-languages` folder to the `/wp-content/plugins/` directory
    10 2. 'Network Activate' the plugin through the 'Network admin' -> 'Plugins' menu in WordPress
     102. 'Network Activate' the plugin through the 'Network admin' 'Plugins' menu in WordPress
    1111
    1212### Frequently Asked Questions
     
    2222### Changelog
    2323
     24
     25
     26
     27
    2428#### 1.1
    25292014-10-20
  • admin-bar-languages/trunk/admin-bar-languages.php

    r1010539 r1763060  
    33 Plugin Name: Admin bar languages
    44 Plugin URI: http://wordpress.org/extend/plugins/admin-bar-languages/
    5  Description: Show flags at "My sites" list in WordPress admin bar.
    6  Version: 1.1
     5 Description: Show flags at "My sites" list in WordPress admin bar.
     6 Version: 1.
    77 Author: Mikael Korpela
    88 Author URI: http://www.mikaelkorpela.fi
     
    2626*/
    2727
    28 defined('ABSPATH') or die("No script kiddies please!");
     28defined('ABSPATH') or die();
    2929
    3030
     
    3232    public function __construct()
    3333    {
    34         add_action( 'init', array($this, 'init_admin_bar_languages') );
     34        add_action( 'init', array() );
    3535    }
    3636
     
    3838     * Run this plugin only when we have admin bar up there...
    3939     */
    40     public function init_admin_bar_languages(){
     40    public function init_admin_bar_languages(){
    4141        if( is_user_logged_in() && is_admin_bar_showing() ) {
    42             add_action( 'wp_before_admin_bar_render', array($this, 'flagatar_admin_bar') );
    43             add_action( 'admin_enqueue_scripts', array($this, 'flagatar_style') );
     42            add_action( 'wp_before_admin_bar_render', array() );
     43            add_action( 'admin_enqueue_scripts', array() );
    4444        }
    4545
    46         if (is_admin()){
    47             add_filter( 'plugin_row_meta', array($this, 'flagatar_plugin_links'), 10, 2 );
     46        if ({
     47            add_filter( 'plugin_row_meta', array(), 10, 2 );
    4848        }
    4949    }
     
    6565
    6666        // This is functionality for WP 4.0+ only
    67         if( version_compare( get_bloginfo( 'version' ), '4.0', '>=' ) ) {
     67        if( version_compare( get_bloginfo( 'version' ), '4.0', '>=' ) ) {
    6868
    6969            // Get native language names
     
    7171            $translations = ( function_exists( 'wp_get_available_translations' ) ) ? wp_get_available_translations() : array();
    7272
    73         }
    74         else {
    75 
     73        } else {
    7674            $translations = array();
    77 
    7875        }
    7976
    8077        // Loop user's blogs trough
    81         foreach( (array) $wp_admin_bar->user->blogs as $blog ) {
     78        foreach( (array) $wp_admin_bar->user->blogs as $blog ) {
    8279
    8380            $node_id = 'blog-' . $blog->userblog_id;
     
    8582            $node = $wp_admin_bar->get_node( $node_id );
    8683
    87             if( $node ) {
     84            if( $node ) {
    8885
    8986                // We'll put it back...
     
    9491
    9592                // Oh, just sometimes language returns empty on WP 4.0, try different key
    96                 if(empty($lang) && is_multisite() ) $lang = get_blog_option( $blog->userblog_id, 'language', 'en_US' );
     93                if() && is_multisite() ) $lang = get_blog_option( $blog->userblog_id, 'language', 'en_US' );
    9794
    9895                // Still no language? Default to US.
    99                 if( empty($lang) ) $lang = 'en_US';
     96                if( empty() ) $lang = 'en_US';
    10097
    10198                // Blog name - and is this blog currently active?
     
    106103
    107104                // If we have name for this language, show it as title. Fall back to locale.
    108                 $node->meta['title'] = (isset($translations[$lang])) ? esc_attr( $translations[$lang]['english_name'] . ' (' . $translations[$lang]['native_name'] . ')' ) : esc_attr( $lang );
     105                $node->meta['title'] = ]['native_name'] . ')' ) : esc_attr( $lang );
    109106
    110107                $wp_admin_bar->add_node( $node );
     
    116113     * Add donation link on the plugin listing
    117114     */
    118     public function flagatar_plugin_links($links, $file) {
    119        if ( $file == plugin_basename(dirname(__FILE__).'/admin-bar-languages.php') ) {
    120          $links[] = '<a href="http://www.mikaelkorpela.fi/volunteering/">' . __('Donate') . '</a>';
     115    public function flagatar_plugin_links() {
     116       if ( $file == plugin_basename() ) {
     117         $links[] = '<a href="http://www.mikaelkorpela.fi/volunteering/">' . __() . '</a>';
    121118       }
    122119       return $links;
  • admin-bar-languages/trunk/readme.txt

    r1010539 r1763060  
    44Tags: admin, i18n, l10n, localization, admin bar, adminbar, toolbar, menu, my sites, network, multi-site, multisite, MU, flags, flag, icon, icons
    55Requires at least: 3.6
    6 Tested up to: 4.0
    7 Stable tag: 1.1
     6Tested up to: 4.
     7Stable tag: 1.
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4343== Changelog ==
    4444
     45
     46
     47
     48
    4549= 1.1 =
    46502014-10-20
Note: See TracChangeset for help on using the changeset viewer.