Changeset 2115213
- Timestamp:
- 07/01/2019 06:17:06 AM (7 years ago)
- Location:
- bazo
- Files:
-
- 5 edited
-
. (modified) (1 prop)
-
branches/readme.txt (modified) (2 diffs)
-
branches/wp-bazo.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/wp-bazo.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
bazo
-
Property
svn:ignore
set to
.idea
-
Property
svn:ignore
set to
-
bazo/branches/readme.txt
r2088922 r2115213 6 6 Tested up to: 5.2 7 7 Requires PHP: 5.6 8 Stable tag: 1. 1.59 Version: 1. 1.58 Stable tag: 1.2 9 Version: 1.2 10 10 Contributors: Bazo 11 11 … … 35 35 36 36 == Changelog == 37 38 = 1.2= 39 * Add shortcode [bazo-company name="altText"] to display recognized company. 37 40 38 41 = 1.1.5 = -
bazo/branches/wp-bazo.php
r2088922 r2115213 2 2 /* 3 3 Plugin Name: Bazo 4 Version: 1. 1.54 Version: 1.2 5 5 Description: Automatically adds Bazo.io tracker to site 6 6 Author: Bazo … … 146 146 147 147 148 // Add scripts to wp_head()148 // Add scripts to wp_head() 149 149 function bazo_header_script() { 150 150 $bazo_options = get_option( 'bazo_options' ); … … 164 164 })(document, 'script', '//c.bazo.io/t.min.js'); 165 165 </script> 166 <!-- END Bazo Tracker v.1. 1.5-->166 <!-- END Bazo Tracker v.1.2 --> 167 167 <?php } 168 168 } … … 174 174 175 175 add_action( 'wp_head', 'bazo_header_script' ); 176 177 178 /* Dodanie shortcode*/ 179 180 181 function company_shortcode($atts) { 182 $altName = shortcode_atts( array( 183 'name' => '' 184 ), $atts ); 185 return '<span class="bazo-company">' .$altName['name']. '</span>'; 186 } 187 188 add_shortcode( 'bazo-company', 'company_shortcode' ); 189 190 // Add scripts to wp_footer() 191 function bazo_footer_script() { ?> 192 <script> 193 window.addEventListener('load', function() { 194 var getBody = document.getElementsByTagName("body")[0]; 195 var company = getBody.getAttribute("bazo-company"); 196 if (!!company) { 197 var elems = document.getElementsByClassName('bazo-company'); 198 for (let i = 0; i < elems.length; ++i) { 199 elems[i].innerHTML = company; 200 } 201 } 202 }); 203 </script> 204 <?php } 205 206 add_action( 'wp_footer', 'bazo_footer_script' ); 207 208 ?> -
bazo/trunk/readme.txt
r2088922 r2115213 6 6 Tested up to: 5.2 7 7 Requires PHP: 5.6 8 Stable tag: 1. 1.59 Version: 1. 1.58 Stable tag: 1.2 9 Version: 1.2 10 10 Contributors: Bazo 11 11 … … 35 35 36 36 == Changelog == 37 38 = 1.2= 39 * Add shortcode [bazo-company name="altText"] to display recognized company. 37 40 38 41 = 1.1.5 = -
bazo/trunk/wp-bazo.php
r2088922 r2115213 2 2 /* 3 3 Plugin Name: Bazo 4 Version: 1. 1.54 Version: 1.2 5 5 Description: Automatically adds Bazo.io tracker to site 6 6 Author: Bazo … … 146 146 147 147 148 // Add scripts to wp_head()148 // Add scripts to wp_head() 149 149 function bazo_header_script() { 150 150 $bazo_options = get_option( 'bazo_options' ); … … 164 164 })(document, 'script', '//c.bazo.io/t.min.js'); 165 165 </script> 166 <!-- END Bazo Tracker v.1. 1.5-->166 <!-- END Bazo Tracker v.1.2 --> 167 167 <?php } 168 168 } … … 174 174 175 175 add_action( 'wp_head', 'bazo_header_script' ); 176 177 178 /* Dodanie shortcode*/ 179 180 181 function company_shortcode($atts) { 182 $altName = shortcode_atts( array( 183 'name' => '' 184 ), $atts ); 185 return '<span class="bazo-company">' .$altName['name']. '</span>'; 186 } 187 188 add_shortcode( 'bazo-company', 'company_shortcode' ); 189 190 // Add scripts to wp_footer() 191 function bazo_footer_script() { ?> 192 <script> 193 window.addEventListener('load', function() { 194 var getBody = document.getElementsByTagName("body")[0]; 195 var company = getBody.getAttribute("bazo-company"); 196 if (!!company) { 197 var elems = document.getElementsByClassName('bazo-company'); 198 for (let i = 0; i < elems.length; ++i) { 199 elems[i].innerHTML = company; 200 } 201 } 202 }); 203 </script> 204 <?php } 205 206 add_action( 'wp_footer', 'bazo_footer_script' ); 207 208 ?>
Note: See TracChangeset
for help on using the changeset viewer.