*/ class Adminify_RecentPosts { public function __construct() { add_action( 'wp_dashboard_setup', [ $this, 'jltwp_adminify_recent_posts_widget_register' ] ); } public function jltwp_adminify_recent_posts_widget_register() { wp_add_dashboard_widget( 'jltwp_adminify_dash_recent_posts', esc_html__( 'Recent Posts - Adminify', 'adminify' ), [ $this, 'jltwp_adminify_recent_posts_widget' ] ); } public function jltwp_adminify_recent_posts_widget() { $args = [ 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => 6, 'orderby' => 'date', 'ignore_sticky_posts' => 1, 'tax_query' => [], ]; ?>
have_posts() ) { ?>
have_posts() ) { $adminify_dash_recent_posts->the_post(); $post_title = get_the_title(); $edit_url = admin_url( 'post.php?post=' . get_the_ID() . '&action=edit' ); $image_id = get_post_thumbnail_id(); $thumb_image = wp_get_attachment_url( get_post_thumbnail_id( get_the_ID(), [ 36, 36 ] ) ); $image_alt = get_post_meta( $image_id, '_wp_attachment_image_alt', true ); ?>
Icon
' . esc_html( get_the_author() ) . ''; ?>
' . esc_html__( '%s', 'adminify' ) . ' ', $categories_list // phpcs:ignore WordPress.Security.EscapeOutput ); } ?>