Changeset 3407133
- Timestamp:
- 12/01/2025 06:23:14 PM (4 months ago)
- Location:
- easy-media-link/trunk
- Files:
-
- 2 edited
-
easy-media-link.php (modified) (3 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
easy-media-link/trunk/easy-media-link.php
r3346627 r3407133 4 4 * Plugin URI: https://github.com/cesteptcbguy/easy-media-link 5 5 * Description: Adds a Media Library link to the admin bar when logged in and viewing the front end. 6 * Version: 1. 0.06 * Version: 1.1.0 7 7 * Requires at least: 6.0 8 * Tested up to: 6. 88 * Tested up to: 6.9 9 9 * Requires PHP: 7.4 10 10 * Author: Chris Estep, TCBGuys … … 13 13 * License URI: https://www.gnu.org/licenses/gpl-2.0.html 14 14 * Text Domain: easy-media-link 15 * Domain Path: /languages 15 16 */ 16 17 … … 18 19 19 20 /** 21 * Load plugin textdomain for translations. 22 */ 23 function eml_load_textdomain() { 24 load_plugin_textdomain( 25 'easy-media-link', 26 false, 27 dirname( plugin_basename( __FILE__ ) ) . '/languages/' 28 ); 29 } 30 add_action( 'plugins_loaded', 'eml_load_textdomain' ); 31 32 /** 20 33 * Add “Media Library” link to the admin bar on the front end for users who can upload files. 21 34 * 22 * @param WP_Admin_Bar $wp_admin_bar 35 * @param WP_Admin_Bar $wp_admin_bar Admin bar instance. 23 36 */ 24 37 function 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 } 29 42 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 } 41 58 } 42 59 add_action( 'admin_bar_menu', 'eml_add_media_link_to_admin_menu', 999 ); -
easy-media-link/trunk/readme.txt
r3346627 r3407133 3 3 Tags: admin bar, toolbar, media, media library, frontend 4 4 Requires at least: 6.0 5 Tested up to: 6. 85 Tested up to: 6.9 6 6 Requires PHP: 7.4 7 Stable tag: 1. 0.07 Stable tag: 1.1.0 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 50 50 == Changelog == 51 51 52 = 1.1.0 = 53 * Add translation loading support and make the plugin fully translation-ready. 54 * Confirm compatibility with WordPress 6.9. 55 52 56 = 1.0.0 = 53 57 * Initial release: adds a Media Library link to the admin bar on the front end for users who can upload files. … … 55 59 == Upgrade Notice == 56 60 61 = 1.1.0 = 62 Adds translation support and confirms compatibility with WordPress 6.9. 63 57 64 = 1.0.0 = 58 65 Initial release.
Note: See TracChangeset
for help on using the changeset viewer.