diff --git a/includes/options/class-amp-options-menu.php b/includes/options/class-amp-options-menu.php
index 7f1746230cc..a9302d10653 100644
--- a/includes/options/class-amp-options-menu.php
+++ b/includes/options/class-amp-options-menu.php
@@ -234,7 +234,7 @@ public function render_theme_support() {
sprintf(
/* translators: 1: customized AMP query var, 2: default AMP query var */
esc_html__( 'Warning: You customized your AMP query var too late. This means that Reader themes will not be available to you. You customized it to be %1$s instead of the default %2$s.', 'amp' ),
- sprintf( '“%s
”', esc_html( $amp_slug_customization_watcher->get_customized_slug() ) ),
+ sprintf( '“%s
”', esc_html( amp_get_slug() ) ),
sprintf( '“%s
”', QueryVars::AMP )
)
);
@@ -249,7 +249,7 @@ public function render_theme_support() {
sprintf(
/* translators: 1: customized AMP query var, 2: default AMP query var */
esc_html__( 'You customized your query var to be %1$s instead of the default %2$s.', 'amp' ),
- sprintf( '“%s
”', esc_html( $amp_slug_customization_watcher->get_customized_slug() ) ),
+ sprintf( '“%s
”', esc_html( amp_get_slug() ) ),
sprintf( '“%s
”', QueryVars::AMP )
)
);
diff --git a/src/AmpSlugCustomizationWatcher.php b/src/AmpSlugCustomizationWatcher.php
index a85285b2317..90a051a4dea 100644
--- a/src/AmpSlugCustomizationWatcher.php
+++ b/src/AmpSlugCustomizationWatcher.php
@@ -17,13 +17,6 @@
*/
final class AmpSlugCustomizationWatcher implements Service, Registerable {
- /**
- * The slug (query var) that was customized.
- *
- * @var string|null
- */
- protected $customized_slug = null;
-
/**
* Whether the slug was customized early (at plugins_loaded action, priority 8).
*
@@ -65,26 +58,6 @@ public function did_customize_late() {
return $this->is_customized_late;
}
- /**
- * Whether the slug was customized.
- *
- * @return bool
- */
- public function did_customize_slug() {
- return null !== $this->customized_slug;
- }
-
- /**
- * Get the customized slug.
- *
- * Returns null if it was not customized.
- *
- * @return string|null
- */
- public function get_customized_slug() {
- return $this->customized_slug;
- }
-
/**
* Peek at the customized slug.
*
@@ -93,7 +66,7 @@ public function get_customized_slug() {
*
* @return string Query var.
*/
- public function peek_customized_slug() {
+ protected function peek_customized_slug() {
return amp_get_slug( false );
}
@@ -108,7 +81,6 @@ public function peek_customized_slug() {
public function determine_early_customization() {
$slug = $this->peek_customized_slug();
if ( QueryVars::AMP !== $slug ) {
- $this->customized_slug = $slug;
$this->is_customized_early = true;
} else {
add_action( 'after_setup_theme', [ $this, 'determine_late_customization' ], 4 );
@@ -132,7 +104,6 @@ public function determine_early_customization() {
public function determine_late_customization() {
$slug = $this->peek_customized_slug();
if ( QueryVars::AMP !== $slug ) {
- $this->customized_slug = $slug;
$this->is_customized_late = true;
}
}