Plugin Directory

Changeset 1347863


Ignore:
Timestamp:
02/10/2016 10:11:01 PM (10 years ago)
Author:
kyleabaker
Message:

v1.0.8

  • Added option to display User Agent information in comments only in the Admin Section
Location:
wp-useragent/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • wp-useragent/trunk/readme.txt

    r1171065 r1347863  
    55Requires at least: 2.0
    66Tested up to: 4.2.2
    7 Stable tag: 1.0.7
     7Stable tag: 1.0.8
    88
    99== Description ==
     
    6666
    6767== Changelog ==
     68
     69= v1.0.8 =
     70* Added option to display User Agent information in comments only in the Admin Section
     71
    6872
    6973= v1.0.7 =
     
    607611== Upgrade Notice ==
    608612
    609 = v1.0.7 =
    610 * Added detection for Microsoft Edge, Seznam.cz, Coc Coc, Google Search App, WebPositive, Vivaldi, luakit, wOSBrowser, Puffin, NetFront Life, Ninesky, Palm WebPro browsers.
    611 * Optimized/reduced filesize of 31 images
    612 * Added detection for Windows Phone 10
    613 * Updated Windows 10 detection
    614 * Cleaned up syntax
     613= v1.0.8 =
     614* Added option to display User Agent information in comments only in the Admin Section
  • wp-useragent/trunk/wp-useragent-options.php

    r1171065 r1347863  
    3737            $ua_hide_unknown_bool   = get_option('ua_hide_unknown_bool');
    3838            $ua_output_location     = get_option('ua_output_location');
     39            $ua_admin_only_bool     = get_option('ua_admin_only_bool');
    3940        ?>
    4041
     
    211212                        <table class="form-table" style="margin-top: 0">
    212213                            <tbody>
     214                                <tr valign='top'>
     215                                    <th scope='row'>Admin Section Only:</th>
     216                                    <td><div style="overflow:auto;max-height:100px;">
     217                                        <select id="ua_admin_only_bool" name="ua_admin_only_bool">
     218                                            <option value="true" <?php if($ua_admin_only_bool=="true") echo 'selected="selected"' ?>>True</option>
     219                                            <option value="false" <?php if($ua_admin_only_bool!="true") echo 'selected="selected"' ?>>False</option>
     220                                        </select>
     221                                    </div></td>
     222                                </tr>
    213223                                <tr valign='top'>
    214224                                    <th scope='row'>UserAgent Output Location:</th>
     
    304314
    305315        <input type="hidden" name="action" value="update" />
    306         <input type="hidden" name="page_options" value="ua_doctype, ua_comment_size, ua_track_size, ua_show_text, ua_image_style, ua_image_css, ua_text_surfing, ua_text_on, ua_text_via, ua_text_links, ua_show_ua_bool, ua_hide_unknown_bool, ua_output_location" />
     316        <input type="hidden" name="page_options" value="ua_doctype, ua_comment_size, ua_track_size, ua_show_text, ua_image_style, ua_image_css, ua_text_surfing, ua_text_on, ua_text_via, ua_text_links, ua_show_ua_bool, ua_hide_unknown_bool, ua_output_location, ua_admin_only_bool" />
    307317        <p class="submit">
    308318            <input type="submit" name="Submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
  • wp-useragent/trunk/wp-useragent.php

    r1171065 r1347863  
    44Plugin URI: http://kyleabaker.com/goodies/coding/wp-useragent/
    55Description: A simple User-Agent detection plugin that lets you easily insert icons and/or textual web browser and operating system details with each comment.
    6 Version: 1.0.7
     6Version: 1.0.8
    77Author: Kyle Baker
    88Author URI: http://kyleabaker.com/
     
    5555$ua_hide_unknown_bool   = get_option('ua_hide_unknown_bool');
    5656$ua_output_location     = get_option('ua_output_location');
     57$ua_admin_only_bool     = get_option('ua_admin_only_bool');
    5758
    5859// Include our main UA detection functions
     
    293294// If the user selected to display output in a standard location
    294295// and not a custom location then lets add a filter here.
    295 if($ua_output_location!='custom')
     296if($ua_admin_only_bool=='true' && is_admin())
     297{
     298    if($ua_output_location!='custom')
     299    {
     300        add_filter('comment_text', 'wp_useragent');
     301    }
     302}
     303else if($ua_admin_only_bool!='true' && $ua_output_location!='custom')
    296304{
    297305    add_filter('comment_text', 'wp_useragent');
Note: See TracChangeset for help on using the changeset viewer.