Ejemplo n.º 1
0
 public static function addthis_shortcode($atts, $content = '')
 {
     if (!isset($atts['buttons_type'])) {
         $atts['buttons_type'] = TMM::get_option('buttons_type');
     }
     if (!isset($atts['add_buttons'])) {
         $atts['add_buttons'] = TMM::get_option('add_buttons');
     }
     $show_buttons = TMM::get_option('show_buttons');
     $post_type = get_post_type();
     if ($post_type === 'post') {
         if (isset($show_buttons['single_blog']) && $show_buttons['single_blog'] === '0') {
             return '';
         }
     }
     if (class_exists('TMM_Ext_PostType_Car') && $post_type === TMM_Ext_PostType_Car::$slug) {
         if (isset($show_buttons['single_car']) && $show_buttons['single_car'] === '0') {
             return '';
         }
     }
     echo TMM_AddThis_Controller::draw_free_page(TMM_AddThis_Controller::get_application_path() . '/views/output.php', $atts);
 }
Ejemplo n.º 2
0
 function form($instance)
 {
     $args['instance'] = wp_parse_args((array) $instance, $this->defaults);
     $args['widget'] = $this;
     echo TMM_AddThis_Controller::draw_free_page(TMM_AddThis_Controller::get_application_path() . '/views/addthis_form.php', $args);
 }