mirror of
https://github.com/10h30/display-featured-image-genesis.git
synced 2026-07-19 14:33:32 +09:00
add style for admin image column
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
* Plugin Name: Display Featured Image for Genesis
|
||||
* Plugin URI: http://github.com/robincornett/display-featured-image-genesis/
|
||||
* Description: This plugin requires the Genesis Framework. It intelligently varies the display of the post or page featured image, depending on size.
|
||||
* Version: 1.5.0
|
||||
* Version: 2.0.0
|
||||
* Author: Robin Cornett
|
||||
* Author URI: http://robincornett.com
|
||||
* License: GPL-2.0+
|
||||
|
||||
@@ -16,6 +16,8 @@ class Display_Featured_Image_Genesis_Admin {
|
||||
public function set_up_columns() {
|
||||
$this->set_up_taxonomy_columns();
|
||||
$this->set_up_post_type_columns();
|
||||
|
||||
add_action( 'admin_enqueue_scripts', array( $this, 'featured_image_column_width' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -108,7 +110,7 @@ class Display_Featured_Image_Genesis_Admin {
|
||||
public function custom_post_columns( $column, $post_id ) {
|
||||
|
||||
if ( 'featured_image' === $column ) {
|
||||
$image = get_the_post_thumbnail( $post_id, array( 60,60 ) );
|
||||
$image = get_the_post_thumbnail( $post_id, array( 65,65 ) );
|
||||
if ( $image ) {
|
||||
echo $image;
|
||||
}
|
||||
@@ -116,4 +118,18 @@ class Display_Featured_Image_Genesis_Admin {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* sets a width for the featured image column
|
||||
* @return stylesheet inline stylesheet to set featured image column width
|
||||
*/
|
||||
public function featured_image_column_width() {
|
||||
$screen = get_current_screen();
|
||||
if ( in_array( $screen->base, array( 'edit', 'edit-tags' ) ) ) { ?>
|
||||
<style type="text/css">
|
||||
.column-featured_image { width:105px; }
|
||||
.column-featured_image img { margin: 0 auto; display: block; }
|
||||
</style> <?php
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -187,7 +187,6 @@ class Display_Featured_Image_Genesis {
|
||||
$screen = get_current_screen();
|
||||
|
||||
if ( 'appearance_page_displayfeaturedimagegenesis' === $screen->id || ! empty( $screen->taxonomy ) ) {
|
||||
// if ( false !== $check || ! empty( get_current_screen()->taxonomy ) ) {
|
||||
wp_enqueue_media();
|
||||
wp_enqueue_script( 'displayfeaturedimage-upload' );
|
||||
wp_localize_script( 'displayfeaturedimage-upload', 'objectL10n', array(
|
||||
|
||||
Reference in New Issue
Block a user