Plugin Directory

Changeset 3407133


Ignore:
Timestamp:
12/01/2025 06:23:14 PM (4 months ago)
Author:
cestep
Message:

Update trunk for version 1.1.0: translation loading and WP 6.9 compatibility.

Location:
easy-media-link/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • easy-media-link/trunk/easy-media-link.php

    r3346627 r3407133  
    44 * Plugin URI:        https://github.com/cesteptcbguy/easy-media-link
    55 * Description:       Adds a Media Library link to the admin bar when logged in and viewing the front end.
    6  * Version:           1.0.0
     6 * Version:           1.1.0
    77 * Requires at least: 6.0
    8  * Tested up to:      6.8
     8 * Tested up to:      6.9
    99 * Requires PHP:      7.4
    1010 * Author:            Chris Estep, TCBGuys
     
    1313 * License URI:       https://www.gnu.org/licenses/gpl-2.0.html
    1414 * Text Domain:       easy-media-link
     15 * Domain Path:       /languages
    1516 */
    1617
     
    1819
    1920/**
     21 * Load plugin textdomain for translations.
     22 */
     23function eml_load_textdomain() {
     24    load_plugin_textdomain(
     25        'easy-media-link',
     26        false,
     27        dirname( plugin_basename( __FILE__ ) ) . '/languages/'
     28    );
     29}
     30add_action( 'plugins_loaded', 'eml_load_textdomain' );
     31
     32/**
    2033 * Add “Media Library” link to the admin bar on the front end for users who can upload files.
    2134 *
    22  * @param WP_Admin_Bar $wp_admin_bar
     35 * @param WP_Admin_Bar $wp_admin_bar Admin bar instance.
    2336 */
    2437function eml_add_media_link_to_admin_menu( $wp_admin_bar ) {
    25     // Only on front end and only if the toolbar is visible.
    26     if ( is_admin() || ! is_admin_bar_showing() ) {
    27         return;
    28     }
     38    // Only on front end and only if the toolbar is visible.
     39    if ( is_admin() || ! is_admin_bar_showing() ) {
     40        return;
     41    }
    2942
    30     // Restrict to users allowed to upload media.
    31     if ( current_user_can( 'upload_files' ) ) {
    32         $wp_admin_bar->add_menu( array(
    33             // Use 'site-name' as a stable parent or omit 'parent' to make it top-level.
    34             'parent' => 'site-name',
    35             'id'     => 'eml-media-library',
    36             'title'  => __( 'Media Library', 'easy-media-link' ),
    37             'href'   => admin_url( 'upload.php' ),
    38             'meta'   => array( 'title' => __( 'Open Media Library', 'easy-media-link' ) ),
    39         ) );
    40     }
     43    // Restrict to users allowed to upload media.
     44    if ( current_user_can( 'upload_files' ) ) {
     45        $wp_admin_bar->add_menu(
     46            array(
     47                // Use 'site-name' as a stable parent or omit 'parent' to make it top-level.
     48                'parent' => 'site-name',
     49                'id'     => 'eml-media-library',
     50                'title'  => __( 'Media Library', 'easy-media-link' ),
     51                'href'   => admin_url( 'upload.php' ),
     52                'meta'   => array(
     53                    'title' => __( 'Open Media Library', 'easy-media-link' ),
     54                ),
     55            )
     56        );
     57    }
    4158}
    4259add_action( 'admin_bar_menu', 'eml_add_media_link_to_admin_menu', 999 );
  • easy-media-link/trunk/readme.txt

    r3346627 r3407133  
    33Tags: admin bar, toolbar, media, media library, frontend
    44Requires at least: 6.0
    5 Tested up to: 6.8
     5Tested up to: 6.9
    66Requires PHP: 7.4
    7 Stable tag: 1.0.0
     7Stable tag: 1.1.0
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    5050== Changelog ==
    5151
     52= 1.1.0 =
     53* Add translation loading support and make the plugin fully translation-ready.
     54* Confirm compatibility with WordPress 6.9.
     55
    5256= 1.0.0 =
    5357* Initial release: adds a Media Library link to the admin bar on the front end for users who can upload files.
     
    5559== Upgrade Notice ==
    5660
     61= 1.1.0 =
     62Adds translation support and confirms compatibility with WordPress 6.9.
     63
    5764= 1.0.0 =
    5865Initial release.
Note: See TracChangeset for help on using the changeset viewer.