' . $data['title'] . ' ( ' . $data['count'] . ' ) | ';
foreach ( $data['elements'] as $element => $count ) {
$usage .= $element . ': ' . $count . PHP_EOL;
}
$usage .= ' |
';
}
return [
'value' => $usage,
];
}
public function get_raw_usage() {
/** @var Module $module */
$module = Module::instance();
$usage = PHP_EOL;
foreach ( $module->get_formatted_usage( 'raw' ) as $doc_type => $data ) {
$usage .= "\t{$data['title']} : " . $data['count'] . PHP_EOL;
foreach ( $data['elements'] as $element => $count ) {
$usage .= "\t\t{$element} : {$count}" . PHP_EOL;
}
}
return [
'value' => $usage,
];
}
/**
* Removes the "elementor_usage_recalc" param from the query string to avoid recalc every refresh.
* When using a redirect header in place of this approach it throws an error because some components have already output some content.
*
* @return string
*/
private function get_remove_recalc_query_string_script() {
ob_start();
?>