isMobile() && !$aFACdetect->isTablet()) return do_shortcode($content); } add_shortcode('mobileonly', 'aFACsc_mobileonly'); function aFAC_mobileonly(){ global $aFACdetect; if($aFACdetect->isMobile() && !$aFACdetect->isTablet()) return true; } # [notmobile][/notmobile] function aFACsc_notmobile($tats,$content=""){ global $aFACdetect; if(!$aFACdetect->isMobile() || $aFACdetect->isTablet()) return do_shortcode($content); } add_shortcode('notmobile','aFACsc_notmobile'); function aFAC_notmobile(){ global $aFACdetect; if(!$aFACdetect->isMobile() || $aFACdetect->isTablet()) return true; } # [tabletonly][/tabletonly] function aFACsc_tabletonly($tats,$content=""){ global $aFACdetect; if($aFACdetect->isTablet()) return do_shortcode($content); } add_shortcode('tabletonly', 'aFACsc_tabletonly'); function aFAC_tabletonly(){ global $aFACdetect; if($aFACdetect->isTablet()) return true; } # [nottablet][/nottablet] function aFACsc_nottablet($tats,$content=""){ global $aFACdetect; if(!$aFACdetect->isTablet()) return do_shortcode($content); } add_shortcode('nottablet','aFACsc_nottablet'); function aFAC_nottablet(){ global $aFACdetect; if(!$aFACdetect->isTablet()) return true; } # [desktoponly][/desktoponly] function aFACsc_desktoponly($tats,$content=""){ global $aFACdetect; if(!$aFACdetect->isMobile() && !$aFACdetect->isTablet()) return do_shortcode($content); } add_shortcode('desktoponly', 'aFACsc_desktoponly'); function aFAC_desktoponly(){ global $aFACdetect; if(!$aFACdetect->isMobile() && !$aFACdetect->isTablet()) return true; } # [notdesktop][/notdesktop] function aFACsc_notdesktop($tats,$content=""){ global $aFACdetect; if($aFACdetect->isMobile() || $aFACdetect->isTablet()) return do_shortcode($content); } add_shortcode('notdesktop', 'aFACsc_notdesktop'); function aFAC_notdesktop(){ global $aFACdetect; if($aFACdetect->isMobile() || $aFACdetect->isTablet()) return true; } # [iosonly][/iosonly] function aFACsc_iosonly($tats,$content=""){ global $aFACdetect; if($aFACdetect->isiOS()) return do_shortcode($content); } add_shortcode('iosonly', 'aFACsc_iosonly'); function aFAC_iosonly(){ global $aFACdetect; if($aFACdetect->isiOS()) return true; } # [iphoneonly][/iphoneonly] function aFACsc_iphoneonly($tats,$content=""){ global $aFACdetect; if($aFACdetect->isiPhone()) return do_shortcode($content); } add_shortcode('iphoneonly', 'aFACsc_iphoneonly'); function aFAC_iphoneonly(){ global $aFACdetect; if($aFACdetect->isiPhone()) return true; } # [ipadonly][/ipadonly] function aFACsc_ipadonly($tats,$content=""){ global $aFACdetect; if($aFACdetect->isiPad()) return do_shortcode($content); } add_shortcode('ipadonly', 'aFACsc_ipadonly'); function aFAC_ipadonly(){ global $aFACdetect; if($aFACdetect->isiPad()) return true; } # [androidonly][/androidonly] function aFACsc_androidonly($tats,$content=""){ global $aFACdetect; if($aFACdetect->isAndroidOS()) return do_shortcode($content); } add_shortcode('androidonly', 'aFACsc_androidonly'); function aFAC_androidonly(){ global $aFACdetect; if($aFACdetect->isAndroidOS()) return true; } # [windowsmobileonly][/windowsmobileonly] function aFACsc_windowsmobileonly($tats,$content=""){ global $aFACdetect; if($aFACdetect->isWindowsMobileOS()) return do_shortcode($content); } add_shortcode('windowsmobileonly', 'aFACsc_windowsmobileonly'); function aFAC_windowsmobileonly(){ global $aFACdetect; if($aFACdetect->isWindowsMobileOS()) return true; } /* Q U I C K T A G S ================= */ function aFAC_QTags() { if (wp_script_is('quicktags')){ ?> add_help_tab(array( 'id' => 'aFACHelpTab', 'title' => __('Adaptive Content'), 'content' => '
'.__('You can use these shortcodes to designate what devices you want specific content to display on:').'
[mobileonly] '.__('Displays only on mobile devices.').'[/mobileonly][notmobile] '.__('Displays on devices, that are not mobile.').'[/notmobile][tabletonly] '.__('Displays only on tablets.').'[/tabletonly][nottablet] '.__('Displays on devices, that are not tablets.').'[/nottablet][desktoponly] '.__('Displays only on desktop computers.').'[/desktoponly][notdesktop] '.__('Displays on devices that are not desktops.').'[/notdesktop][iphoneonly] '.__('Displays only on iPhones.').'[/iphoneonly][ipadonly] '.__('Displays only on iPads.').'[/ipadonly][iosonly] '.__('Displays only on devices running iOS.').'[/iosonly][androidonly] '.__('Displays only on devices running Android.').'[/androidonly][windowsmobileonly] '.__('Displays only on devices running Windows Mobile.').'[/windowsmobileonly]