Sök i databasen
-
CSS
-
Themes
-
Plugins
- Change Product Description Tab and Titles in WooCommerce
- Hemsida dålig laddtid vid besök första gången
- Elementor Posts Widget Title Length
- Browser downloads file when opening a page
- Greatly Improve the Entrance Animations
- WooCommerce Tabs as Accordion
- Align checkboxes to the right
- Widget Panel Not Loading
- Elementor Scroll Offset Menu Anchors
- Elementor List Icon fix
- MAINWP – Kod för att se Server-IP
- Locked out from Updraftplus Dashboard
-
Wordpress
-
Server
-
Windows
-
Browsers
-
WooCommerce
< All Topics
Print
MAINWP – Kod för att se Server-IP
Posted2024-06-12
Updated2024-06-12
MAINWP – Kod för att se Server-IP
// Create column and sate column header
add_filter( 'mainwp_sitestable_getcolumns', 'mycustom_mainwp_sitestable_getcolumns', 10, 1 );
function mycustom_mainwp_sitestable_getcolumns( $columns ) {
$columns['ipaddress'] = "IP Adress";
return $columns;
}
// Set column data
add_filter( 'mainwp_sitestable_item', 'mycustom_mainwp_sitestable_item', 10, 1 );
function mycustom_mainwp_sitestable_item( $item ) {
$website = MainWPDashboardMainWP_DB::instance()->get_website_by_id( $item['id'], true );
$website_info = MainWPDashboardMainWP_DB::instance()->get_website_option( $website, 'site_info' );
$website_info = !empty( $website_info ) ? json_decode( $website_info, true ) : array();
$ipaddress = $website_info['ip'];
$item['ipaddress'] = $ipaddress;
return $item;
}