Plugin Directory

Changeset 2659826


Ignore:
Timestamp:
01/19/2022 08:06:41 AM (4 years ago)
Author:
cvedovini
Message:

release 1.2

Location:
featured-favicons
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • featured-favicons/tags/1.2/featured-favicons.php

    r1306139 r2659826  
    66Author: Claude Vedovini
    77Author URI: http://vdvn.me/
    8 Version: 1.1.1
     8Version: 1.2
    99Text Domain: featured-favicons
    1010Domain Path: /languages
     
    4141function ff_init() {
    4242    add_image_size('favicon', 64, 64, true);
     43    add_image_size('apple-touch-icon', 180, 180, true);
    4344    add_action('wp_head', 'ff_head');
    4445
     
    7980        if (!empty($thumb_url)) {
    8081            echo "<link rel=\"shortcut icon\" href=\"$thumb_url\" type=\"$thumb_mime\" />";
     82
     83            if (get_option('ff_favicon_as_apple_touch_icon')) {
     84                $thumb_src = wp_get_attachment_image_src($thumb_id, 'apple-touch-icon');
     85                $thumb_url = $thumb_src[0];             
     86                if (!empty($thumb_url)) echo "<link rel=\"apple-touch-icon\" href=\"$thumb_url\" />";               
     87            }
    8188        }
    8289    }
     
    129136    add_settings_field('ff_use_as_default_image', __('Use as default featured image', 'featured-favicons'),
    130137            'ff_use_as_default_image_field', 'featured-favicons', 'default');
     138
     139    register_setting('featured-favicons', 'ff_favicon_as_apple_touch_icon');
     140    add_settings_field('ff_favicon_as_apple_touch_icon', __('Favicon as Apple Touch icon', 'featured-favicons'),
     141            'ff_favicon_as_apple_touch_icon_field', 'featured-favicons', 'default');
    131142}
    132143
     
    196207        value="1" <?php checked(get_option('ff_use_as_default_image')); ?> />&nbsp;
    197208        <?php _e('Check this option if you also want to use that image as the default featured image.', 'featured-favicons') ?></label><?php
     209}
     210
     211function ff_favicon_as_apple_touch_icon_field() { ?>
     212    <label><input type="checkbox" name="ff_favicon_as_apple_touch_icon"
     213        value="1" <?php checked(get_option('ff_favicon_as_apple_touch_icon')); ?> />&nbsp;
     214        <?php _e('Check this option if you want to use the favicon as a page\'s icon on Apple touch devices.', 'featured-favicons') ?></label><?php
    198215}
    199216
  • featured-favicons/tags/1.2/readme.txt

    r1876890 r2659826  
    55Tags: featured image,favicon,icon
    66Requires at least: 2.7
    7 Tested up to: 4.9
    8 Stable tag: 1.1.1
     7Tested up to: 5.8.3
     8Stable tag: 1.2
    99License: GPLv3
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    2929== Changelog ==
    3030
     31= Version 1.2 =
     32- Added option for Apple Touch icon
     33
    3134= Version 1.1.1 =
    3235- Preparing for language packs
  • featured-favicons/trunk/featured-favicons.php

    r1306139 r2659826  
    66Author: Claude Vedovini
    77Author URI: http://vdvn.me/
    8 Version: 1.1.1
     8Version: 1.2
    99Text Domain: featured-favicons
    1010Domain Path: /languages
     
    4141function ff_init() {
    4242    add_image_size('favicon', 64, 64, true);
     43    add_image_size('apple-touch-icon', 180, 180, true);
    4344    add_action('wp_head', 'ff_head');
    4445
     
    7980        if (!empty($thumb_url)) {
    8081            echo "<link rel=\"shortcut icon\" href=\"$thumb_url\" type=\"$thumb_mime\" />";
     82
     83            if (get_option('ff_favicon_as_apple_touch_icon')) {
     84                $thumb_src = wp_get_attachment_image_src($thumb_id, 'apple-touch-icon');
     85                $thumb_url = $thumb_src[0];             
     86                if (!empty($thumb_url)) echo "<link rel=\"apple-touch-icon\" href=\"$thumb_url\" />";               
     87            }
    8188        }
    8289    }
     
    129136    add_settings_field('ff_use_as_default_image', __('Use as default featured image', 'featured-favicons'),
    130137            'ff_use_as_default_image_field', 'featured-favicons', 'default');
     138
     139    register_setting('featured-favicons', 'ff_favicon_as_apple_touch_icon');
     140    add_settings_field('ff_favicon_as_apple_touch_icon', __('Favicon as Apple Touch icon', 'featured-favicons'),
     141            'ff_favicon_as_apple_touch_icon_field', 'featured-favicons', 'default');
    131142}
    132143
     
    196207        value="1" <?php checked(get_option('ff_use_as_default_image')); ?> />&nbsp;
    197208        <?php _e('Check this option if you also want to use that image as the default featured image.', 'featured-favicons') ?></label><?php
     209}
     210
     211function ff_favicon_as_apple_touch_icon_field() { ?>
     212    <label><input type="checkbox" name="ff_favicon_as_apple_touch_icon"
     213        value="1" <?php checked(get_option('ff_favicon_as_apple_touch_icon')); ?> />&nbsp;
     214        <?php _e('Check this option if you want to use the favicon as a page\'s icon on Apple touch devices.', 'featured-favicons') ?></label><?php
    198215}
    199216
  • featured-favicons/trunk/readme.txt

    r1876890 r2659826  
    55Tags: featured image,favicon,icon
    66Requires at least: 2.7
    7 Tested up to: 4.9
    8 Stable tag: 1.1.1
     7Tested up to: 5.8.3
     8Stable tag: 1.2
    99License: GPLv3
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    2929== Changelog ==
    3030
     31= Version 1.2 =
     32- Added option for Apple Touch icon
     33
    3134= Version 1.1.1 =
    3235- Preparing for language packs
Note: See TracChangeset for help on using the changeset viewer.