# thinkrank/2.4.0/includes/abilities/settings/class-get-author-archives-settings.php

ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console &amp; Local SEO, version 2.4.0. 118 lines.

- Page: https://pluginprobe.com/plugins/thinkrank/2.4.0/code/includes/abilities/settings/class-get-author-archives-settings.php
- Raw: https://pluginprobe.com/plugins/thinkrank/2.4.0/raw/includes/abilities/settings/class-get-author-archives-settings.php
- Modified: 2026-08-31T10:09:34+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/thinkrank/2.4.0/code/includes/abilities/settings/class-get-author-archives-settings.php#L10-L20`.

```php
<?php
/**
 * Get author archives settings ability.
 *
 * @package ThinkRank\Abilities\Settings
 */

declare(strict_types=1);

namespace ThinkRank\Abilities\Settings;

use ThinkRank\Abilities\Ability_Base;
use ThinkRank\Core\Settings;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

/**
 * Retrieves ThinkRank author archives settings.
 *
 * Controls whether author archives are enabled and indexable, whether empty
 * archives are shown, and the SEO title/meta description templates.
 */
class Get_Author_Archives_Settings extends Ability_Base {
	/**
	 * Boolean settings: API alias => [ storage_key, default ].
	 */
	private const BOOL_MAP = [
		'enabled'                => [ 'author_archives_enabled', true ],
		'show_in_search_results' => [ 'author_archives_index', true ],
		'show_empty_archives'    => [ 'author_archives_show_empty', false ],
	];

	/**
	 * String settings: API alias => [ storage_key, default ].
	 */
	private const STRING_MAP = [
		'title'            => [ 'author_archives_title', Settings::DEFAULT_AUTHOR_ARCHIVES_TITLE ],
		'meta_description' => [ 'author_archives_meta_desc', Settings::DEFAULT_AUTHOR_ARCHIVES_META_DESC ],
	];

	/**
	 * Constructor.
	 */
	public function __construct() {
		$this->id          = 'thinkrank/get-author-archives-settings';
		$this->label       = __( 'Get ThinkRank Author Archives Settings', 'thinkrank' );
		$this->description = __( 'Retrieve ThinkRank author archives settings: enable/index toggles, empty-archive visibility, and the SEO title/meta description templates. Use update-author-archives-settings to change them.', 'thinkrank' );
	}

	/**
	 * {@inheritDoc}
	 *
	 * @return array<string, bool|float|string>
	 */
	public function get_annotations() {
		return [
			'readonly'      => true,
			'destructive'   => false,
			'idempotent'    => true,
			'priority'      => 1.0,
			'openWorldHint' => false,
		];
	}

	/**
	 * {@inheritDoc}
	 *
	 * @return array<string, mixed>
	 */
	public function get_input_schema() {
		return [
			'type'                 => 'object',
			'additionalProperties' => false,
			'properties'           => self::empty_properties(),
		];
	}

	/**
	 * {@inheritDoc}
	 *
	 * @return array<string, mixed>
	 */
	public function get_output_schema() {
		return [
			'type'       => 'object',
			'properties' => [
				'enabled'                => [ 'type' => 'boolean' ],
				'show_in_search_results' => [ 'type' => 'boolean' ],
				'show_empty_archives'    => [ 'type' => 'boolean' ],
				'title'                  => [ 'type' => 'string' ],
				'meta_description'       => [ 'type' => 'string' ],
			],
		];
	}

	/**
	 * Execute ability.
	 *
	 * @param array<string, mixed> $input Ability input payload.
	 * @return array<string, mixed>
	 */
	public function execute( $input ) {
		$settings = Settings::instance();
		$out      = [];

		foreach ( self::BOOL_MAP as $alias => $config ) {
			$out[ $alias ] = (bool) $settings->get( $config[0], $config[1] );
		}
		foreach ( self::STRING_MAP as $alias => $config ) {
			$out[ $alias ] = (string) $settings->get( $config[0], $config[1] );
		}

		return $out;
	}
}

```
