Changeset 2425873
- Timestamp:
- 11/25/2020 05:04:33 PM (5 years ago)
- Location:
- featured-image-admin-thumb-fiat
- Files:
-
- 2 edited
- 2 copied
-
tags/1.6 (copied) (copied from featured-image-admin-thumb-fiat/trunk)
-
tags/1.6/README.txt (copied) (copied from featured-image-admin-thumb-fiat/trunk/README.txt) (1 diff)
-
tags/1.6/admin/class-featured-image-admin-thumb-admin.php (modified) (2 diffs)
-
trunk/admin/class-featured-image-admin-thumb-admin.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
featured-image-admin-thumb-fiat/tags/1.6/README.txt
r2370423 r2425873 5 5 Requires at least: 3.5.1 6 6 Requires PHP: 7.0 7 Tested up to: 5. 57 Tested up to: 5.6 8 8 Stable tag: 1.5.3 9 9 License: GPLv2 or later -
featured-image-admin-thumb-fiat/tags/1.6/admin/class-featured-image-admin-thumb-admin.php
r2115823 r2425873 107 107 add_action( 'pre_get_posts', array( $this, 'fiat_posts_orderby' ) ); 108 108 } 109 110 109 /** 111 110 * Register admin column handlers for posts and pages, taxonomies and other custom post types 112 111 * 112 * Find all post_types that support thumbnails and remove those that are excluded with our filter 113 * Then add thumbnail support 114 * 113 115 * Fired in the 'admin_init' action 114 116 */ 115 117 public function fiat_init_columns() { 116 118 117 $available_post_types = array_ diff( get_post_types(), apply_filters( 'fiat/restrict_post_types', $this->default_excluded_post_types) );119 $available_post_types = array_keys( array_diff( array_flip ( get_post_types_by_support('thumbnail') ), apply_filters( 'fiat/restrict_post_types', $this->default_excluded_post_types ) ) ); 118 120 119 121 if ( $this->is_edd_active && isset( $available_post_types['download'] ) ) { 120 122 add_filter( 'edd_download_columns', array( $this, 'include_thumb_column_edd' ) ); 121 add_filter( 'fes_download_table_columns', array( $this, 'include_thumb_column_edd' ) ); 122 } 123 124 foreach ( $available_post_types as $post_type ) { 125 add_action( "manage_{$post_type}_posts_custom_column", array( $this, 'fiat_custom_columns' ), 2, 2 ); 126 add_filter( "manage_{$post_type}_posts_columns", array( $this, 'fiat_add_thumb_column' ) ); 127 add_filter( "manage_edit-{$post_type}_sortable_columns", array( $this, 'fiat_thumb_sortable_columns' ) ); 128 } 123 add_filter( 'fes_download_table_columns', array( $this, 'include_thumb_column_edd' ) ); 124 } 125 126 array_map( array( $this, 'add_post_type_thumb_support' ), $available_post_types ); 129 127 130 128 // For taxonomies. … … 137 135 138 136 137 } 138 139 /** 140 * @param $post_type 141 * 142 * Add thumbnail display support for the selected post_type 143 */ 144 public function add_post_type_thumb_support( $post_type ) 145 { 146 add_action( "manage_{$post_type}_posts_custom_column", array( $this, 'fiat_custom_columns' ), 2, 2 ); 147 add_filter( "manage_{$post_type}_posts_columns", array( $this, 'fiat_add_thumb_column' ) ); 148 add_filter( "manage_edit-{$post_type}_sortable_columns", array( $this, 'fiat_thumb_sortable_columns' ) ); 139 149 } 140 150 /** -
featured-image-admin-thumb-fiat/trunk/admin/class-featured-image-admin-thumb-admin.php
r2115823 r2425873 107 107 add_action( 'pre_get_posts', array( $this, 'fiat_posts_orderby' ) ); 108 108 } 109 110 109 /** 111 110 * Register admin column handlers for posts and pages, taxonomies and other custom post types 112 111 * 112 * Find all post_types that support thumbnails and remove those that are excluded with our filter 113 * Then add thumbnail support 114 * 113 115 * Fired in the 'admin_init' action 114 116 */ 115 117 public function fiat_init_columns() { 116 118 117 $available_post_types = array_ diff( get_post_types(), apply_filters( 'fiat/restrict_post_types', $this->default_excluded_post_types) );119 $available_post_types = array_keys( array_diff( array_flip ( get_post_types_by_support('thumbnail') ), apply_filters( 'fiat/restrict_post_types', $this->default_excluded_post_types ) ) ); 118 120 119 121 if ( $this->is_edd_active && isset( $available_post_types['download'] ) ) { 120 122 add_filter( 'edd_download_columns', array( $this, 'include_thumb_column_edd' ) ); 121 add_filter( 'fes_download_table_columns', array( $this, 'include_thumb_column_edd' ) ); 122 } 123 124 foreach ( $available_post_types as $post_type ) { 125 add_action( "manage_{$post_type}_posts_custom_column", array( $this, 'fiat_custom_columns' ), 2, 2 ); 126 add_filter( "manage_{$post_type}_posts_columns", array( $this, 'fiat_add_thumb_column' ) ); 127 add_filter( "manage_edit-{$post_type}_sortable_columns", array( $this, 'fiat_thumb_sortable_columns' ) ); 128 } 123 add_filter( 'fes_download_table_columns', array( $this, 'include_thumb_column_edd' ) ); 124 } 125 126 array_map( array( $this, 'add_post_type_thumb_support' ), $available_post_types ); 129 127 130 128 // For taxonomies. … … 137 135 138 136 137 } 138 139 /** 140 * @param $post_type 141 * 142 * Add thumbnail display support for the selected post_type 143 */ 144 public function add_post_type_thumb_support( $post_type ) 145 { 146 add_action( "manage_{$post_type}_posts_custom_column", array( $this, 'fiat_custom_columns' ), 2, 2 ); 147 add_filter( "manage_{$post_type}_posts_columns", array( $this, 'fiat_add_thumb_column' ) ); 148 add_filter( "manage_edit-{$post_type}_sortable_columns", array( $this, 'fiat_thumb_sortable_columns' ) ); 139 149 } 140 150 /**
Note: See TracChangeset
for help on using the changeset viewer.