function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', $instance['title']); $appearance = $instance['appearance']; $appearance = $appearance ? $appearance : 'medium'; $show_count = (int) @$instance['show_count']; $show_count = $show_count ? true : false; if (is_singular()) { // Show widget only on votable pages $codec = new Wdgpo_Codec(); echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } echo $codec->process_plusone_code(array('appearance' => $appearance, 'show_count' => $show_count ? 'yes' : 'no')); echo $after_widget; } }
function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', $instance['title']); $appearance = $instance['appearance']; $appearance = $appearance ? $appearance : 'medium_icon'; $float = esc_attr($instance['float']); $text = $instance['text']; $text_position = $instance['text_position']; $show_posts = $instance['show_posts']; $posts_position = $instance['posts_position']; $posts_limit = (int) $instance['posts_limit']; $codec = new Wdgpo_Codec(); echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } $args = array('appearance' => $appearance); if ($float) { $args['float'] = $float; } if ($show_posts && 'before' == $posts_position) { $this->_show_posts($posts_limit); } if ($text && 'before' == $text_position) { echo $text; } echo $codec->process_gplus_page_code($args); if ($text && 'after' == $text_position) { echo $text; } if ($float) { echo "<div style='clear:{$float}'></div>"; } if ($show_posts && 'after' == $posts_position) { $this->_show_posts($posts_limit); } echo $after_widget; }
function add_hooks() { // Step0: Register options and menu add_action('admin_init', array($this, 'register_settings')); if (is_network_admin()) { add_action('network_admin_menu', array($this, 'create_site_admin_menu_entry')); } else { add_action('admin_menu', array($this, 'create_blog_admin_menu_entry')); } add_action('admin_print_scripts', array($this, 'js_print_scripts')); if ($this->data->get_option('gplus_profile_fields')) { add_filter('user_contactmethods', array($this, 'generate_profile_fields')); } // Register the shortcodes, so Membership picks them up $rpl = new Wdgpo_Codec(); $rpl->register(); // AJAX handlers add_action('wp_ajax_wdgpo_gplus_deauthenticate', array($this, 'json_gplus_deauthenticate')); add_action('wp_ajax_wdgpo_gplus_test_import', array($this, 'json_gplus_test_import')); add_action('wp_ajax_wdgpo_gplus_import_now', array($this, 'json_gplus_import_now')); add_action('wp_ajax_wdgpo_gplus_clear_log', array($this, 'json_gplus_clear_log')); }