• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Yoast SEO a2z

Yoast SEO a2z

WordPress SEO a2z

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / WPSEO_Config_Field_Choice::add_choice() – Add a choice to the properties.

You appear to be a bot. Output may be restricted

Description

Add a choice to the properties.

Usage

WPSEO_Config_Field_Choice::add_choice( $value, $label, $aria_label );

Parameters

$value
( string ) required – Value op the option.
$label
( string ) required – Label to display for the value.
$aria_label
( string ) optional – Optional. Aria label text to use.

Returns

void

Source

File name: wordpress-seo/admin/config-ui/fields/class-field-choice.php


Lines:

1 to 12 of 12
  public function add_choice( $value, $label, $aria_label = '' ) {
    $choice = [
      'label' => $label,
    ];

    if ( $aria_label ) {
      $choice['screenReaderText'] = $aria_label;
    }

    $this->properties['choices'][ $value ] = $choice;
  }
 

 View on GitHub View on Trac

Published: 27th November 2019 | Last updated: 19th December 2019

Primary Sidebar

Information

Function name: WPSEO_Config_Field_Choice::add_choice
Class ref: WPSEO_Config_Field_Choice
Plugin ref: Yoast SEO
Version: 15.4
Sourcefile: admin/config-ui/fields/class-field-choice.php
File ref: admin/config-ui/fields/class-field-choice.php
Deprecated?: No
API Letters: A,C,F,W

Footer

Yoast SEO a2z
Yoast SEO a2z
WordPress SEO a2z
WordPress 5.6
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  wordpress-seo.wp-a2z.org
© Copyright Yoast SEO a2z 2017-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites