Plugin Directory

Changeset 2232846


Ignore:
Timestamp:
01/24/2020 03:37:18 PM (6 years ago)
Author:
b3none
Message:

version update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • the-insertr/trunk/the-insertr.php

    r2215006 r2232846  
    66 * Description: Wordpress dynamic keyword insertion plugin.
    77 * Author: Herdl
    8  * Version: 1.3.0
     8 * Version: 1.4.1
    99 * Author URI: https://herdl.com
    1010 */
     
    1717    $attributes = shortcode_atts([
    1818        'key' => '',
    19         'fallback' => ''
     19        'fallback' => '',
     20        'case' => '',
    2021    ], $attributes, 'insertr');
    2122
    2223    $key = $attributes['key'];
    2324    $adword = '';
     25    $case = 'lower';
    2426
    2527    if (isset($_GET[$key])) {
     
    2931    }
    3032
     33    if ($attributes['case']) {
     34        $case = $attributes['case'];
     35    }
     36
     37    if ($case === 'lower') {
     38        $adword = strtolower($adword);
     39    } else if ($case === 'upper') {
     40        $adword = strtoupper($adword);
     41    } else if ($case === 'title') {
     42        $adword = ucwords($adword);
     43    }
     44
    3145    return esc_html($adword);
    3246}
    3347
    3448add_shortcode('insertr', 'insertr_function');
     49
Note: See TracChangeset for help on using the changeset viewer.