Changeset 3221335
- Timestamp:
- 01/13/2025 05:21:54 AM (13 months ago)
- Location:
- wp-menu-image
- Files:
-
- 16 added
- 5 edited
-
tags/2.3 (added)
-
tags/2.3/assets (added)
-
tags/2.3/assets/css (added)
-
tags/2.3/assets/css/wmi-front-style.css (added)
-
tags/2.3/assets/css/wmi-style.css (added)
-
tags/2.3/assets/images (added)
-
tags/2.3/assets/images/delete-icon.svg (added)
-
tags/2.3/assets/images/edit-icon.svg (added)
-
tags/2.3/assets/js (added)
-
tags/2.3/assets/js/wmi-admin-script.js (added)
-
tags/2.3/init (added)
-
tags/2.3/init/wmi-functions.php (added)
-
tags/2.3/languages (added)
-
tags/2.3/readme.txt (added)
-
tags/2.3/wp-menu-image.php (added)
-
trunk/assets/css/wmi-style.css (modified) (1 diff)
-
trunk/assets/js/wmi-admin-script.js (modified) (2 diffs)
-
trunk/init/wmi-functions.php (modified) (8 diffs)
-
trunk/languages (added)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/wp-menu-image.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp-menu-image/trunk/assets/css/wmi-style.css
r2390693 r3221335 8 8 .edit-icon { background: url('../images/edit-icon.svg') no-repeat center center/cover ; display: block; height: 30px; } 9 9 .delete-icon { background: url('../images/delete-icon.svg') no-repeat center center/cover ; display: block; height: 30px; } 10 11 .menu-actions { display: flex; justify-content: flex-end; gap: 6px; } 12 .menu-actions li a { position: relative; width: 30px; height: 30px; } 13 .menu-actions li a::before { content: ''; position: absolute; top: 0; right: 0px; width: 36px; height: 36px; } 14 .menu-actions li a.edit-btn::before { background: url('../images/edit-icon.svg') no-repeat center center / 30px; width: 30px; height: 30px; } 15 .menu-actions li a.close-btn::before { background: url('../images/delete-icon.svg') no-repeat center center / 30px; width: 30px; height: 30px; } 16 .menu-img-block .menu-image { width: 100%; height: auto; } -
wp-menu-image/trunk/assets/js/wmi-admin-script.js
r3079766 r3221335 18 18 jQuery('.menu-block-'+menu_id).append('<img class="menu-image upload-image-'+menu_id+'" src="'+attachment.url+'" width="90" height="90">'); 19 19 }else{ 20 jQuery('#upload-image-'+ menu_id).before('<div class="menu-img-block menu-block-'+menu_id+'"><ul class="menu-actions"><li><a href="javascript:void(0);" class="edit-btn" id="upload-image-'+menu_id+' data-id="'+menu_id+'"><img src="'+ editimg+'" alt="edit"></a></li> <li><a href="javascript:void(0);" class="close-btn"><img src="'+deleteimg+'" alt="delete"></li></ul> <img class="menu-image upload-image-'+menu_id+'" src="'+attachment.url+'" width="120" height="120"></div>');20 jQuery('#upload-image-'+ menu_id).before('<div class="menu-img-block menu-block-'+menu_id+'"><ul class="menu-actions"><li><a href="javascript:void(0);" class="edit-btn" id="upload-image-'+menu_id+' data-id="'+menu_id+'"><img src="'+deleteimg_ajax.edit_img+'" alt="edit"></a></li> <li><a href="javascript:void(0);" class="close-btn"><img src="'+deleteimg_ajax.deleteimg+'" alt="delete"></li></ul> <img class="menu-image upload-image-'+menu_id+'" src="'+attachment.url+'" width="120" height="120"></div>'); 21 21 } 22 22 jQuery('div.menu-img-block').css('display','block'); … … 45 45 type : 'POST', 46 46 url : deleteimg_ajax.ajax_url, 47 data : { action : 'del_img', menu_id : menu_id }, 48 success : function(data){ 47 data : { 48 action : 'del_img', 49 menu_id : menu_id, 50 nonce: deleteimg_ajax.nonce // Include the nonce 51 }, 52 success : function(response){ 53 if (response.success) { 54 //alert('Image deleted successfully'); 55 } else { 56 //alert('Error: ' + response.data); 57 } 49 58 } 50 59 }); -
wp-menu-image/trunk/init/wmi-functions.php
r3079766 r3221335 1 1 <?php 2 // Exit if accessed directly 3 if (!defined('ABSPATH')) exit; 4 2 5 //Add Custom scripts in Admin 3 6 function wmi_custom_script(){ 4 wp_enqueue_script( 'wmi-admin-script', WMI_MENU_IMG_URL . '/assets/js/wmi-admin-script.js' ); 5 wp_localize_script( 'wmi-admin-script', 'deleteimg_ajax', array( 'ajax_url' => admin_url('admin-ajax.php')) ); 6 wp_localize_script( 'wmi-admin-script', 'editimg', WMI_MENU_IMG_URL . 'assets/images/edit-icon.svg' ); 7 wp_localize_script( 'wmi-admin-script', 'deleteimg', WMI_MENU_IMG_URL . 'assets/images/delete-icon.svg' ); 8 wp_enqueue_style( 'wmi-admin-style', WMI_MENU_IMG_URL . '/assets/css/wmi-style.css' ); 9 if (is_admin ()){ 7 8 //Script 9 wp_enqueue_script( 'wmi-admin-script', WMI_MENU_IMG_URL . '/assets/js/wmi-admin-script.js', ['jquery'], WMI_VERSION, true ); 10 wp_localize_script( 'wmi-admin-script', 'deleteimg_ajax', 11 array( 12 'ajax_url' => admin_url('admin-ajax.php'), 13 'nonce' => wp_create_nonce('wmi_img_nonce'), 14 'edit_img' => esc_url( WMI_MENU_IMG_URL . 'assets/images/edit-icon.svg' ), 15 'deleteimg' => esc_url( WMI_MENU_IMG_URL . 'assets/images/delete-icon.svg' ) 16 ) 17 ); 18 19 //Style 20 wp_enqueue_style( 'wmi-admin-style', WMI_MENU_IMG_URL . '/assets/css/wmi-style.css', [], WMI_VERSION, 'all'); 21 22 if (is_admin()){ 10 23 wp_enqueue_media (); 11 24 } … … 15 28 //Add Custom scripts in Admin 16 29 function wmi_custom_style(){ 17 wp_enqueue_style( 'wmi-front-style', WMI_MENU_IMG_URL . '/assets/css/wmi-front-style.css' ); 30 31 wp_register_style( 'wmi-front-style', WMI_MENU_IMG_URL . 'assets/css/wmi-front-style.css', [], WMI_VERSION, 'all'); 32 wp_enqueue_style( 'wmi-front-style' ); 18 33 } 19 34 add_action( 'wp_enqueue_scripts', 'wmi_custom_style' ); … … 22 37 add_action( 'wp_update_nav_menu_item', 'wmi_update_custom_img_field', 10, 3 ); 23 38 function wmi_update_custom_img_field( $menu_id, $menu_item_db_id, $args ) { 39 24 40 // Verify this came from our screen and with proper authorization. 25 if ( ! isset( $_POST['_menu_list_image_nonce_name'] ) || ! wp_verify_nonce( $_POST['_menu_list_image_nonce_name'], 'menu_list_image_nonce' ) ) { 41 $nonce_val = isset($_POST['_menu_list_image_nonce_name']) ? sanitize_text_field( wp_unslash( $_POST['_menu_list_image_nonce_name'] ) ) : ''; 42 43 $menu_item_image = isset($_REQUEST['menu-item-image']) ? array_map( 'esc_url_raw', wp_unslash($_REQUEST['menu-item-image'])) : ''; 44 $menu_item_img_position = isset($_REQUEST['menu-item-img-position']) ? array_map( 'sanitize_text_field', wp_unslash($_REQUEST['menu-item-img-position']) ) : ''; 45 $menu_item_id = isset($_REQUEST['menu-item-id']) ? array_map( 'absint', wp_unslash($_REQUEST['menu-item-id'])) : ''; 46 47 if ( ! isset( $nonce_val ) || ! wp_verify_nonce( $nonce_val, 'menu_list_image_nonce' ) ) { 26 48 return $menu_id; 27 49 } 28 if ( is_array($_REQUEST['menu-item-image']) || is_array($_REQUEST['menu-item-img-position']) ) { 29 $image_value = sanitize_text_field($_REQUEST['menu-item-image'][$menu_item_db_id]); 30 $image_id = sanitize_text_field($_REQUEST['menu-item-id'][$menu_item_db_id]); 31 $image_position = sanitize_text_field($_REQUEST['menu-item-img-position'][$menu_item_db_id]); 50 51 if ( ! current_user_can('manage_options') ) { 52 return $menu_id; 53 } 54 55 if ( is_array($menu_item_image) || is_array($menu_item_img_position) ) { 56 57 $image_value = isset($menu_item_image[$menu_item_db_id]) ? sanitize_text_field( wp_unslash( $menu_item_image[$menu_item_db_id] ) ) : ''; 58 $image_id = isset($menu_item_id[$menu_item_db_id]) ? sanitize_text_field( wp_unslash( $menu_item_id[$menu_item_db_id] ) ) : ''; 59 $image_position = isset($menu_item_img_position[$menu_item_db_id]) ? sanitize_text_field( wp_unslash( $menu_item_img_position[$menu_item_db_id] ) ) : ''; 60 32 61 if ( $image_value && $image_id ) { 33 update_post_meta( $menu_item_db_id, '_menu_list_image', $image_value);34 update_post_meta( $menu_item_db_id, '_menu_list_image_id', $image_id);35 update_post_meta( $menu_item_db_id, '_menu_list_image_position',$image_position );62 update_post_meta( $menu_item_db_id, '_menu_list_image', $image_value ); 63 update_post_meta( $menu_item_db_id, '_menu_list_image_id', $image_id ); 64 update_post_meta( $menu_item_db_id, '_menu_list_image_position', $image_position ); 36 65 } 37 66 } … … 41 70 function wmi_customfield_menu_image( $item_id, $item ) { 42 71 wp_nonce_field( 'menu_list_image_nonce', '_menu_list_image_nonce_name' ); 43 $menu_image = get_post_meta( $item_id, '_menu_list_image', true );44 $menu_image_id = get_post_meta( $item_id, '_menu_list_image_id', true );45 $menu_image_position = get_post_meta( $item_id, '_menu_list_image_position', true );72 $menu_image = get_post_meta( $item_id, '_menu_list_image', true ); 73 $menu_image_id = get_post_meta( $item_id, '_menu_list_image_id', true ); 74 $menu_image_position = get_post_meta( $item_id, '_menu_list_image_position', true ); 46 75 $menu_image_id = (isset($menu_image_id) ? (int) $menu_image_id : ''); 47 76 … … 51 80 } else { 52 81 $image_alt = basename($menu_image); 53 } ?> 82 } 83 ?> 54 84 <div class="field-custom_menu_meta" style="margin: 5px 0;"> 55 85 <div class="menu-img"> 56 <p><?php _e( 'Image', 'wmi-menu-img' ); ?></p>86 <p><?php esc_html_e( 'Image', 'wp-menu-image' ); ?></p> 57 87 <?php if($menu_image){ ?> 58 <div class="menu-img-block menu-block-<?php echo $item_id; ?>">88 <div class="menu-img-block menu-block-<?php echo esc_attr($item_id); ?>"> 59 89 <ul class="menu-actions"> 60 <li><a href="javascript:void(0);" class="edit-btn" id="upload-image-<?php echo $item_id; ?>" data-id="<?php echo $item_id; ?>"><img src="<?php echo WMI_MENU_IMG_URL . 'assets/images/edit-icon.svg'; ?>" alt="edit"></a></li> 61 <li><a href="javascript:void(0);" class="close-btn" data-id="<?php echo $item_id; ?>"><img src="<?php echo WMI_MENU_IMG_URL . 'assets/images/delete-icon.svg'; ?>" alt="delete"></a></li> 90 <li> 91 <a href="javascript:void(0);" class="edit-btn" id="upload-image-<?php echo esc_attr($item_id); ?>" data-id="<?php echo esc_attr($item_id); ?>"> 92 <?php /* <img src="<?php echo esc_url( WMI_MENU_IMG_URL . 'assets/images/edit-icon.svg' ); ?>" alt="edit"> */ ?> 93 </a> 94 </li> 95 <li> 96 <a href="javascript:void(0);" class="close-btn" data-id="<?php echo esc_attr($item_id); ?>"> 97 <?php /* <img src="<?php echo esc_url(WMI_MENU_IMG_URL . 'assets/images/delete-icon.svg'); ?>" alt="delete"> */ ?> 98 </a> 99 </li> 62 100 </ul> 63 <img class="menu-image upload-image-<?php echo $item_id; ?>" src="<?php echo $menu_image; ?>" alt="<?php echo esc_html__($image_alt); ?>" width="120" height="120">101 <img class="menu-image upload-image-<?php echo esc_attr($item_id); ?>" src="<?php echo esc_url($menu_image); ?>" alt="<?php echo esc_attr($image_alt); ?>" width="120" height="120"> 64 102 </div> 65 103 <?php } ?> 66 <input class="widefat custom_media_url img_txt-<?php echo $item_id; ?>" id="edit-menu-item-image-<?php echo $item_id; ?>" name="menu-item-image[<?php echo $item_id; ?>]" type="hidden" value="<?php echo $menu_image; ?>">67 <input class="widefat custom_media_id img_id-<?php echo $item_id; ?>" id="edit-menu-item-id-<?php echo $item_id; ?>" name="menu-item-id[<?php echo $item_id; ?>]" type="hidden" value="<?php echo $menu_image_id; ?>">68 <input type="button" class="button upload-image widefat" data-id="<?php echo $item_id; ?>" id="upload-image-<?php echo $item_id; ?>" value="Upload Image" style="margin-top:5px;" />104 <input class="widefat custom_media_url img_txt-<?php echo esc_attr($item_id); ?>" id="edit-menu-item-image-<?php echo esc_attr($item_id); ?>" name="menu-item-image[<?php echo esc_attr($item_id); ?>]" type="hidden" value="<?php echo esc_attr($menu_image); ?>"> 105 <input class="widefat custom_media_id img_id-<?php echo esc_attr($item_id); ?>" id="edit-menu-item-id-<?php echo esc_attr($item_id); ?>" name="menu-item-id[<?php echo esc_attr($item_id); ?>]" type="hidden" value="<?php echo esc_attr($menu_image_id); ?>"> 106 <input type="button" class="button upload-image widefat" data-id="<?php echo esc_attr($item_id); ?>" id="upload-image-<?php echo esc_attr($item_id); ?>" value="Upload Image" style="margin-top:5px;" /> 69 107 </div> 70 108 <div class="img-position" style="margin: 5px 0;"> 71 <p><?php _e( 'Image Position', 'wmi-menu-img' ); ?></p>109 <p><?php esc_html_e( 'Image Position', 'wp-menu-image' ); ?></p> 72 110 <label> 73 <input type="radio" name="menu-item-img-position[<?php echo $item_id; ?>]" value="before" <?php if($menu_image_position== 'before'){ ?>checked <?php }else{ echo 'checked'; } ?>>74 <span><?php _e( 'Before', 'wmi-menu-img' ); ?></span>111 <input type="radio" name="menu-item-img-position[<?php echo esc_attr($item_id); ?>]" value="before" <?php if( esc_attr($menu_image_position) == 'before'){ ?>checked <?php }else{ echo 'checked'; } ?>> 112 <span><?php esc_html_e( 'Before', 'wp-menu-image' ); ?></span> 75 113 </label> 76 114 <label> 77 <input type="radio" name="menu-item-img-position[<?php echo $item_id; ?>]" value="after" <?php if($menu_image_position== 'after'){ echo 'checked'; } ?>>78 <span><?php _e( 'After', 'wmi-menu-img' ); ?></span>115 <input type="radio" name="menu-item-img-position[<?php echo esc_attr($item_id); ?>]" value="after" <?php if( esc_attr($menu_image_position) == 'after'){ echo 'checked'; } ?>> 116 <span><?php esc_html_e( 'After', 'wp-menu-image' ); ?></span> 79 117 </label> 80 118 </div> … … 87 125 function wmi_display_img_menu( $title, $item, $args, $depth ) { 88 126 89 $menu_image = get_post_meta( $item->ID, '_menu_list_image', true );90 $menu_image_id = get_post_meta( $item->ID, '_menu_list_image_id', true );91 $menu_image_pos = get_post_meta( $item->ID, '_menu_list_image_position', true );127 $menu_image = get_post_meta( $item->ID, '_menu_list_image', true ); 128 $menu_image_id = get_post_meta( $item->ID, '_menu_list_image_id', true ); 129 $menu_image_pos = get_post_meta( $item->ID, '_menu_list_image_position', true ); 92 130 $menu_image_id = (isset($menu_image_id) ? (int) $menu_image_id : ''); 93 131 … … 99 137 } 100 138 139 if ( $menu_image_id ) { 140 $get_menu_image = wp_get_attachment_image( $menu_image_id, array('25', '25'), false, array( 'alt' => esc_attr($image_alt), 'loading'=>'lazy' ) ); 141 } 142 101 143 if($menu_image){ 102 144 if ($menu_image_pos == 'after') { 103 $title = '<span>'.$title.'</span> <img src="'.$menu_image.'" alt="'. esc_html__($image_alt) .'" heigth="25px" width="25px">';104 } else{105 $title = '<img src="'.$menu_image. '" alt="'. esc_html__($image_alt) .'" heigth="25px" width="25px"><span>'.$title.'</span>';145 $title = '<span>'.$title.'</span>'. $get_menu_image; 146 } else { 147 $title = $get_menu_image . '<span>'.$title.'</span>'; 106 148 } 107 149 } … … 123 165 } 124 166 167 125 168 //Delete Image in Menu 126 add_action('wp_ajax_del_img', 'wmi_delete_img_menu'); 127 add_action('wp_ajax_nopriv_del_img', 'wmi_delete_img_menu');169 add_action('wp_ajax_del_img', 'wmi_delete_img_menu'); // For logged-in users 170 // add_action('wp_ajax_nopriv_del_img', 'wmi_delete_img_menu'); 128 171 function wmi_delete_img_menu(){ 129 delete_post_meta( sanitize_text_field($_POST['menu_id']), '_menu_list_image' ); 130 update_post_meta( sanitize_text_field($_POST['menu_id']), '_menu_list_image_position', 'before' ); 131 exit; 132 } 172 173 $nonce = isset($_POST['nonce']) ? sanitize_text_field( wp_unslash( $_POST['nonce'] ) ) : ''; 174 175 // Verify nonce for CSRF protection 176 if ( ! isset($nonce) || ! wp_verify_nonce( $nonce, 'wmi_img_nonce' ) ) { 177 $message = esc_html__('Invalid nonce','wp-menu-image'); 178 $response = array('message' => $message); 179 wp_send_json_error($response); 180 wp_die(); 181 } 182 183 // Check user capability 184 if ( ! current_user_can('manage_options') ) { 185 $message = esc_html__('Unauthorized action','wp-menu-image'); 186 $response = array('message' => $message); 187 wp_send_json_error($response); 188 wp_die(); 189 } 190 191 // Sanitize and process the menu ID 192 $menu_id = ( isset($_POST['menu_id']) ? sanitize_text_field( wp_unslash($_POST['menu_id'])) : 0); 193 194 if ( $menu_id ) { 195 196 // Delete the Post meta from the Menu 197 delete_post_meta( $menu_id, '_menu_list_image' ); 198 update_post_meta( $menu_id, '_menu_list_image_position', 'before' ); 199 200 $message = esc_html__('Image deleted','wp-menu-image'); 201 $response = array('message' => $message); 202 wp_send_json_success($response); 203 204 } else { 205 $message = esc_html__('Invalid menu ID','wp-menu-image'); 206 $response = array('message' => $message); 207 wp_send_json_error($response); 208 } 209 210 wp_die(); 211 } 212 213 function wmi_add_action_links( $actions ) { 214 215 $custom_actions[] = '<a href="https://profiles.wordpress.org/yudiz/#content-plugins" target="_blank">' . esc_html__('More from Yudiz', 'wp-menu-image') . '</a>'; 216 return array_merge( $actions, $custom_actions ); 217 } 218 add_filter( 'plugin_action_links_' . WMI_MENU_IMG_BASENAME, 'wmi_add_action_links' ); -
wp-menu-image/trunk/readme.txt
r3087610 r3221335 1 1 === WP Menu Image === 2 Contributors: yudiz, vaibhavgvb, richakalaria8795 2 Contributors: yudiz, vaibhavgvb, richakalaria8795, mohitprajapati 3 3 Donate link: 4 4 Tags: menu, image, icon, menu icon, menu image 5 Requires at least: 3.3 6 Tested up to: 6.5.2 7 Stable tag: 2.2 5 Requires at least: 3.6 or higher 6 Tested up to: 6.7.1 7 Requires PHP: 5.2.4 or higher 8 Stable tag: 2.3 8 9 License: GPL-3.0-or-later 9 10 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 87 88 == Changelog == 88 89 90 = 2.3 = 91 Compatible with WordPress latest version 6.7.1 92 CSS fixed 93 Security Updates 94 89 95 = 2.2 = 90 96 Added Navigation menu Image tag Alt attribute -
wp-menu-image/trunk/wp-menu-image.php
r3079766 r3221335 1 1 <?php 2 2 3 /* 3 Plugin Name: WP Menu Image 4 Plugin URI: https://www.yudiz.com/ 5 description: Can add custom images in menu in Wordpress 6 Version: 2.2 7 Author: Yudiz Solutions Ltd. 8 Author URI: https://www.yudiz.com/ 4 * Plugin Name: WP Menu Image 5 * Plugin URI: https://wordpress.org/plugins/wp-menu-image/ 6 * description: Can add custom images in menu in Wordpress 7 * Version: 2.3 8 * Author: Yudiz Solutions Ltd. 9 * Author URI: https://www.yudiz.com/ 10 * Text Domain: wp-menu-image 11 * License: GNU General Public License v3.0 12 * License URI: http://www.gnu.org/licenses/gpl-3.0.html 13 * Requires at least: 5.4 14 * Tested up to: 6.7.1 15 * Requires PHP: 7.0 16 * Domain Path: /languages 9 17 */ 10 ?> 11 <?php 12 define( 'WMI_MENU_IMG', __FILE__ ); 13 define( 'WMI_MENU_IMG_DIR', plugin_dir_path( __FILE__ ) ); 14 define( 'WMI_MENU_IMG_URL', plugin_dir_url( WMI_MENU_IMG_DIR ) . basename( dirname( __FILE__ ) ) . '/' ); 15 define( 'WMI_MENU_IMG_BASENAME', plugin_basename( WMI_MENU_IMG ) ); 16 require_once(WMI_MENU_IMG_DIR.'init/wmi-functions.php'); 18 19 // If this file is called directly, abort. 20 if ( ! defined( 'WPINC' ) || ! defined( 'ABSPATH' ) ) { 21 die; 22 } 23 24 /** 25 * Currently plugin version. 26 * Start at version 1.0.0 and use SemVer - https://semver.org 27 * Rename this for your plugin and update it as you release new versions. 28 */ 29 if (!defined('WMI_VERSION')) { 30 define('WMI_VERSION', '2.3'); // Version of plugin 31 } 32 33 if (!defined('WMI_MENU_IMG')) { 34 define('WMI_MENU_IMG', __FILE__); // Plugin File 35 } 36 37 if (!defined('WMI_MENU_IMG_DIR')) { 38 define('WMI_MENU_IMG_DIR', plugin_dir_path( __FILE__ )); // Plugin dir 39 } 40 41 if (!defined('WMI_MENU_IMG_URL')) { 42 define('WMI_MENU_IMG_URL', plugin_dir_url( WMI_MENU_IMG_DIR ) . basename( dirname( __FILE__ ) ) . '/' ); 43 } 44 45 if (!defined('WMI_MENU_IMG_BASENAME')) { 46 define('WMI_MENU_IMG_BASENAME', plugin_basename( WMI_MENU_IMG ) ); 47 } 48 49 if(!defined('WMI_PLUGIN_PREFIX') ) { 50 define('WMI_PLUGIN_PREFIX', 'wmi'); // Variable Prefix 51 } 52 53 /** 54 * Load Text Domain 55 * 56 * This gets the plugin ready for translation. 57 * 58 * @package WP Menu Image 59 * @since 2.2 60 */ 61 load_plugin_textdomain( 'wp-menu-image', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); 62 63 require_once( WMI_MENU_IMG_DIR . 'init/wmi-functions.php' );
Note: See TracChangeset
for help on using the changeset viewer.