HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux wordpress-ubuntu-s-2vcpu-4gb-fra1-01 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64
User: root (0)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/hcv/wp-content/plugins/wordpress-seo-premium/src/presenters/mastodon-link-presenter.php
<?php

namespace Yoast\WP\SEO\Premium\Presenters;

use Yoast\WP\SEO\Presenters\Abstract_Indexable_Tag_Presenter;

/**
 * Presenter class for the link rel="me" meta tag used for Mastodon verification.
 */
class Mastodon_Link_Presenter extends Abstract_Indexable_Tag_Presenter {

	/**
	 * The tag key name.
	 *
	 * @var string
	 */
	protected $key = 'me';

	/**
	 * The tag format including placeholders.
	 *
	 * @var string
	 */
	protected $tag_format = self::LINK_REL_HREF;

	/**
	 * The method of escaping to use.
	 *
	 * @var string
	 */
	protected $escaping = 'url';

	/**
	 * Returns the rel me meta tag.
	 *
	 * @return string The rel me tag.
	 */
	public function present() {
		$output = parent::present();

		if ( ! empty( $output ) ) {
			/**
			 * Filter: 'wpseo_mastodon_link' - Allow changing link output by Yoast SEO.
			 *
			 * @param string $unsigned The full `<link>` element.
			 */
			return \apply_filters( 'wpseo_mastodon_link', $output );
		}

		return '';
	}

	/**
	 * Returns the URL to be presented in the tag.
	 *
	 * @return string The URL to be presented in the tag.
	 */
	public function get() {
		switch ( $this->helpers->options->get( 'company_or_person', false ) ) {
			case 'company':
				$social_profiles = $this->helpers->social_profiles->get_organization_social_profiles();
				break;

			case 'person':
				$company_or_person_id = $this->helpers->options->get( 'company_or_person_user_id', 0 );
				$social_profiles      = $this->helpers->social_profiles->get_person_social_profiles( $company_or_person_id );
				break;
			default:
				$social_profiles = [];
		}

		// Person case.
		if ( ! empty( $social_profiles['mastodon'] ) ) {
			return $social_profiles['mastodon'];
		}

		// Organization case.
		if ( ! empty( $social_profiles['mastodon_url'] ) ) {
			return $social_profiles['mastodon_url'];
		}

		return '';
	}
}