Skip to content

Commit

Permalink
Remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
delawski committed Jul 7, 2021
1 parent 17dc867 commit 20c73be
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions includes/validation/class-amp-validated-url-post-type.php
Original file line number Diff line number Diff line change
Expand Up @@ -2021,21 +2021,6 @@ public static function enqueue_edit_post_screen_scripts() {
true
);

$post = get_post();

// @todo This is likely dead code.
$current_screen = get_current_screen();
if ( $current_screen && 'post' === $current_screen->base && self::POST_TYPE_SLUG === $current_screen->post_type ) {
$data = [
'amp_enabled' => self::is_amp_enabled_on_post( $post ),
];

wp_localize_script(
self::EDIT_POST_SCRIPT_HANDLE,
'ampValidation',
$data
);
}

// React-based validated URL page component.
$asset_file = AMP__DIR__ . '/assets/js/' . self::AMP_VALIDATED_URL_PAGE_SCRIPT_HANDLE . '.asset.php';
Expand All @@ -2051,6 +2036,7 @@ public static function enqueue_edit_post_screen_scripts() {
true
);

$post = get_post();
$validated_url_page_data = [
'APP_ROOT_ID' => self::AMP_VALIDATED_URL_PAGE_APP_ROOT_ID,
'POST_ID' => $post->ID,
Expand Down

0 comments on commit 20c73be

Please sign in to comment.