本文整理匯總了PHP中WP_Customize_Image_Control::prepare_control方法的典型用法代碼示例。如果您正苦於以下問題:PHP WP_Customize_Image_Control::prepare_control方法的具體用法?PHP WP_Customize_Image_Control::prepare_control怎麽用?PHP WP_Customize_Image_Control::prepare_control使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WP_Customize_Image_Control
的用法示例。
在下文中一共展示了WP_Customize_Image_Control::prepare_control方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: prepare_control
/**
* Prepares the control.
*
* If no tabs exist, removes the control from the manager.
*
* @since 3.4.2
*/
public function prepare_control()
{
global $custom_image_header;
if (empty($custom_image_header)) {
return parent::prepare_control();
}
// Process default headers and uploaded headers.
$custom_image_header->process_default_headers();
$this->default_headers = $custom_image_header->default_headers;
$this->uploaded_headers = get_uploaded_header_images();
if ($this->default_headers) {
$this->add_tab('default', __('Default'), array($this, 'tab_default_headers'));
}
if (!$this->uploaded_headers) {
$this->remove_tab('uploaded');
}
return parent::prepare_control();
}