HEX
Server: Apache/2
System: Linux s01 6.1.0-34-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.135-1 (2025-04-25) x86_64
User: beestg (1003)
PHP: 8.3.25
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/beestg/public_html/wp-content/plugins/flexible-shipping/src/WPDesk/FS/Info/Metabox/Links.php
<?php
/**
 * Class Links
 *
 * @package WPDesk\FS\Info
 */

namespace WPDesk\FS\Info\Metabox;

use WPDesk\FS\Info\Metabox;

/**
 * Metabox with links.
 */
abstract class Links extends Metabox {
	/**
	 * Links constructor.
	 *
	 * @param string $id     .
	 * @param string $title  .
	 * @param string $footer .
	 */
	public function __construct( $id, $title, $footer = '' ) {
		$body = $this->generate_body();

		parent::__construct( $id, $title, $body, $footer );
	}

	/**
	 * @return string
	 */
	private function generate_body() {
		$body = '';

		foreach ( $this->get_links() as $link ) {
			$body .= sprintf( '<li><a href="%s" target="_blank">%s</a></li>', esc_url( $link['href'] ), $link['label'] );
		}

		return sprintf( '<ul class="links">%s</ul>', $body );
	}

	/**
	 * @param string $url   .
	 * @param string $label .
	 *
	 * @return string
	 */
	protected function generate_footer( $url, $label ) {
		return sprintf( '<a href="%s" class="button-secondary" target="_blank">%s</a>', $url, $label );
	}

	/**
	 * @return array[]
	 */
	protected function get_links() {
		return array();
	}
}