暫無描述

featured-image-admin-thumb.php 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. *
  4. * @package Featured_Image_Admin_Thumb
  5. * @author Sean Hayes <sean@seanhayes.biz>
  6. * @license GPL-2.0+
  7. * @link https://www.seanhayes.biz
  8. * @copyright 2014 Sean Hayes
  9. *
  10. * @wordpress-plugin
  11. * Plugin Name: Featured Image Admin Thumb
  12. * Plugin URI: https://www.seanhayes.biz
  13. * Description: Adds inline thumbnail image to admin columns for All Post/post types view (where supported). Click to easily set/change the featured image for that content.
  14. * Version: 1.6
  15. * Author: Sean Hayes
  16. * Author URI: https://www.seanhayes.biz
  17. * Text Domain: featured-image-admin-thumb-fiat
  18. * License: GPL-2.0+
  19. * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
  20. * Domain Path: /languages
  21. */
  22. // If this file is called directly, abort.
  23. if ( ! defined( 'WPINC' ) ) {
  24. die;
  25. }
  26. /*----------------------------------------------------------------------------*
  27. * Public-Facing Functionality
  28. *----------------------------------------------------------------------------*/
  29. require_once( plugin_dir_path( __FILE__ ) . 'public/class-featured-image-admin-thumb.php' );
  30. register_activation_hook( __FILE__, array( 'Featured_Image_Admin_Thumb', 'activate' ) );
  31. register_deactivation_hook( __FILE__, array( 'Featured_Image_Admin_Thumb', 'deactivate' ) );
  32. add_action( 'plugins_loaded', array( 'Featured_Image_Admin_Thumb', 'get_instance' ) );
  33. /*----------------------------------------------------------------------------*
  34. * Dashboard and Administrative Functionality
  35. *----------------------------------------------------------------------------*/
  36. /*
  37. *
  38. * If you want to include Ajax within the dashboard, change the following
  39. * conditional to:
  40. *
  41. * if ( is_admin() ) {
  42. * ...
  43. * }
  44. *
  45. * The code below is intended to to give the lightest footprint possible.
  46. */
  47. //if ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) {
  48. if ( is_admin() ) {
  49. require_once( plugin_dir_path( __FILE__ ) . 'admin/class-featured-image-admin-thumb-admin.php' );
  50. add_action( 'plugins_loaded', array( 'Featured_Image_Admin_Thumb_Admin', 'get_instance' ) );
  51. }