<?php
/*
Plugin Name: Advanced Test Plugin
Description: Hook, filter, and shortcode test plugin.
Version: 1.0
*/

// Action test
add_action('before_render', function() {
    echo "<!-- BEFORE RENDER WORKING -->";
});

// After render UI
add_action('after_render', function() {
    echo "<div style='background:blue;color:white;padding:10px'>
    🚀 Advanced Plugin Running
    </div>";
});

// Filter test (agar apply_filters use ho raha ho)
add_filter('render_output', function($output) {
    return $output . "<!-- FILTER APPLIED -->";
});

add_shortcode('weekly', function(array $atts): string {
    $atts = shortcode_atts([
        'title' => 'Weekly Data',
    ], $atts);

    return '<div class="contener box bg-w" style="padding:12px;text-align:center;">'
        . htmlspecialchars((string) $atts['title'], ENT_QUOTES, 'UTF-8')
        . '</div>';
});

add_shortcode('current_year', function(): string {
    return (string) date('Y');
});
