Skip to content

Commit

Permalink
Remove unneessary methods and member variables
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed Jul 8, 2020
1 parent 463bb86 commit 52efa80
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 32 deletions.
4 changes: 2 additions & 2 deletions includes/options/class-amp-options-menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -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( '&#8220;<code>%s</code>&#8221;', esc_html( $amp_slug_customization_watcher->get_customized_slug() ) ),
sprintf( '&#8220;<code>%s</code>&#8221;', esc_html( amp_get_slug() ) ),
sprintf( '&#8220;<code>%s</code>&#8221;', QueryVars::AMP )
)
);
Expand All @@ -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( '&#8220;<code>%s</code>&#8221;', esc_html( $amp_slug_customization_watcher->get_customized_slug() ) ),
sprintf( '&#8220;<code>%s</code>&#8221;', esc_html( amp_get_slug() ) ),
sprintf( '&#8220;<code>%s</code>&#8221;', QueryVars::AMP )
)
);
Expand Down
31 changes: 1 addition & 30 deletions src/AmpSlugCustomizationWatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -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).
*
Expand Down Expand Up @@ -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.
*
Expand All @@ -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 );
}

Expand All @@ -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 );
Expand All @@ -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;
}
}
Expand Down

0 comments on commit 52efa80

Please sign in to comment.