DIY মিডিয়া হোম লোগো

আপনার নিজের হোম থিয়েটার এবং হাই ফাই সেটআপ নকশা ও নির্মাণের জন্য চূড়ান্ত সাইট.

0Comment bubbleসহজেই একটি ওয়ার্ডপ্রেস মন্তব্য অভিভাবক সেট

সাইট আপডেট লগের মধ্যে Doc-U-কার্যালয়ে হয়, for a while we had a prob­lem with our theme where it was­n’t pos­sible to reply to a com­ment so that the reply would appear cor­rectly in a threaded way. We have no fixed this prob­lem, but have been left with a sig­ni­fic­ant num­ber of com­ments which really need edit­ing so it is easi­er to see what they are in reply to. With a stand­ard word­press install this requires going into the data­base and edit­ing there, which is very tedi­ous. Instead, we’ve used some simple func­tions to add an option to the com­ment-edit admin page, to set the com­ment par­ent there. Even­tu­ally this will be developed into a prop­er plu­gin to enable this func­tion­al­ity. For now the code is below, just add it to your theme’s functions.php

function comment_parent_meta_box()
{
add_meta_box( 'comment_parent', __( 'Parent ID' ), 'comment_parent_cb', 'মন্তব্য', 'normal', 'high' );
}
ADD_ACTION( 'add_meta_boxes_comment', 'comment_parent_meta_box' );

function comment_parent_cb( $মন্তব্য )
{
    $parent = get_comment_meta( $comment->COMMENT_ID, 'comment_parent', সত্য );
    wp_nonce_field( 'parent_comment_update', 'parent_comment_update', মিথ্যা );
    ?>
    
     ?পিএইচপি
}

function comment_parent_edit( $comment_id )
{
    যদি( ! isset( $_POST['parent_comment_update'] ) || ! wp_verify_nonce( $_POST['parent_comment_update'], 'parent_comment_update' ) ) প্রত্যাবর্তন;
    যদি( isset( $_POST['comment_parent'] ) )
        update_comment_meta( $comment_id, 'comment_parent', esc_attr( $_POST['comment_parent'] ) );
}
ADD_ACTION( 'edit_comment', 'comment_parent_edit' );

উত্তর দিন