Changeset 2563949
- Timestamp:
- 07/14/2021 12:04:02 AM (4 years ago)
- Location:
- add-toolbar-content-links
- Files:
-
- 7 edited
- 1 copied
-
assets/screenshot-1.png (modified) (1 prop) (previous)
-
assets/screenshot-2.png (modified) (1 prop) (previous)
-
assets/screenshot-3.png (modified) (1 prop) (previous)
-
tags/1.1 (copied) (copied from add-toolbar-content-links/trunk)
-
tags/1.1/add-toolbar-content-links.php (modified) (4 diffs)
-
tags/1.1/readme.txt (modified) (2 diffs)
-
trunk/add-toolbar-content-links.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
add-toolbar-content-links/assets/screenshot-1.png
-
Property
svn:mime-type
changed from
application/octet-streamtoimage/png
-
Property
svn:mime-type
changed from
-
add-toolbar-content-links/assets/screenshot-2.png
-
Property
svn:mime-type
changed from
application/octet-streamtoimage/png
-
Property
svn:mime-type
changed from
-
add-toolbar-content-links/assets/screenshot-3.png
-
Property
svn:mime-type
changed from
application/octet-streamtoimage/png
-
Property
svn:mime-type
changed from
-
add-toolbar-content-links/tags/1.1/add-toolbar-content-links.php
r1396580 r2563949 1 1 <?php 2 /** 3 * Plugin Name: Admin Toolbar Content Links 4 * Plugin URI: https://github.com/circlecube/add-toolbar-content-links 5 * Description: Add shortcut links to the admin toolbar to the index pages listing all content types. Save clicks = save time. 6 * Version: 1.1 7 * Requires at least: 5.2 8 * Requires PHP: 7.2 9 * Author: Evan Mullins 10 * Author URI: https://circlecube.com 11 * License: GPLv2 or later 12 * License URI: https://www.gnu.org/licenses/gpl-2.0.html 13 */ 14 2 15 /* 3 Plugin Name: Admin Toolbar Content Links 4 Plugin URI: https://circlecube.com 5 Description: Add shortcut links to the admin toolbar to the index pages listing all content types. Save clicks = save time. 6 Version: 1.0 7 Author: Evan Mullins 8 Author URI: https://circlecube.com 9 Author Email: [email protected] 10 License: 11 12 Copyright 2011 Evan Mullins ([email protected]) 16 17 Copyright 2021 Evan Mullins ([email protected]) 13 18 14 19 This program is free software; you can redistribute it and/or modify … … 28 33 29 34 class AddToolbarContentLinks { 30 31 /*--------------------------------------------*32 * Constants33 *--------------------------------------------*/34 const name = 'Add Toolbar Content Links';35 const slug = 'add_toolbar_content_links';36 35 37 36 /** … … 39 38 */ 40 39 function __construct() { 41 //register an activation hook for the plugin 42 register_activation_hook( __FILE__, array( &$this, 'install_add_toolbar_content_links' ) ); 43 44 //Hook up to the init action 45 add_action( 'init', array( &$this, 'init_add_toolbar_content_links' ) ); 40 //Hook up to the admin_bar_menu action 46 41 add_action('admin_bar_menu', array( $this, 'custom_toolbar_link'), 999); 47 }48 49 /**50 * Runs when the plugin is activated51 */52 function install_add_toolbar_content_links() {53 // do not generate any output here54 }55 56 /**57 * Runs when the plugin is initialized58 */59 function init_add_toolbar_content_links() {60 // Load JavaScript and stylesheets61 $this->register_scripts_and_styles();62 63 64 if ( is_admin() ) {65 //this will run when in the WordPress admin66 } else {67 //this will run when on the frontend68 }69 70 /*71 * TODO: Define custom functionality for your plugin here72 *73 * For more information:74 * http://codex.wordpress.org/Plugin_API#Hooks.2C_Actions_and_Filters75 */76 add_action( 'your_action_here', array( &$this, 'action_callback_method_name' ) );77 add_filter( 'your_filter_here', array( &$this, 'filter_callback_method_name' ) );78 79 }80 81 function action_callback_method_name() {82 // TODO define your action method here83 }84 85 function filter_callback_method_name() {86 // TODO define your filter method here87 42 } 88 43 … … 255 210 } 256 211 257 258 259 /**260 * Registers and enqueues stylesheets for the administration panel and the261 * public facing site.262 */263 private function register_scripts_and_styles() {264 if ( is_admin() ) {265 $this->load_file( self::slug . '-admin-script', '/js/admin.js', true );266 $this->load_file( self::slug . '-admin-style', '/css/admin.css' );267 } else {268 269 } // end if/else270 } // end register_scripts_and_styles271 272 /**273 * Helper function for registering and enqueueing scripts and styles.274 *275 * @name The ID to register with WordPress276 * @file_path The path to the actual file277 * @is_script Optional argument for if the incoming file_path is a JavaScript source file.278 */279 private function load_file( $name, $file_path, $is_script = false ) {280 281 $url = plugins_url($file_path, __FILE__);282 $file = plugin_dir_path(__FILE__) . $file_path;283 284 if( file_exists( $file ) ) {285 if( $is_script ) {286 wp_register_script( $name, $url, array('jquery') ); //depends on jquery287 wp_enqueue_script( $name );288 } else {289 wp_register_style( $name, $url );290 wp_enqueue_style( $name );291 } // end if292 } // end if293 294 } // end load_file295 296 212 } // end class 297 213 new AddToolbarContentLinks(); -
add-toolbar-content-links/tags/1.1/readme.txt
r1396584 r2563949 4 4 Tags: admin, toolbar, shortcuts 5 5 Requires at least: 3.3 6 Tested up to: 4.57 Stable tag: 1. 06 Tested up to: 5.8 7 Stable tag: 1.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 37 37 38 38 == Changelog == 39 40 = 1.1 = 41 * Minor code cleanup 42 * Testing on WordPress 5.8 39 43 40 44 = 1.0 = -
add-toolbar-content-links/trunk/add-toolbar-content-links.php
r1396580 r2563949 1 1 <?php 2 /** 3 * Plugin Name: Admin Toolbar Content Links 4 * Plugin URI: https://github.com/circlecube/add-toolbar-content-links 5 * Description: Add shortcut links to the admin toolbar to the index pages listing all content types. Save clicks = save time. 6 * Version: 1.1 7 * Requires at least: 5.2 8 * Requires PHP: 7.2 9 * Author: Evan Mullins 10 * Author URI: https://circlecube.com 11 * License: GPLv2 or later 12 * License URI: https://www.gnu.org/licenses/gpl-2.0.html 13 */ 14 2 15 /* 3 Plugin Name: Admin Toolbar Content Links 4 Plugin URI: https://circlecube.com 5 Description: Add shortcut links to the admin toolbar to the index pages listing all content types. Save clicks = save time. 6 Version: 1.0 7 Author: Evan Mullins 8 Author URI: https://circlecube.com 9 Author Email: [email protected] 10 License: 11 12 Copyright 2011 Evan Mullins ([email protected]) 16 17 Copyright 2021 Evan Mullins ([email protected]) 13 18 14 19 This program is free software; you can redistribute it and/or modify … … 28 33 29 34 class AddToolbarContentLinks { 30 31 /*--------------------------------------------*32 * Constants33 *--------------------------------------------*/34 const name = 'Add Toolbar Content Links';35 const slug = 'add_toolbar_content_links';36 35 37 36 /** … … 39 38 */ 40 39 function __construct() { 41 //register an activation hook for the plugin 42 register_activation_hook( __FILE__, array( &$this, 'install_add_toolbar_content_links' ) ); 43 44 //Hook up to the init action 45 add_action( 'init', array( &$this, 'init_add_toolbar_content_links' ) ); 40 //Hook up to the admin_bar_menu action 46 41 add_action('admin_bar_menu', array( $this, 'custom_toolbar_link'), 999); 47 }48 49 /**50 * Runs when the plugin is activated51 */52 function install_add_toolbar_content_links() {53 // do not generate any output here54 }55 56 /**57 * Runs when the plugin is initialized58 */59 function init_add_toolbar_content_links() {60 // Load JavaScript and stylesheets61 $this->register_scripts_and_styles();62 63 64 if ( is_admin() ) {65 //this will run when in the WordPress admin66 } else {67 //this will run when on the frontend68 }69 70 /*71 * TODO: Define custom functionality for your plugin here72 *73 * For more information:74 * http://codex.wordpress.org/Plugin_API#Hooks.2C_Actions_and_Filters75 */76 add_action( 'your_action_here', array( &$this, 'action_callback_method_name' ) );77 add_filter( 'your_filter_here', array( &$this, 'filter_callback_method_name' ) );78 79 }80 81 function action_callback_method_name() {82 // TODO define your action method here83 }84 85 function filter_callback_method_name() {86 // TODO define your filter method here87 42 } 88 43 … … 255 210 } 256 211 257 258 259 /**260 * Registers and enqueues stylesheets for the administration panel and the261 * public facing site.262 */263 private function register_scripts_and_styles() {264 if ( is_admin() ) {265 $this->load_file( self::slug . '-admin-script', '/js/admin.js', true );266 $this->load_file( self::slug . '-admin-style', '/css/admin.css' );267 } else {268 269 } // end if/else270 } // end register_scripts_and_styles271 272 /**273 * Helper function for registering and enqueueing scripts and styles.274 *275 * @name The ID to register with WordPress276 * @file_path The path to the actual file277 * @is_script Optional argument for if the incoming file_path is a JavaScript source file.278 */279 private function load_file( $name, $file_path, $is_script = false ) {280 281 $url = plugins_url($file_path, __FILE__);282 $file = plugin_dir_path(__FILE__) . $file_path;283 284 if( file_exists( $file ) ) {285 if( $is_script ) {286 wp_register_script( $name, $url, array('jquery') ); //depends on jquery287 wp_enqueue_script( $name );288 } else {289 wp_register_style( $name, $url );290 wp_enqueue_style( $name );291 } // end if292 } // end if293 294 } // end load_file295 296 212 } // end class 297 213 new AddToolbarContentLinks(); -
add-toolbar-content-links/trunk/readme.txt
r1396584 r2563949 4 4 Tags: admin, toolbar, shortcuts 5 5 Requires at least: 3.3 6 Tested up to: 4.57 Stable tag: 1. 06 Tested up to: 5.8 7 Stable tag: 1.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 37 37 38 38 == Changelog == 39 40 = 1.1 = 41 * Minor code cleanup 42 * Testing on WordPress 5.8 39 43 40 44 = 1.0 =
Note: See TracChangeset
for help on using the changeset viewer.