PageRenderTime 17ms CodeModel.GetById 9ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 0ms

/wp-content/plugins/wordpress-seo/admin/config-ui/fields/class-field-site-type.php

https://bitbucket.org/carloskikea/helpet
PHP | 39 lines | 17 code | 5 blank | 17 comment | 0 complexity | 0bc3d692eab8109435a83db7cd7c924e MD5 | raw file
 1<?php
 2/**
 3 * WPSEO plugin file.
 4 *
 5 * @package WPSEO\Admin\ConfigurationUI
 6 */
 7
 8/**
 9 * Class WPSEO_Config_Field_Site_Type
10 */
11class WPSEO_Config_Field_Site_Type extends WPSEO_Config_Field_Choice {
12
13	/**
14	 * WPSEO_Config_Field_Site_Type constructor.
15	 */
16	public function __construct() {
17		parent::__construct( 'siteType' );
18
19		/* translators: %1$s resolves to the home_url of the blog. */
20		$this->set_property( 'label', sprintf( __( 'What does the site %1$s represent?', 'wordpress-seo' ), get_home_url() ) );
21
22		$this->add_choice( 'blog', __( 'A blog', 'wordpress-seo' ) );
23		$this->add_choice( 'shop', __( 'An online shop', 'wordpress-seo' ) );
24		$this->add_choice( 'news', __( 'A news channel', 'wordpress-seo' ) );
25		$this->add_choice( 'smallBusiness', __( 'A small offline business', 'wordpress-seo' ) );
26		$this->add_choice( 'corporate', __( 'A corporation', 'wordpress-seo' ) );
27		$this->add_choice( 'portfolio', __( 'A portfolio', 'wordpress-seo' ) );
28		$this->add_choice( 'other', __( 'Something else', 'wordpress-seo' ) );
29	}
30
31	/**
32	 * Set adapter
33	 *
34	 * @param WPSEO_Configuration_Options_Adapter $adapter Adapter to register lookup on.
35	 */
36	public function set_adapter( WPSEO_Configuration_Options_Adapter $adapter ) {
37		$adapter->add_option_lookup( $this->get_identifier(), 'site_type' );
38	}
39}