Plugin Directory

Changeset 1631751


Ignore:
Timestamp:
04/07/2017 07:08:20 AM (9 years ago)
Author:
BenDlz
Message:

v0.1.1 - Add global level 2 site + few bug fixes

Location:
at-internet/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • at-internet/trunk/atinternet-smarttag.php

    r1605763 r1631751  
    1010 * Tested up to: 4.0
    1111 *
    12  * Text Domain: at-internet
     12 * Text Domain: atinternet-smarttag
    1313 * Domain Path: /lang/
    1414 *
  • at-internet/trunk/includes/class-atinternet-smarttag-settings.php

    r1605705 r1631751  
    142142                    'default'       => '',
    143143                    'placeholder'   => __( '123456', 'at-internet' )
     144                ),
     145                array(
     146                    'id'            => 'level2',
     147                    'label'         => __( 'Level 2' , 'at-internet' ),
     148                    'description'   => __( 'Level 2 site number on which you want to send the data. Can be empty and will be overriden by page\'s configuration.', 'at-internet' ),
     149                    'type'          => 'number',
     150                    'default'       => '',
     151                    'placeholder'   => __( '3', 'at-internet' )
    144152                ),
    145153                array(
  • at-internet/trunk/includes/class-atinternet-smarttag.php

    r1605705 r1631751  
    139139     */
    140140    public function atinternet_tracking () {
    141         new ATInternet_SmartTag_Tracking( get_the_ID() );
     141        new ATInternet_SmartTag_Tracking();
    142142    } // End atinternet_tracking ()
    143143
  • at-internet/trunk/includes/lib/class-atinternet-smarttag-tracking-tree-structure.php

    r1605700 r1631751  
    111111                break;
    112112        }
     113
     114        $this->get_level2();
    113115    }
    114116
     
    131133
    132134        return $categories;
     135    }
     136
     137    /**
     138     * Get page's level 2.
     139     * @access  private
     140     * @since   1.0.0
     141     * @return  int
     142     */
     143    private function get_level2() {
     144        if( $post_level2 = get_post_meta( $this->post_id, $this->prefix . 'level2', true ) ) {
     145            $this->level2 = $post_level2;
     146        } else {
     147            $this->level2 = get_option( $this->prefix . 'level2', '' );
     148        }
     149
     150        return $this->level2;
    133151    }
    134152
     
    213231                break;
    214232        }
    215         if( $post_level2 = get_post_meta( $this->post_id, $this->prefix . 'level2', true ) ) {
    216             $this->level2 = $post_level2;
    217         }
     233       
    218234    }
    219235
  • at-internet/trunk/includes/lib/class-atinternet-smarttag-tracking.php

    r1605700 r1631751  
    4444        $this->prefix = $prefix;
    4545
    46         if( is_singular() ) $this->screen_type = 'post';
     46        if( is_singular() ) {
     47            $this->screen_type = 'post';
     48            $this->post_id = get_the_ID();
     49        }
    4750        if( is_search() ) $this->screen_type = 'search';
    4851        if( is_archive() ) $this->screen_type = 'archive';
    49         if( is_home() ) $this->screen_type = 'home';
     52        if( is_home() ) {
     53            $this->screen_type = 'home';
     54            $this->post_id = get_option('page_on_front');
     55        }
    5056
    5157        // eCommerce part
  • at-internet/trunk/readme.txt

    r1606021 r1631751  
    11=== AT Internet SmartTag ===
    2 Contributors: at_internet, BenDlz
     2Contributors: BenDlz
    33Tags: AT Internet, Analytics, Tracking, Woocommerce
    44Requires at least: 4.0
     
    1212== Description ==
    1313
    14 AT Internet SmartTag allows you to automatically track your Wordpress website with [AT Internet](http://atinternet.com "AT Internet") solution.
     14AT Internet SmartTag allows you to automatically track your Wordpress website with [AT Internet] (http://atinternet.com "AT Internet") solution.
    1515
    1616== Installation ==
     
    3232== Changelog ==
    3333
     34= 0.1.1 =
     35* 2017-04-07
     36* Add global site level 2
     37* Few bug fixes
     38
    3439= 0.1 =
    3540* 2017-02-27
Note: See TracChangeset for help on using the changeset viewer.