base, array( 'edit', 'post' ) ) ) { //Styles wp_enqueue_style( 'wm-admin-styles', wm_get_stylesheet_directory_uri( 'css/admin.css' ), false, WM_SCRIPTS_VERSION, 'screen' ); //Styles - inline $custom_styles .= '#post-' . get_option( 'page_on_front' ) . ' { background: #d7eef4; }'; $custom_styles .= '#post-' . get_option( 'page_for_posts' ) . ' { background: #d7f4e3; }'; wp_add_inline_style( 'wm-admin-styles', apply_filters( 'wmhook_esc_css', $custom_styles ) ); } } } // /wm_assets_admin /** * 30) Posts list table */ /** * Register table columns * * @since 1.0 * @version 1.0 * * @param array $columns */ if ( ! function_exists( 'wm_post_columns_register' ) ) { function wm_post_columns_register( $columns ) { //Preparing output if ( 'jetpack-portfolio' == get_post_type() ) { unset( $columns['thumbnail'] ); } $add = array_slice( $columns, 0, 1 ); $add['wm-thumb'] = __( 'Image', 'wm_domain' ); //Output return apply_filters( 'wmhook_wm_post_columns_register_output', array_merge( $add, array_slice( $columns, 1 ) ) ); } } // /wm_post_columns_register /** * Admin post list columns content * * @since 1.0 * @version 1.2 * * @param string $column * @param absint $post_id */ if ( ! function_exists( 'wm_post_columns_render' ) ) { function wm_post_columns_render( $column, $post_id ) { //Thumbnail renderer if ( 'wm-thumb' === $column ) { $size = ( class_exists( 'Jetpack_Portfolio' ) ) ? ( 'jetpack-portfolio-admin-thumb' ) : ( 'thumbnail' ); $size = apply_filters( 'wmhook_wm-thumb_size', $size ); $image = ( has_post_thumbnail() ) ? ( get_the_post_thumbnail( $post_id, $size ) ) : ( '' ); $thumb_class = ( $image ) ? ( ' has-thumb' ) : ( ' no-thumb' ); $thumb_class .= ' size-' . $size; echo ''; if ( get_edit_post_link() ) { edit_post_link( $image ); } else { echo '' . $image . ''; } echo ''; } } } // /wm_post_columns_render ?>