COMPLETADO: Fase 1 de la migración a Clean Architecture + POO ## Estructura de Carpetas - ✓ Estructura completa de 4 capas (Domain, Application, Infrastructure, Presentation) - ✓ Carpetas de Use Cases (SaveComponent, GetComponent, DeleteComponent, SyncSchema) - ✓ Estructura de tests (Unit, Integration, E2E) - ✓ Carpetas de schemas y templates ## Composer y Autoloading - ✓ PSR-4 autoloading configurado para ROITheme namespace - ✓ Autoloader optimizado regenerado ## DI Container - ✓ DIContainer implementado con patrón Singleton - ✓ Métodos set(), get(), has() para gestión de servicios - ✓ Getters específicos para ComponentRepository, ValidationService, CacheService - ✓ Placeholders que serán implementados en Fase 5 - ✓ Prevención de clonación y deserialización ## Interfaces - ✓ ComponentRepositoryInterface (Domain) - ✓ ValidationServiceInterface (Application) - ✓ CacheServiceInterface (Application) - ✓ Component entity placeholder (Domain) ## Bootstrap - ✓ functions.php actualizado con carga de Composer autoloader - ✓ Inicialización del DIContainer - ✓ Helper function roi_container() disponible globalmente ## Tests - ✓ 10 tests unitarios para DIContainer (100% cobertura) - ✓ Total: 13 tests unitarios, 28 assertions - ✓ Suite de tests pasando correctamente ## Validación - ✓ Script de validación automatizado (48/48 checks pasados) - ✓ 100% de validaciones exitosas La arquitectura base está lista para la Fase 2. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
164 lines
4.1 KiB
PHP
164 lines
4.1 KiB
PHP
<?php
|
|
/**
|
|
* The template for displaying author archive pages
|
|
*
|
|
* This template displays posts from a specific author with author
|
|
* bio and information at the top.
|
|
*
|
|
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#author
|
|
*
|
|
* @package ROI_Theme
|
|
* @since 1.0.0
|
|
*/
|
|
|
|
get_header();
|
|
?>
|
|
|
|
<main id="main-content" class="site-main" role="main">
|
|
|
|
<div class="content-wrapper">
|
|
|
|
<!-- Primary Content Area -->
|
|
<div id="primary" class="content-area">
|
|
|
|
<?php if ( have_posts() ) : ?>
|
|
|
|
<!-- Author Archive Header -->
|
|
<header class="page-header author-header">
|
|
<?php
|
|
// Get the author
|
|
$author = get_queried_object();
|
|
?>
|
|
|
|
<div class="author-info">
|
|
<!-- Author Avatar -->
|
|
<div class="author-avatar">
|
|
<?php
|
|
echo get_avatar(
|
|
$author->ID,
|
|
120,
|
|
'',
|
|
sprintf(
|
|
/* translators: %s: author name */
|
|
esc_attr__( 'Avatar for %s', 'roi-theme' ),
|
|
esc_html( $author->display_name )
|
|
),
|
|
array(
|
|
'class' => 'author-avatar-img',
|
|
)
|
|
);
|
|
?>
|
|
</div>
|
|
|
|
<!-- Author Details -->
|
|
<div class="author-details">
|
|
<h1 class="page-title author-title">
|
|
<?php
|
|
printf(
|
|
/* translators: %s: author display name */
|
|
esc_html__( 'Posts by %s', 'roi-theme' ),
|
|
'<span class="author-name">' . esc_html( $author->display_name ) . '</span>'
|
|
);
|
|
?>
|
|
</h1>
|
|
|
|
<!-- Author Bio -->
|
|
<?php
|
|
$author_bio = get_the_author_meta( 'description', $author->ID );
|
|
if ( ! empty( $author_bio ) ) :
|
|
?>
|
|
<div class="author-bio">
|
|
<?php echo wp_kses_post( wpautop( $author_bio ) ); ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<!-- Author Stats -->
|
|
<div class="author-meta">
|
|
<span class="author-posts-count">
|
|
<?php
|
|
$post_count = count_user_posts( $author->ID, 'post', true );
|
|
printf(
|
|
/* translators: %s: number of posts */
|
|
esc_html( _n( '%s post', '%s posts', $post_count, 'roi-theme' ) ),
|
|
esc_html( number_format_i18n( $post_count ) )
|
|
);
|
|
?>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</header><!-- .page-header -->
|
|
|
|
<!-- Author Posts Loop -->
|
|
<div class="archive-posts author-posts">
|
|
|
|
<?php
|
|
// Start the WordPress Loop
|
|
while ( have_posts() ) :
|
|
the_post();
|
|
|
|
/**
|
|
* Include the Post-Type-specific template for the content.
|
|
* If you want to override this in a child theme, then include a file
|
|
* called content-___.php (where ___ is the Post Type name) and that will be used instead.
|
|
*/
|
|
get_template_part( 'template-parts/content', get_post_type() );
|
|
|
|
endwhile;
|
|
?>
|
|
|
|
</div><!-- .archive-posts -->
|
|
|
|
<?php
|
|
/**
|
|
* Pagination
|
|
* Display navigation to next/previous set of posts when applicable.
|
|
*/
|
|
the_posts_pagination(
|
|
array(
|
|
'mid_size' => 2,
|
|
'prev_text' => sprintf(
|
|
'%s <span class="nav-prev-text">%s</span>',
|
|
'<span class="nav-icon" aria-hidden="true">«</span>',
|
|
esc_html__( 'Previous', 'roi-theme' )
|
|
),
|
|
'next_text' => sprintf(
|
|
'<span class="nav-next-text">%s</span> %s',
|
|
esc_html__( 'Next', 'roi-theme' ),
|
|
'<span class="nav-icon" aria-hidden="true">»</span>'
|
|
),
|
|
'before_page_number' => '<span class="screen-reader-text">' . esc_html__( 'Page', 'roi-theme' ) . ' </span>',
|
|
'aria_label' => esc_attr__( 'Posts navigation', 'roi-theme' ),
|
|
)
|
|
);
|
|
|
|
else :
|
|
|
|
/**
|
|
* No posts found
|
|
* Display a message when no content is available.
|
|
*/
|
|
get_template_part( 'template-parts/content', 'none' );
|
|
|
|
endif;
|
|
?>
|
|
|
|
</div><!-- #primary -->
|
|
|
|
<?php
|
|
/**
|
|
* Sidebar
|
|
* Display the sidebar if it's active.
|
|
*/
|
|
if ( is_active_sidebar( 'sidebar-1' ) ) :
|
|
get_sidebar();
|
|
endif;
|
|
?>
|
|
|
|
</div><!-- .content-wrapper -->
|
|
|
|
</main><!-- #main-content -->
|
|
|
|
<?php
|
|
get_footer();
|