403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.216.202
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/inetpub/wwwroot/KnowledgeBase/wp-content/plugins/wp-seopress-pro/src/JsonSchemas/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/inetpub/wwwroot/KnowledgeBase/wp-content/plugins/wp-seopress-pro/src/JsonSchemas/Geo.php
<?php

namespace SEOPressPro\JsonSchemas;

if ( ! defined('ABSPATH')) {
    exit;
}

use SEOPress\Helpers\RichSnippetType;
use SEOPress\Models\GetJsonData;
use SEOPressPro\Models\JsonSchemaValue;

class Geo extends JsonSchemaValue implements GetJsonData {
    const NAME = 'geo';

    protected function getName() {
        return self::NAME;
    }

    /**
     * @since 4.6.0
     *
     * @return array
     */
    protected function getVariablesForOptionLocalBusiness() {
        return [
            'latitude'  => '%%local_business_latitude%%',
            'longitude' => '%%local_business_longitude%%',
        ];
    }

    /**
     * @since 4.6.0
     *
     * @return array
     *
     * @param array $schemaManual
     */
    protected function getVariablesForManualSnippet($schemaManual) {
        $variables = [];
        if (isset($schemaManual['_seopress_pro_rich_snippets_lb_lat'],
        $schemaManual['_seopress_pro_rich_snippets_lb_lon'])) {
            $variables = [
                'latitude'   => $schemaManual['_seopress_pro_rich_snippets_lb_lat'],
                'longitude'  => $schemaManual['_seopress_pro_rich_snippets_lb_lon'],
            ];
        }

        return $variables;
    }

    /**
     * @since 4.5.0
     *
     * @param array $context
     *
     * @return array
     */
    public function getJsonData($context = null) {
        $data = $this->getArrayJson();

        $typeSchema = isset($context['type']) ? $context['type'] : RichSnippetType::OPTION_LOCAL_BUSINESS;

        switch ($typeSchema) {
            case RichSnippetType::OPTION_LOCAL_BUSINESS:
            default:
                $variables = $this->getVariablesForOptionLocalBusiness();
                break;
            case RichSnippetType::MANUAL:
                $schemaManual = $this->getCurrentSchemaManual($context);

                if (null === $schemaManual) {
                    return $data;
                }

                $variables = $this->getVariablesForManualSnippet($schemaManual);
                break;
            case RichSnippetType::SUB_TYPE:
                $variables = isset($context['variables']) ? $context['variables'] : [];
                break;
        }

        $data = seopress_get_service('VariablesToString')->replaceDataToString($data, $variables);

        return apply_filters('seopress_pro_get_json_data_geo', $data, $context);
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit