| Server IP : 202.61.199.114 / Your IP : 216.73.217.139 Web Server : nginx/1.22.1 System : Linux de.arni-solutions.de 6.1.0-49-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64 User : web20 ( 1018) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/clients/client2/web19/web/wp-content/plugins/w3-total-cache/ |
Upload File : |
<?php
namespace W3TC;
/**
* class Environment
*/
class Generic_AdminLinks {
/**
* Update plugin link
*
* @return void
*/
static public function link_update( $config ) {
self::link_delete();
self::link_insert( $config );
}
/**
* Insert plugin link into Blogroll
*
* @return void
*/
static private function link_insert( $config ) {
$support = $config->get_string( 'common.support' );
$matches = null;
if ( $support != '' && preg_match( '~^link_category_(\d+)$~', $support, $matches ) ) {
require_once ABSPATH . 'wp-admin/includes/bookmark.php';
wp_insert_link( array(
'link_url' => W3TC_LINK_URL,
'link_name' => W3TC_LINK_NAME,
'link_category' => array(
(int) $matches[1]
),
'link_rel' => 'nofollow'
) );
}
}
/**
* Deletes plugin link from Blogroll
*
* @return void
*/
static public function link_delete() {
require_once ABSPATH . 'wp-admin/includes/bookmark.php';
$bookmarks = get_bookmarks();
$link_id = 0;
foreach ( $bookmarks as $bookmark ) {
if ( $bookmark->link_url == W3TC_LINK_URL ) {
wp_delete_link( $bookmark->link_id );
}
}
}
}