Plugin Directory

Changeset 2563949


Ignore:
Timestamp:
07/14/2021 12:04:02 AM (4 years ago)
Author:
circlecube
Message:

Update to version 1.1 from GitHub

Location:
add-toolbar-content-links
Files:
7 edited
1 copied

Legend:

Unmodified
Added
Removed
  • add-toolbar-content-links/assets/screenshot-1.png

    • Property svn:mime-type changed from application/octet-stream to image/png
  • add-toolbar-content-links/assets/screenshot-2.png

    • Property svn:mime-type changed from application/octet-stream to image/png
  • add-toolbar-content-links/assets/screenshot-3.png

    • Property svn:mime-type changed from application/octet-stream to image/png
  • add-toolbar-content-links/tags/1.1/add-toolbar-content-links.php

    r1396580 r2563949  
    11<?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
    215/*
    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])
    1318
    1419  This program is free software; you can redistribute it and/or modify
     
    2833
    2934class AddToolbarContentLinks {
    30 
    31     /*--------------------------------------------*
    32      * Constants
    33      *--------------------------------------------*/
    34     const name = 'Add Toolbar Content Links';
    35     const slug = 'add_toolbar_content_links';
    3635   
    3736    /**
     
    3938     */
    4039    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
    4641        add_action('admin_bar_menu', array( $this, 'custom_toolbar_link'), 999);
    47     }
    48  
    49     /**
    50      * Runs when the plugin is activated
    51      */ 
    52     function install_add_toolbar_content_links() {
    53         // do not generate any output here
    54     }
    55  
    56     /**
    57      * Runs when the plugin is initialized
    58      */
    59     function init_add_toolbar_content_links() {
    60         // Load JavaScript and stylesheets
    61         $this->register_scripts_and_styles();
    62 
    63    
    64         if ( is_admin() ) {
    65             //this will run when in the WordPress admin
    66         } else {
    67             //this will run when on the frontend
    68         }
    69 
    70         /*
    71          * TODO: Define custom functionality for your plugin here
    72          *
    73          * For more information:
    74          * http://codex.wordpress.org/Plugin_API#Hooks.2C_Actions_and_Filters
    75          */
    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 here
    83     }
    84 
    85     function filter_callback_method_name() {
    86         // TODO define your filter method here
    8742    }
    8843
     
    255210    }
    256211
    257 
    258  
    259     /**
    260      * Registers and enqueues stylesheets for the administration panel and the
    261      * 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/else
    270     } // end register_scripts_and_styles
    271    
    272     /**
    273      * Helper function for registering and enqueueing scripts and styles.
    274      *
    275      * @name    The     ID to register with WordPress
    276      * @file_path       The path to the actual file
    277      * @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 jquery
    287                 wp_enqueue_script( $name );
    288             } else {
    289                 wp_register_style( $name, $url );
    290                 wp_enqueue_style( $name );
    291             } // end if
    292         } // end if
    293 
    294     } // end load_file
    295  
    296212} // end class
    297213new AddToolbarContentLinks();
  • add-toolbar-content-links/tags/1.1/readme.txt

    r1396584 r2563949  
    44Tags: admin, toolbar, shortcuts
    55Requires at least: 3.3
    6 Tested up to: 4.5
    7 Stable tag: 1.0
     6Tested up to: 5.8
     7Stable tag: 1.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3737
    3838== Changelog ==
     39
     40= 1.1 =
     41* Minor code cleanup
     42* Testing on WordPress 5.8
    3943
    4044= 1.0 =
  • add-toolbar-content-links/trunk/add-toolbar-content-links.php

    r1396580 r2563949  
    11<?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
    215/*
    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])
    1318
    1419  This program is free software; you can redistribute it and/or modify
     
    2833
    2934class AddToolbarContentLinks {
    30 
    31     /*--------------------------------------------*
    32      * Constants
    33      *--------------------------------------------*/
    34     const name = 'Add Toolbar Content Links';
    35     const slug = 'add_toolbar_content_links';
    3635   
    3736    /**
     
    3938     */
    4039    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
    4641        add_action('admin_bar_menu', array( $this, 'custom_toolbar_link'), 999);
    47     }
    48  
    49     /**
    50      * Runs when the plugin is activated
    51      */ 
    52     function install_add_toolbar_content_links() {
    53         // do not generate any output here
    54     }
    55  
    56     /**
    57      * Runs when the plugin is initialized
    58      */
    59     function init_add_toolbar_content_links() {
    60         // Load JavaScript and stylesheets
    61         $this->register_scripts_and_styles();
    62 
    63    
    64         if ( is_admin() ) {
    65             //this will run when in the WordPress admin
    66         } else {
    67             //this will run when on the frontend
    68         }
    69 
    70         /*
    71          * TODO: Define custom functionality for your plugin here
    72          *
    73          * For more information:
    74          * http://codex.wordpress.org/Plugin_API#Hooks.2C_Actions_and_Filters
    75          */
    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 here
    83     }
    84 
    85     function filter_callback_method_name() {
    86         // TODO define your filter method here
    8742    }
    8843
     
    255210    }
    256211
    257 
    258  
    259     /**
    260      * Registers and enqueues stylesheets for the administration panel and the
    261      * 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/else
    270     } // end register_scripts_and_styles
    271    
    272     /**
    273      * Helper function for registering and enqueueing scripts and styles.
    274      *
    275      * @name    The     ID to register with WordPress
    276      * @file_path       The path to the actual file
    277      * @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 jquery
    287                 wp_enqueue_script( $name );
    288             } else {
    289                 wp_register_style( $name, $url );
    290                 wp_enqueue_style( $name );
    291             } // end if
    292         } // end if
    293 
    294     } // end load_file
    295  
    296212} // end class
    297213new AddToolbarContentLinks();
  • add-toolbar-content-links/trunk/readme.txt

    r1396584 r2563949  
    44Tags: admin, toolbar, shortcuts
    55Requires at least: 3.3
    6 Tested up to: 4.5
    7 Stable tag: 1.0
     6Tested up to: 5.8
     7Stable tag: 1.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3737
    3838== Changelog ==
     39
     40= 1.1 =
     41* Minor code cleanup
     42* Testing on WordPress 5.8
    3943
    4044= 1.0 =
Note: See TracChangeset for help on using the changeset viewer.