' . esc_html__( 'Settings', 'rb-links-redirection' ) . '' ); return $links; } private static function is_screen(): bool { $page = isset( $_GET['page'] ) ? sanitize_key( wp_unslash( $_GET['page'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended return $page === self::PAGE || ( self::$own_root && $page === 'rb_plugins_settings' ); } public static function assets( $hook ): void { if ( ! self::is_screen() ) { return; } $handle = 'rb-redirection-admin'; wp_enqueue_script( $handle, RB_REDIRECTION_URL . 'assets/admin/app.js', array( 'wp-i18n' ), RB_REDIRECTION_VERSION, true ); wp_set_script_translations( $handle, 'rb-links-redirection' ); $types = array(); foreach ( get_post_types( array( 'public' => true ), 'objects' ) as $type ) { if ( $type->name !== 'attachment' ) { $types[ $type->name ] = $type->labels->singular_name; } } wp_localize_script( $handle, 'RBRedirectionAdmin', array( 'restUrl' => esc_url_raw( rest_url( Rest::NS . '/' ) ), 'wpRest' => esc_url_raw( rest_url( 'wp/v2/' ) ), 'nonce' => wp_create_nonce( 'wp_rest' ), 'home' => home_url( '/' ), 'version' => RB_REDIRECTION_VERSION, 'postTypes' => $types, 'docsUrl' => 'https://rbplugins.com/docs/rb-links-redirection/', 'pageUrl' => 'https://rbplugins.com/wordpress-plugins/rb-links-redirection/', ) ); } public static function render(): void { echo '