TODO: To change the header's content go to Dr.Explain menu Options : Project Settings : HTML (CHM) Export : Setup HTML Template and Layout
×
Menu
Index

Widget API

 
- Lấy cài đặt options của widget.
$widgets = get_option($this->option_name);
$widgets[2];  #for example: widget id=2
 
Biến $this->option_name là tên widget xác định bởi tiền tố 'widget_' + id_base của widget. Tìm có thể dễ dàng tìm tên widget bằng cách sử dụng tính năng duyệt phần tử từ trình duyệt.
Ở hình trên cho bạn biết widget có tên 'hw_yahoo_skype_status' và '3' là chỉ số instance của widget này. Như vậy option_name ở đây có dạng:
'widget_hw_yahoo_skype_status'
//get all widget instance
$data = get_option('widget_hw_yahoo_skype_status');
$data[3];
 
- Lấy toàn bộ widgets đã đăng ký.
global $wp_registered_widgets;
$wp_registered_widgets[$widget_id];
 
-
Made with help of Dr.Explain

Unregistered version