Skip to content

Commit 7b3e013

Browse files
committed
add total lines global custom css
1 parent 0c329c8 commit 7b3e013

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

admin-pages/custom-css-usage.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,15 @@
1515

1616
// Function to render the admin page
1717
function render_custom_css_usage_page() {
18-
$results = get_all_elementor_custom_css();
18+
$kit_id = \Elementor\Plugin::$instance->kits_manager->get_active_id();
19+
20+
$settings = get_post_meta( $kit_id, '_elementor_page_settings', true );
21+
$site_settings_custom_css_line_count = substr_count( $settings['custom_css'] ?? "", "\n" );
1922

23+
$results = get_all_elementor_custom_css();
2024
?>
2125
<div class="wrap">
26+
2227
<h1>Find Elementor Custom CSS Usage</h1>
2328

2429
<?php
@@ -28,7 +33,8 @@ function render_custom_css_usage_page() {
2833
return;
2934
}
3035

31-
echo '<h2>' . __('Results', 'solid-dynamics') . ':</h2>';
36+
echo '<p>' . __('Total Lines in Site Settings Custom CSS: ', 'solid-dynamics') . $site_settings_custom_css_line_count . '</p>';
37+
echo '<h2>' . __('Posts', 'solid-dynamics') . ':</h2>';
3238
echo '<table class="widefat fixed" cellspacing="0">';
3339
echo '<thead><tr><th>ID</th><th>' . __('Title', 'solid-dynamics') . '</th><th>' . __('Post Type', 'solid-dynamics') . '</th><th>' . __('Status', 'solid-dynamics') . '</th><th>' . __('Widgets', 'solid-dynamics') . '</th></tr></thead>';
3440
echo '<tbody>';

0 commit comments

Comments
 (0)