Plugin Directory

Changeset 2870773


Ignore:
Timestamp:
02/24/2023 09:00:33 PM (3 years ago)
Author:
tfrommen
Message:

2.1.0

Location:
bring-back-the-get-shortlink-button
Files:
4 added
2 edited

Legend:

Unmodified
Added
Removed
  • bring-back-the-get-shortlink-button/trunk/bring-back-the-get-shortlink-button.php

    r2870501 r2870773  
    1212 * Plugin URI:        https://wordpress.org/plugins/bring-back-the-get-shortlink-button/
    1313 * Description:       This plugin brings back the Get Shortlink button, which is hidden by default since WordPress 4.4.
    14  * Version:           2.0.0
     14 * Version:           2.1.0
    1515 * Requires at least: 4.4
    1616 * Requires PHP:      7.4
     
    2222 */
    2323
    24 if ( ! function_exists( 'add_filter' ) ) {
     24namespace tfrommen\BringBackTheGetShortlinkButton;
     25
     26if ( ! function_exists( 'add_action' ) ) {
    2527    return;
    2628}
    2729
    28 add_filter( 'get_shortlink', function ( string $shortlink ): string {
     30/**
     31 * Bootstrap the plugin.
     32 *
     33 * @return void
     34 */
     35function bootstrap(): void {
     36
     37    add_filter( 'get_shortlink', __NAMESPACE__ . '\\pass_through' );
     38}
     39
     40/**
     41 * Simple pass-through callback for the shortlink filter.
     42 *
     43 * @param string $shortlink Shortlink.
     44 *
     45 * @return string Shortlink.
     46 */
     47function pass_through( string $shortlink ): string {
    2948
    3049    return $shortlink;
    31 } );
     50}
     51
     52add_action( 'plugins_loaded', __NAMESPACE__ . '\\bootstrap' );
  • bring-back-the-get-shortlink-button/trunk/readme.txt

    r2870501 r2870773  
    55Tested up to: 6.1
    66Requires PHP: 7.4
    7 Stable tag: 2.0.0
     7Stable tag: 2.1.0
    88License: GPL v3 or later
    99License URI: https://www.gnu.org/licenses/gpl-3.0.txt
     
    2727== Changelog ==
    2828
     29= 2.1.0 =
     30* Add unit tests.
     31* Split main plugin file into multiple functions to allow for better testability.
     32* Rename folder including WordPress.org assets.
     33
    2934= 2.0.0 =
    3035* Add type declarations.
     
    3742
    3843= 1.1.0 =
    39 * WordPress.org release.
     44WordPress.org release.
    4045
    4146= 1.0.0 =
    42 * Initial release.
     47Initial release.
Note: See TracChangeset for help on using the changeset viewer.