本文整理匯總了PHP中TitanFramework::getAllInstances方法的典型用法代碼示例。如果您正苦於以下問題:PHP TitanFramework::getAllInstances方法的具體用法?PHP TitanFramework::getAllInstances怎麽用?PHP TitanFramework::getAllInstances使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TitanFramework
的用法示例。
在下文中一共展示了TitanFramework::getAllInstances方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: ajaxGenerateCustomizerCSS
/**
* Ajax handler for generating CSS based on the existing options with values changed to
* match the customizer modified values.
*
* @since 1.9.2
*
* @return void
*/
public function ajaxGenerateCustomizerCSS()
{
// This value is passed back to the live preview ajax handler in $this->livePreviewMainScript()
$generated = array('css' => '');
foreach (TitanFramework::getAllInstances() as $framework) {
// Modify the values of the options for the generation of CSS with the values from the customizer $_POST.
$namespace = $framework->optionNamespace;
add_filter("tf_pre_get_value_{$namespace}", array($this, 'useCustomizerModifiedValue'), 10, 3);
// Generate our new CSS based on the customizer values
$css = $framework->cssInstance->generateCSS();
$generated['css'] .= $css;
/**
* Allow options to add customizer live preview parameters. The tf_generate_customizer_preview_js hook allows for manipulating these values.
*
* @since 1.9.2
*
* @see tf_generate_customizer_preview_js
*/
$generated = apply_filters("tf_generate_customizer_preview_css_{$namespace}", $generated);
}
wp_send_json_success($generated);
}