Plugin Directory

Changeset 3110639

Timestamp:
07/01/2024 05:21:34 PM (4 months ago)
Author:
pagelab
Message:

Tagging version 0.6.4

Location:
dynamic-year-block
Files:
13 added
4 edited

Legend:

Unmodified
Added
Removed
  • dynamic-year-block/trunk/README.md

    r3069691 r3110639  
    88* Requires at least: 5.9
    99* Requires PHP: 7.0
    10 * Stable tag: 0.6.3
     10* Stable tag: 0.6.
    1111* License: GPL 2.0 or later
    1212
  • dynamic-year-block/trunk/README.txt

    r3069691 r3110639  
    55Requires at least: 5.9
    66Requires PHP:      7.0
    7 Stable tag:        0.6.3
     7Stable tag:        0.6.
    88License:           GPL 2.0 or later
    99License URI:       https://www.gnu.org/licenses/gpl-2.0.html
     
    9090== Changelog ==
    9191
     92
     93
     94
     95
    9296= 0.6.3 =
    9397* Updated the code for WordPress version 6.5
  • dynamic-year-block/trunk/build/block.json

    r3050068 r3110639  
    33  "apiVersion": 3,
    44  "name": "epico/dynamic-year-block",
    5   "version": "0.6.3",
     5  "version": "0.6.",
    66  "title": "Dynamic Year",
    77  "category": "text",
    88  "icon": "calendar",
    99  "keywords": [
    10     "year",
    11     "dynamic",
    12     "date",
    13     "block",
    14     "footer",
    15     "copyright"
     10"year",
     11"dynamic",
     12"date",
     13"block",
     14"footer",
     15"copyright"
    1616  ],
    1717  "description": "A block that always displays the current year.",
    1818  "textdomain": "dynamic-year-block",
    1919  "attributes": {
    20     "format": {
    21       "type": "string",
    22       "default": "Y"
    23     },
    24     "beforeElement": {
    25       "type": "string",
    26       "default": ""
    27     },
    28     "afterElement": {
    29       "type": "string",
    30       "default": ""
    31     },
    32     "alignment": {
    33       "type": "string",
    34       "default": "none"
    35     },
    36     "displaySiteName": {
    37       "type": "boolean",
    38       "default": false
    39     }
     20"format": {
     21  "type": "string",
     22  "default": "Y"
     23},
     24"beforeElement": {
     25  "type": "string",
     26  "default": ""
     27},
     28"afterElement": {
     29  "type": "string",
     30  "default": ""
     31},
     32"alignment": {
     33  "type": "string",
     34  "default": "none"
     35},
     36"displaySiteName": {
     37  "type": "boolean",
     38  "default": false
     39}
    4040  },
    4141  "usesContext": [
    42     "backgroundColor",
    43     "foregroundColor"
     42"backgroundColor",
     43"foregroundColor"
    4444  ],
    4545  "supports": {
    46     "anchor": true,
    47     "html": false,
    48     "className": true,
    49     "__experimentalBorder": {
    50       "color": true,
    51       "radius": true,
    52       "style": true,
    53       "width": true
    54     },
    55     "spacing": {
    56       "padding": true,
    57       "margin": true
    58     },
    59     "dimensions": {
    60       "minHeight": true
    61     },
    62     "color": {
    63       "gradients": true,
    64       "link": true,
    65       "__experimentalDefaultControls": {
    66         "background": true,
    67         "text": true,
    68         "link": true
    69       }
    70     },
    71     "typography": {
    72       "fontSize": true,
    73       "lineHeight": true,
    74       "__experimentalFontFamily": true,
    75       "__experimentalFontWeight": true,
    76       "__experimentalFontStyle": true,
    77       "__experimentalTextTransform": true,
    78       "__experimentalTextDecoration": true,
    79       "__experimentalLetterSpacing": true,
    80       "__experimentalDefaultControls": {
    81         "fontSize": true,
    82         "__experimentalFontFamily": true,
    83         "__experimentalFontStyle": true,
    84         "__experimentalFontWeight": true
    85       }
    86     },
    87     "interactivity": {
    88       "clientNavigation": true
    89     }
     46"anchor": true,
     47"html": false,
     48"className": true,
     49"__experimentalBorder": {
     50  "color": true,
     51  "radius": true,
     52  "style": true,
     53  "width": true
     54},
     55"spacing": {
     56  "padding": true,
     57  "margin": true
     58},
     59"dimensions": {
     60  "minHeight": true
     61},
     62"color": {
     63  "gradients": true,
     64  "link": true,
     65  "__experimentalDefaultControls": {
     66"background": true,
     67"text": true,
     68"link": true
     69  }
     70},
     71"typography": {
     72  "fontSize": true,
     73  "lineHeight": true,
     74  "__experimentalFontFamily": true,
     75  "__experimentalFontWeight": true,
     76  "__experimentalFontStyle": true,
     77  "__experimentalTextTransform": true,
     78  "__experimentalTextDecoration": true,
     79  "__experimentalLetterSpacing": true,
     80  "__experimentalDefaultControls": {
     81"fontSize": true,
     82"__experimentalFontFamily": true,
     83"__experimentalFontStyle": true,
     84"__experimentalFontWeight": true
     85  }
     86},
     87"interactivity": {
     88  "clientNavigation": true
     89}
    9090  },
    9191  "editorScript": "file:./index.js"
  • dynamic-year-block/trunk/dynamic-year-block.php

    r3050068 r3110639  
    44 * Plugin URI:        https://github.com/EpicoStudio/dynamic-year-block
    55 * Description:       A block that always displays the current year in your copyright footer notice.
    6  * Version:           0.6.3
     6 * Version:           0.6.
    77 * Requires at least: 5.9
    88 * Requires PHP:      7.0
     
    3939        $current_date = current_datetime();
    4040        $format       = isset( $attributes['format'] ) ? $attributes['format'] : 'Y';
    41         $dynamic_year = $current_date->format($format);
     41        $dynamic_year = $current_date->format();
    4242
    4343        // Get the optional text BEFORE the year.
    4444        $before      = $attributes['beforeElement'] !== null ? $attributes['beforeElement'] : '';
    45         $beforeStart = !empty($attributes['beforeElement']) ? '<span class="dynamic-year-before">' : '';
    46         $beforeEnd   = !empty($attributes['beforeElement']) ? '</span>' : '';
     45        $beforeStart = !) ? '<span class="dynamic-year-before">' : '';
     46        $beforeEnd   = !) ? '</span>' : '';
    4747
    48         // Get the optional text AFTER the year.
    49         $after      = $attributes['afterElement'] !== null ? $attributes['afterElement'] : '';
    50         $afterStart = !empty($attributes['afterElement']) ? '<span class="dynamic-year-after">' : '';
    51         $afterEnd   = !empty($attributes['afterElement']) ? '</span>' : '';
     48        // Get the optional text AFTER the year.
     49        $;
     50        $;
     51        $after;
    5252
    53         // Define the aria-current attribute.
     53        // Determine if the afterElement content should be wrapped.
     54        $afterStart = ! empty( $attributes['afterElement'] ) && strcmp( $attributes['afterElement'], $defaultText ) !== 0 ? '<span class="dynamic-year-after">' : '';
     55        $afterEnd   = ! empty( $attributes['afterElement'] ) && strcmp( $attributes['afterElement'], $defaultText ) !== 0 ? '</span>' : '';
     56
     57        // Determine if the `afterElement` content should be wrapped.
     58        $afterStart = ! empty( $attributes['afterElement'] ) ? '<span class="dynamic-year-after">' : '';
     59        $afterEnd   = ! empty( $attributes['afterElement'] ) ? '</span>' : '';
     60
     61        // Define the `aria-current` attribute.
    5462        $aria_current = '';
    5563        if ( is_front_page() ) :
     
    6169
    6270        // Check if the site title is included and define the markup.
    63         $siteName   = ( $attributes['displaySiteName'] !== false ) ? ' <a target="_self" rel="home" href="' .  get_bloginfo( 'url', 'display' ) . '"' . $aria_current .  '>' . get_bloginfo( 'name', 'display' ) . '</a>' : '';
     71        $siteName   = ( $attributes['displaySiteName'] !== false ) ? ' <a target="_self" rel="home" href="' . ) . '</a>' : '';
    6472
    6573        // Markup.
     
    102110        // Add variables for usage on the block editor.
    103111        wp_add_inline_script( 'epico-dynamic-year-block-editor-script', 'const dynamicYearBlockData = ' . json_encode( array(
    104             'siteTitle' => get_bloginfo( 'name' ),
    105             'siteUrl' => get_bloginfo( 'url' ),
     112            'siteTitle' => ),
     113            'siteUrl' => ),
    106114        ) ), 'before' );
    107115
Note: See TracChangeset for help on using the changeset viewer.