Skip to content

Commit 0c0411f

Browse files
committed
Adding Solid Dynamics as its own menu page
1 parent 444a961 commit 0c0411f

4 files changed

Lines changed: 28 additions & 19 deletions

File tree

readme.txt

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,25 @@
22
Contributors: soliddigital,lukechinworth,peterajtai
33
Tags: elementor, dynamic tags, jet engine, macros
44
Tested up to: 6.7.1
5-
Stable tag: 1.6.1
5+
Stable tag: 1.6.2
66
Requires PHP: 7.0
77
License: GPLv2
88

99
Helpful utilities for Elementor, Jet Engine, and beyond.
1010

1111
== Description ==
1212

13-
This plugin provides an Admin Page called, "Widget Usage" that shows the individual posts in which a widget is used.
14-
Currently, the Elementor Element Manager only shows the total number of usages of a widget. We're always wondering
15-
where those widgets are being used, and "Widget Usage" is the answer to that question.
13+
This plugin provides an Admin Page called, "Widget Usage" under the "Solid Dynamics" menu that shows the individual posts in which a widget is used. Currently, the Elementor Element Manager only shows the total number of usages of a widget. We're always wondering where those widgets are being used, and "Widget Usage" is the answer to that question.
1614

17-
Solid Dynamics also provides several dynamic tags under the "Solid Dynamics" section:
15+
Solid Dynamics also provides several dynamic tags under the "Solid Dynamics" section in Elementor:
1816

1917
- `Custom Callback`: Call any php function. The current post is passed as the first argument.
2018
- `Menu`: Returns comma-separated post ids of a specific menu.
2119
- `Parent Meta`: Retrieves the meta value of the parent post based on the entered meta key.
2220
- `List Pluck`: Pluck `field` off each item in `list` (`src` meta or option), and join with `sep`.
2321
- `Post Field`: Retrieves custom post field by name.
2422

25-
This plugin also provides several general use and Elementor specific settings at Settings > Solid Dynamics. All settings have to be opted in to. Activating the plugin does not activate any of the settings. Activating the plugin does automatically make the dynamic tags listed above available.
23+
This plugin also provides several general use and Elementor specific settings under the menu Solid Dynamics. All settings have to be opted in to. Activating the plugin does not activate any of the settings. Activating the plugin does automatically make the dynamic tags listed above available.
2624

2725
General:
2826

@@ -53,6 +51,15 @@ The code is managed on [github](https://github.com/SolidDigital/solid-dynamics),
5351

5452
== Changelog ==
5553

54+
= 1.6.2 =
55+
2024-11-24
56+
- Feature: Moving "Solid Dynamics" to its own menu page
57+
- Patch: Ensuring "Widget Usage" menu option is visible
58+
59+
= 1.6.1 =
60+
2024-11-23
61+
- Patch: Changelog update
62+
5663
= 1.6.0 =
5764
2024-11-23
5865
- Feature: `Widget Usage`

settings/settings.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ public function __construct() {
2323
public function add_settings_page() {
2424
$this->wpsf->add_settings_page(
2525
array(
26-
'parent_slug' => 'options-general.php',
27-
'page_title' => esc_html__( 'Solid Dynamics', 'solid-dynamics' ),
26+
'page_title' => esc_html__( 'Settings', 'solid-dynamics' ),
2827
'menu_title' => esc_html__( 'Solid Dynamics', 'solid-dynamics' ),
2928
'capability' => 'manage_options',
3029
)

solid-dynamics.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* Plugin Name: Solid Dynamics
55
* Description: Helpful utilities for Elementor, Jet Engine, and beyond.
6-
* Version: 1.6.1
6+
* Version: 1.6.2
77
* Author: Solid Digital
88
* Author URI: https://www.soliddigital.com
99
* License: GPLv2
@@ -29,3 +29,5 @@
2929
require_once( __DIR__ . "/settings/settings.php" );
3030

3131
new Settings();
32+
33+
require_once( __DIR__ . "/widget-usage/admin-page.php" );

widget-usage/admin-page.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33

44
// Hook to add the admin menu page
55
add_action('admin_menu', function () {
6-
add_menu_page(
7-
'Elementor Widget Usage', // Page title
8-
'Widget Usage', // Menu title
6+
add_submenu_page(
7+
'solid-dynamics-settings',
8+
__('Elementor Widget Usage', 'solid-dynamics'), // Page title
9+
__('Widget Usage', 'solid-dynamics'), // Menu title
910
'manage_options', // Capability
1011
'elementor-widget-usage', // Menu slug
1112
__NAMESPACE__ . '\render_widget_usage_page' // Callback function
@@ -20,16 +21,16 @@ function render_widget_usage_page() {
2021
<div class="wrap">
2122
<h1>Find Elementor Widget Usage</h1>
2223
<form method="post" id="widget-usage-form">
23-
<label for="widget_name">Select Widget:</label>
24+
<label for="widget_name"><?php echo __('Select Widget', 'solid-dynamics'); ?>:</label>
2425
<select id="widget_name" name="widget_name" required>
25-
<option value="">-- Select a Widget --</option>
26+
<option value="">-- <?php echo __('Select a Widget', 'solid-dynamics'); ?> --</option>
2627
<?php foreach ($widgets as $widget) : ?>
2728
<option value="<?php echo esc_attr($widget); ?>">
2829
<?php echo esc_html($widget); ?>
2930
</option>
3031
<?php endforeach; ?>
3132
</select>
32-
<?php submit_button('Find Usage'); ?>
33+
<?php submit_button(__('Find Usage', 'solid-dynamics')); ?>
3334
</form>
3435

3536
<?php
@@ -45,10 +46,10 @@ function render_widget_usage_page() {
4546

4647
$total_instances = array_sum(array_column($results, 'widget_count'));
4748

48-
echo '<h2>Results:</h2>';
49-
echo '<p>Total Instances Across All Posts: ' . $total_instances . '</p>';
49+
echo '<h2>' . __('Results', 'solid-dynamics') . ':</h2>';
50+
echo '<p>' . __('Total Instances Across All Posts', 'solid-dynamics') . ': ' . $total_instances . '</p>';
5051
echo '<table class="widefat fixed" cellspacing="0">';
51-
echo '<thead><tr><th>#</th><th>Title</th><th>Post Type</th><th>Status</th><th>Count</th></tr></thead>';
52+
echo '<thead><tr><th>#</th><th>' . __('Title', 'solid-dynamics') . '</th><th>' . __('Post Type', 'solid-dynamics') . '</th><th>' . __('Status', 'solid-dynamics') . '</th><th>' . __('Count', 'solid-dynamics') . '</th></tr></thead>';
5253
echo '<tbody>';
5354

5455
$count = 1; // Initialize instance counter
@@ -66,7 +67,7 @@ function render_widget_usage_page() {
6667

6768
echo '</tbody></table>';
6869
} else {
69-
echo '<p>No templates or posts contain this widget.</p>';
70+
echo '<p>' . __('No templates or posts contain this widget', 'solid-dynamics') . '.</p>';
7071
}
7172
}
7273
?>

0 commit comments

Comments
 (0)