ارجو المساعدة
لقد اضفت كود سابقا لمعرفة كيفية جعل النص قابل للترجمة وتم الوصول للطريقة ولكن اذا قمت بعملها فى القالب الاب فن ذلك سيتغير بتحديث القالب فكيف اقوم بالتعديل او الاضافة لملف القالب الابن ليقوم بالتعديلات المطلوبة عن طريق استخدام الفلاتر او الاكشنات واليكم الكود
\[code\]
function widget( $args, $instance ) {
if ( ! isset( $args\['widget\_id'\] ) ) $args\['widget\_id'\] = null;
extract( $args, EXTR\_SKIP );
echo $before\_widget;
$title = apply\_filters( 'widget\_title', $instance\['title'\], $instance, $this->id\_base);
if( $title ) echo $before\_title . $title . $after\_title;
$comments = get\_comments( apply\_filters( 'widget\_comments\_args', array( 'number' => intval( $instance\['count'\]), 'status' => 'approve', 'post\_status' => 'publish', 'post\_type' => 'post' ) ) );
if(is\_array($comments))
{
$output = '<div class="Recent\_comments">';
$output .= '<ul>';
foreach($comments as $comment)
{
$url = get\_permalink($comment->comment\_post\_ID).'#comment-'.$comment->comment\_ID .'" title="'.$comment->comment\_author .' | '.get\_the\_title($comment->comment\_post\_ID);
$date = new DateTime($comment->comment\_date);
$output .= '<li>';
$output .='<p><i class="fa-user"></i> <strong>'.strip\_tags($comment->comment\_author)." ".\_\_('commented on','brandon').'</strong> <a>'. get\_the\_title($comment->comment\_post\_ID) .'</a></p>';
$output .= '<span class="date"><i class="fa-calendar"></i> '.'</span>';
$output .= '</li>';
}
$output .= '</ul>';
$output .= '</div>'."\\n";
}
echo $output;
echo $after\_widget;
}
\[/code\]