Changeset 681 for trunk


Ignore:
Timestamp:
11/27/2011 07:27:39 AM (6 months ago)
Author:
ofer
Message:

Fix clean start and avoid warnings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/WordPress/plugin/transposh/wp/transposh_widget.php

    r680 r681  
    8484        $this->WP_Widget('transposh', __('Transposh'), $widget_ops, $control_ops); 
    8585 
     86        add_action('widgets_init', create_function('', 'register_widget("transposh_plugin_widget");')); 
     87 
    8688        // We only need to add those actions once, makes life simpler 
    8789        if (is_active_widget(false, false, $this->id_base) && self::$first_init) { 
    8890            self::$first_init = false; 
    89             add_action('widgets_init', create_function('', 'register_widget("transposh_plugin_widget");')); 
    9091            add_action('wp_print_styles', array(&$this, 'add_transposh_widget_css')); 
    9192            add_action('wp_print_scripts', array(&$this, 'add_transposh_widget_js')); 
     
    152153    function add_transposh_widget_css() { 
    153154        // first we discover all active widgets of ours, and aggregate the files 
     155        $activewidgets = array(); 
    154156        $settings = $this->get_settings(); 
    155157        foreach ($settings as $key => $value) { 
     
    171173     */ 
    172174    function add_transposh_widget_js() { 
     175        $activewidgets = array(); 
    173176        $settings = $this->get_settings(); 
    174177        foreach ($settings as $key => $value) { 
Note: See TracChangeset for help on using the changeset viewer.