Submit
Path:
~
/
home
/
bfxleof
/
www
/
wp-content
/
plugins
/
wordpress-seo
/
src
/
presenters
/
File Content:
light-switch-presenter.php
<?php namespace Yoast\WP\SEO\Presenters\Admin; use Yoast\WP\SEO\Presenters\Abstract_Presenter; /** * Class Light_Switch_Presenter. * * @package Yoast\WP\SEO\Presenters\Admin */ class Light_Switch_Presenter extends Abstract_Presenter { /** * The variable to create the checkbox for. * * @var string */ protected $var; /** * The visual label text for the toggle. * * @var string */ protected $label; /** * Array of two visual labels for the buttons. * * @var array */ protected $buttons; /** * The name of the underlying checkbox. * * @var string */ protected $name; /** * The variable current value. * * @var string|bool */ protected $value; /** * Reverse order of buttons. * * @var bool */ protected $reverse; /** * The inline Help HTML. * * @var string */ protected $help; /** * Whether the visual label is displayed in strong text. * * @var bool */ protected $strong; /** * The disabled attribute HTML. * * @var string */ protected $disabled_attribute; /** * Light_Switch_Presenter constructor. * * @param string $var The variable to create the checkbox for. * @param string $label The visual label text for the toggle. * @param array $buttons Array of two visual labels for the buttons (defaults Disabled/Enabled). * @param string $name The name of the underlying checkbox. * @param string|bool $value The variable current value, to determine the checked attribute. * @param bool $reverse Optional. Reverse order of buttons (default true). * @param string $help Optional. Inline Help HTML that will be printed out before the toggle. Default is empty. * @param bool $strong Optional. Whether the visual label is displayed in strong text. Default is false. * Starting from Yoast SEO 16.5, the visual label is forced to bold via CSS. * @param string $disabled_attribute Optional. The disabled HTML attribute. Default is empty. */ public function __construct( $var, $label, $buttons, $name, $value, $reverse = true, $help = '', $strong = false, $disabled_attribute = '' ) { $this->var = $var; $this->label = $label; $this->buttons = $buttons; $this->name = $name; $this->value = $value; $this->reverse = $reverse; $this->help = $help; $this->strong = $strong; $this->disabled_attribute = $disabled_attribute; } /** * Presents the light switch toggle. * * @return string The light switch's HTML. */ public function present() { if ( empty( $this->buttons ) ) { $this->buttons = [ \__( 'Disabled', 'wordpress-seo' ), \__( 'Enabled', 'wordpress-seo' ) ]; } list( $off_button, $on_button ) = $this->buttons; $class = 'switch-light switch-candy switch-yoast-seo'; if ( $this->reverse ) { $class .= ' switch-yoast-seo-reverse'; } $help_class = ! empty( $this->help ) ? ' switch-container__has-help' : ''; $strong_class = ( $this->strong ) ? ' switch-light-visual-label__strong' : ''; $output = '<div class="switch-container' . $help_class . '">'; $output .= \sprintf( '<span class="switch-light-visual-label%1$s" id="%2$s">%3$s</span>%4$s', $strong_class, // phpcs:ignore WordPress.Security.EscapeOutput -- Reason: $strong_class output is hardcoded. \esc_attr( $this->var . '-label' ), \esc_html( $this->label ), $this->help // phpcs:ignore WordPress.Security.EscapeOutput -- Reason: The help contains HTML. ); $output .= '<label class="' . $class . '"><b class="switch-yoast-seo-jaws-a11y"> </b>'; $output .= \sprintf( '<input type="checkbox" aria-labelledby="%1$s" id="%2$s" name="%3$s" value="on"%4$s%5$s/>', \esc_attr( $this->var . '-label' ), \esc_attr( $this->var ), \esc_attr( $this->name ), \checked( $this->value, 'on', false ), // phpcs:ignore WordPress.Security.EscapeOutput -- Reason: The output is hardcoded by WordPress. $this->disabled_attribute // phpcs:ignore WordPress.Security.EscapeOutput -- Reason: $disabled_attribute output is hardcoded. ); $output .= '<span aria-hidden="true">'; $output .= '<span>' . \esc_html( $off_button ) . '</span>'; $output .= '<span>' . \esc_html( $on_button ) . '</span>'; $output .= '<a></a>'; $output .= '</span></label><div class="clear"></div></div>'; return $output; } }
Submit
FILE
FOLDER
Name
Size
Permission
Action
admin
---
0755
open-graph
---
0755
slack
---
0755
twitter
---
0755
webmaster
---
0755
-20260707073531.DS_Store
10234 bytes
0644
.DS_Store
10234 bytes
0644
AjaxController.php
2162 bytes
0644
DownloadConfController.php
945 bytes
0644
Inverter-20260707144656.php
6818 bytes
0644
Inverter.php
6818 bytes
0644
JsonSerializable.php
577 bytes
0644
LimitStream-20260705123008.php
4209 bytes
0644
LimitStream.php
4209 bytes
0644
README.md
2555 bytes
0644
abstract-indexable-presenter.php
1020 bytes
0644
abstract-indexable-tag-presenter.php
1004 bytes
0644
abstract-presenter.php
377 bytes
0644
admin-network-it_IT.l10n.php
42133 bytes
0644
article-modified-time-presenter.php
609 bytes
0644
baidu-presenter.php
659 bytes
0644
bingbot-presenter.php
1674 bytes
0644
canonical-presenter.php
1066 bytes
0644
class-admin-utils-20260622095013.php
2147 bytes
0644
class-admin-utils.php
2147 bytes
0644
class-helpscout.php
6972 bytes
0644
class-metabox-formatter.php
12602 bytes
0644
class-opengraph-oembed.php
1126 bytes
0644
class-option-tab.php
1784 bytes
0644
class-option-tabs-formatter.php
2321 bytes
0644
class-sitemaps-admin-20260703023908-20260705035108.php
3665 bytes
0644
class-sitemaps-admin-20260703023908.php
3665 bytes
0644
class-sitemaps-admin.php
3665 bytes
0644
class-wpseo-replacement-variable.php
1375 bytes
0644
class-wpseo-statistics-20260703220502.php
1443 bytes
0644
class-wpseo-statistics.php
1443 bytes
0644
class-yoast-network-admin.php
9688 bytes
0644
class-yoast-plugin-conflict.php
10390 bytes
0644
class.constants-20260623122002.php
150 bytes
0644
class.pack.database-20260707021344.php
30838 bytes
0644
class.pack.database.php
30838 bytes
0644
dashboard-1650-rtl.css
1634 bytes
0644
define.php
4567 bytes
0644
description-presenter-20260623011438.php
1026 bytes
0644
duplicator-en_US.mo
582 bytes
0644
duplicator-main.php
26907 bytes
0644
duplicator.php
1781 bytes
0644
elFinderPlugin-20260706155921.php
3331 bytes
0644
elFinderPlugin.php
3331 bytes
0644
elFinderVolumeLocalFileSystem.class-20260623050500-20260705194237.php
48544 bytes
0644
elFinderVolumeLocalFileSystem.class-20260623050500.php
48544 bytes
0644
elFinderVolumeLocalFileSystem.class-20260623171315.php
48544 bytes
0644
elFinderVolumeLocalFileSystem.class-20260624110936.php
48544 bytes
0644
elFinderVolumeLocalFileSystem.class.php
48544 bytes
0644
environment-helper.php
596 bytes
0644
estimated-reading-time.php
1111 bytes
0644
exceptions.php
708 bytes
0644
flexible-widget.php
11167 bytes
0644
googlebot-presenter.php
1722 bytes
0644
help-link-presenter.php
2087 bytes
0644
image-helper.php
10231 bytes
0644
image-presenter.php
2093 bytes
0644
inc.data-20260705181931.php
5121 bytes
0644
inc.data.php
5121 bytes
0644
inc.validator.php
5401 bytes
0644
index.php
157663 bytes
0644
interface-sitemap-cache-data.php
1208 bytes
0644
light-switch-presenter.php
4586 bytes
0644
loco.php
5626 bytes
0644
loco.xml
657 bytes
0644
manager.php
14659 bytes
0644
meta-description-presenter.php
1941 bytes
0644
meta-fields-presenter.php
1600 bytes
0644
module.php
1297 bytes
0644
quick-edit-handler-1650.js
1848 bytes
0644
recovery.php
1146 bytes
0644
rel-next-presenter.php
1581 bytes
0644
rel-prev-presenter.php
1561 bytes
0644
robots-presenter-20260623011214.php
630 bytes
0644
root.php
1951 bytes
0644
schema-presenter-20260623011450.php
1358 bytes
0644
social.php
725 bytes
0644
title-presenter.php
1393 bytes
0644
url-list-presenter.php
983 bytes
0644
wordpress-seo-es_ES-20260704221345.json
25583 bytes
0644
wordpress-seo-es_ES.json
25583 bytes
0644
wordpress-seojs-ar.json
25925 bytes
0644
wordpress-seojs-bs_BA-20260704174856.json
13790 bytes
0644
wordpress-seojs-bs_BA.json
13790 bytes
0644
wordpress-seojs-es_ES.json
20568 bytes
0644
wordpress-seojs-fi.json
19387 bytes
0644
wordpress-seojs-gl_ES.json
20143 bytes
0644
wordpress-seojs-ja-20260707075320.json
21424 bytes
0644
wordpress-seojs-ja.json
21424 bytes
0644
wordpress-seojs-uk.json
26506 bytes
0644
wp-query-wrapper.php
834 bytes
0644
N4ST4R_ID | Naxtarrr