Changeset 1008309
- Timestamp:
- 10/16/2014 01:25:11 AM (11 years ago)
- Location:
- average-mobile-detect
- Files:
-
- 6 added
- 2 edited
-
tags/1.0 (added)
-
tags/1.0/Mobile_Detect.php (added)
-
tags/1.0/average-mobile-detect.php (added)
-
tags/1.0/index.php (added)
-
tags/1.0/options.php (added)
-
tags/1.0/readme.txt (added)
-
trunk/average-mobile-detect.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
average-mobile-detect/trunk/average-mobile-detect.php
r975566 r1008309 4 4 Plugin URI: 5 5 Description: Redirects mobile traffic to your mobile website on a page-by-page basis (posts and custom post types included). This can be overridden on any page individually with a convenient meta box adjacent to the WYSIWYG. Sets a cookie to remember which version of your website (desktop or mobile, usually) your visitors opted for. Includes a widget for inserting a link back to your mobile site, which is only generated for mobile devices. Includes two shortcodes for generating links to your mobile site--one is generated only for mobile devices and the other is generated regardless. No CSS rules are used. CSS classes are provided, yielding coders full reign to style the generated links to fit the website theme. Adds a class to the body ("mobile-detected") to help coders write styles specifically for mobile devices. Leaves 404 errors untouched, allowing you to maintain 404 statuses. Basically, it gives you loads of control of your mobile redirects. 6 Version: 1. 06 Version: 1.1 7 7 Author: Average 8 8 Author URI: http://profiles.wordpress.org/averagetechnology … … 201 201 } 202 202 $title = apply_filters('widget_title',$instance['title']); 203 $class = "mobile-site-opt mobile-site-link"; 203 204 echo $args['before_widget']; 204 205 if (!empty($title)) 205 206 { 206 $mobsitelink = '<a class=" mobile-site-link" href="'.$the_mobile_site_uri.'" title="'.$title.'">'.$title.'</a>';207 $mobsitelink = '<a class="'.$class.'" href="'.$the_mobile_site_uri.'" title="'.$title.'">'.$title.'</a>'; 207 208 } 208 209 else 209 210 { 210 $mobsitelink = '<a class=" mobile-site-link" href="'.$the_mobile_site_uri.'" title="View Mobile Version">View Mobile Version</a></div>';211 $mobsitelink = '<a class="'.$class.'" href="'.$the_mobile_site_uri.'" title="View Mobile Version">View Mobile Version</a></div>'; 211 212 } 212 213 echo __($mobsitelink,'text_domain'); … … 325 326 } 326 327 add_shortcode('mobilesitebutton', 'avrgmobdtct_mobsitebttn_sc'); 328 329 # [mobilesite text="View Mobile Version" class="mobile-site-link"] 330 function avrgmobdtct_mobsite_sc($atts) 331 { 332 if(!class_exists('Mobile_Detect')) 333 { 334 include plugin_basename('/Mobile_Detect.php'); 335 } 336 $detect = new Mobile_Detect(); 337 if ($detect->isMobile() && !$detect->isTablet()) 338 { 339 if(get_option('the_mobile_site_uri')) 340 { 341 $the_mobile_site_uri=get_option('the_mobile_site_uri'); 342 } 343 ob_start(); 344 $avrgmobdtctScMerged = shortcode_atts( array( 345 'text' => 'View Mobile Version', 346 'class' => 'mobile-site-link', 347 'page' => '', 348 ), $atts, 'mobilesite' ); 349 extract($avrgmobdtctScMerged); 350 if(!empty($page)) 351 { 352 if($page=='/') 353 { 354 $mobPageURN = ''; 355 } 356 else 357 { 358 $mobPageURN = '/'.$page; 359 } 360 } 361 else 362 { 363 $mobPageURN = $_SERVER['REQUEST_URI']; 364 } 365 echo '<a href="'.$the_mobile_site_uri.$mobPageURN.'" class="'.$class.'">'.$text.'</a>'; 366 return ob_get_clean(); 367 } 368 } 369 add_shortcode('mobilesite', 'avrgmobdtct_mobsitebttn_sc'); 327 370 328 371 -
average-mobile-detect/trunk/readme.txt
r1008156 r1008309 7 7 Requires at least: 3.0.1 8 8 Tested up to: 4.0 9 Stable tag: 1. 09 Stable tag: 1.1 10 10 License: GPLv2 or later 11 11 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 89 89 90 90 == Changelog == 91 92 = 1.1 = 93 15-Oct-2014 94 95 * Adds shortcode [mobilesite] back in for older websites that are using it (websites created before Average Mobile Detect was released on the WordPress repository) 96 * Adds CSS class "mobile-site-opt" to link output by widget to replace css class "mobile-site-link" 97 * Declares CSS class "mobile-site-link" deprecated for widgets (not deprecated for shortcode). Use "mobile-site-opt" instead. This was decided upon to avoid confusion between the widget and the shortcode when styling. 91 98 92 99 = 1.0 =
Note: See TracChangeset
for help on using the changeset viewer.