Class bên dưới sẽ mô tả cách chuyển nội dung bài viết thành giọng đọc (Text to Speech, Content to Speech). <?php defined( ‘ABSPATH’ ) || exit; class CTS_Text_To_Speech { public $api_key; public $voice_id; public $text; public $error; public $response; private $voice; public function __construct( $api_key, $voice_id, $text ) { $this->set_api_key( $api_key ); $this->set_voice_id( $voice_id […]
Tháng: Tháng 1 2024
Thêm column và sortable column vào bảng thành viên
Nếu bạn muốn thêm một cột bất kỳ vào bảng danh sách người dùng, bạn có thể tham khảo đoạn code bên dưới. function hpxf_manage_users_sortable_columns_filter( $column ) { $column[‘date’] = ‘date’; $column[‘collections’] = ‘collections’; $column[‘posts’] = ‘posts’; $column[‘forum_posts’] = ‘forum_posts’; $column[‘media_files’] = ‘media_files’; $column[‘description’] = ‘description’; return $column; } add_filter( ‘manage_users_sortable_columns’, ‘hpxf_manage_users_sortable_columns_filter’ ); function hpxf_manage_users_columns_filter( […]
Sử dụng AJAX trong WordPress
AJAX là chữ viết tắt của cụm từ Asynchronous Javascript and XML. AJAX là phương thức trao đổi dữ liệu với máy chủ và cập nhật một hay nhiều phần của trang web, hoàn toàn không reload lại toàn bộ trang. AJAX được viết bằng Javascript chạy trên client, tức là mỗi browser sẽ chạy […]