ghofrani
Forum Replies Created
-
Fallback Translation Strategy (with UIpress)
Add this JavaScript snippet to your WordPress admin via a custom plugin, theme functions.php, or using a plugin like Code Snippets:add_action('admin_footer', function () {
?>
<script>
document.addEventListener('DOMContentLoaded', function () {
// Look for any menu item that contains the word "Future"
const menuItems = document.querySelectorAll('.wp-menu-name, .uip-menu-name, .uip-text');
menuItems.forEach(item => {
if (item.textContent.trim() === 'Future') {
item.textContent = 'آینده'; // Replace with your translated label
}
});
});
</script>
<?php
});🧠 Why This Works
- ✅ It runs after the admin page loads, ensuring UIpress has rendered its custom menu.
- ✅ It searches for multiple possible class names (.wp-menu-name, .uip-menu-name, .uip-text) to cover both default WordPress and UIpress layouts.
- ✅ It replaces only the visible label, not the internal slug—so the plugin logic remains intact.
Hello,
Please if possible we need help for :
When we change the ‘Future’ to ‘future’ , then the plugin works too .
But when we change it to any other string , like : ‘Future Pro’ , then the plugin setting page stop working .wp-content\plugins\publishpress-future-pro\lib\vendor\publishpress\publishpress-future\src\Modules\Expirator\Controllers\ScheduledActionsController.php
line : 119add_menu_page(
('PublishPress Future', 'post-expirator'), ('Future Pro', 'post-expirator'),
'manage_options',
'publishpress-future',
[\PostExpirator_Display::getInstance(), 'future_actions_tabs'],
'dashicons-clock',
74
);The Code above , does not work properly . The preloader is shown instead of the settings page .
Thanks
Saeed Ghofrani Jahromi- This reply was modified 9 months ago by ghofrani. Reason: Adding Edit Code Line
Hello,
Please we want help to solve this :
We have tested the free version from version 4.8.2 up to version 4.0.1 and the problem still exist .
Thanks
Saeed Ghofrani Jahromi