Snippets Collections
/**
 * Debug Pending Updates
 *
 * Crude debugging method that will spit out all pending plugin
 * and theme updates for admin level users when ?debug_updates is
 * added to a /wp-admin/ URL.
 */
function debug_pending_updates() {

    // Rough safety nets
    if ( ! is_user_logged_in() || ! current_user_can( 'manage_options' ) ) return;
    if ( ! isset( $_GET['debug_updates'] ) ) return;

    $output = "";

    // Check plugins
    $plugin_updates = get_site_transient( 'update_plugins' );
    if ( $plugin_updates && ! empty( $plugin_updates->response ) ) {
        foreach ( $plugin_updates->response as $plugin => $details ) {
            $output .= "<p><strong>Plugin</strong> <u>$plugin</u> is reporting an available update.</p>";
        }
    }

    // Check themes
    wp_update_themes();
    $theme_updates = get_site_transient( 'update_themes' );
    if ( $theme_updates && ! empty( $theme_updates->response ) ) {
        foreach ( $theme_updates->response as $theme => $details ) {
            $output .= "<p><strong>Theme</strong> <u>$theme</u> is reporting an available update.</p>";
        }
    }

    if ( empty( $output ) ) $output = "No pending updates found in the database.";
import pyinstaller_versionfile

pyinstaller_versionfile.create_versionfile(
    output_file="test_versionfile.txt",
    version="1.0",
    company_name="somecompany pvt ltd",
    file_description="This is lms for desktop from some industry",
    internal_name="App",
    legal_copyright="© some companry pvt ltd. All rights reserved.",
    original_filename="Uls.exe",
    product_name="uls_lms"
)
pyinstaller  --noconsole --onefile  --icon=uls-icon.ico --version-file uls_lms_versionfile.txt  lms_app.py
[su_icon icon="icon: star" background="#eeeeee" color="#F73F43" text_color="#F73F43" size="32" shape_size="16" radius="256" text_size="16" url="#" target="self" margin="0"] This is a custom icon [/su_icon]
I have seen few questions wherein users require a VIP Icon for catalog variable when the user is a VIP user..

Use case: Consider you have a Variable which refers to "sys_user" table. When the Request Item form loads or Catalog Task form loads and if the User variable holds a VIP User then vip icon should be visible besides the variable.

Approach:

1) Create an onLoad Catalog Client Script which is set to "Applies on Requested Items" and "Applies on Catalog Tasks"

2) Use Script mentioned below; ensure you give question value in script inside the Contains filter and not the name. Using g_form.getControl() doesn't work on sc_req_item and sc_task tables.

3) Ensure Isolate Script field is set to False for the above Catalog Client Script; this field can be edited from List

Script:

function onLoad() {
	//Type appropriate comment here, and begin script below
	var user = g_form.getReference('user', callBackMethod);
}

function callBackMethod(user){

	if(user.vip.toString() == 'true'){
		var variableQuestionValue = 'User';
		$j("<img src='images/icons/vip.gif'>" ).insertAfter("span.sn-tooltip-basic:contains(" + variableQuestionValue + ")");
	}
}
Screenshots:

1) Variable Question with Value as User being used inside the script



2) Catalog Client Script: Isolate Script -> False



3) RITM Form when User is VIP showing the icon



4) TASK Form when User is VIP showing the icon



5) User "Abel Tuter" is VIP User



Note: If you would like to test this; try changing the value to a user who is not VIP and the icon should not show up

Additionally you can also highlight the background in red/orange color as below

g_form.getDisplayBox('user').style.backgroundColor =  'orange';
You can also show the text in red color as below

g_form.getDisplayBox('user').style.color= 'red';
Thanks for reading the blog and do provide your inputs/suggestions if any.
star

Fri Mar 21 2025 08:24:50 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/22137814/wordpress-shows-i-have-1-plugin-update-when-all-plugins-are-already-updated

#css #icon #svg
star

Sat Jan 08 2022 08:01:28 GMT+0000 (Coordinated Universal Time) https://getshortcodes.com/docs/icon/

#snippet #wp #shortcode #icon
star

Tue Jan 12 2021 18:21:41 GMT+0000 (Coordinated Universal Time) https://community.servicenow.com/community?id

#servicenow #variables #vip #icon #catalog #client #script

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension