get_page_url example

<?php
//phpcs:disable VariableAnalysis // There are "undefined" variables here because they're defined in the code that includes this file as a template. ?> <?php if ( $type == 'plugin' ) : ?> <div class="updated" id="akismet_setup_prompt"> <form name="akismet_activate" action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="POST"> <div class="akismet_activate"> <div class="aa_a">A</div> <div class="aa_button_container"> <div class="aa_button_border"> <input type="submit" class="aa_button" value="<?php esc_attr_e( 'Set up your Akismet account', 'akismet' ); ?>" /> </div> </div> <div class="aa_description"><?php _e('<strong>Almost done</strong> - configure Akismet and say goodbye to spam', 'akismet');?></div> </div> </form> </div>
//phpcs:disable VariableAnalysis // There are "undefined" variables here because they're defined in the code that includes this file as a template.
?> <div class="akismet-box"> <?php Akismet::view( 'title' ); ?> <div class="akismet-jp-connect"> <h3><?php esc_html_e( 'Connect with Jetpack', 'akismet' ); ?></h3><?php         if ( in_array( $akismet_user->status, array( 'no-sub', 'missing' ) ) ) {?> <p><?php esc_html_e( 'Use your Jetpack connection to set up Akismet.', 'akismet' ); ?></p> <form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="akismet-right" target="_blank"> <input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/> <input type="hidden" name="blog" value="<?php echo esc_url( get_option( 'home' ) ); ?>"/> <input type="hidden" name="auto-connect" value="<?php echo esc_attr( $akismet_user->ID ); ?>"/> <input type="hidden" name="redirect" value="plugin-signup"/> <input type="submit" class="akismet-button akismet-is-primary" value="<?php esc_attr_e( 'Connect with Jetpack' , 'akismet' ); ?>"/> </form> <?php echo get_avatar( $akismet_user->user_email, null, null, null, array( 'class' => 'akismet-jetpack-gravatar' ) ); ?> <p><?php             /* translators: %s is the WordPress.com username */
            echo sprintf( esc_html( __( 'You are connected as %s.', 'akismet' ) ), '<b>' . esc_html( $akismet_user->user_login ) . '</b>' ); ?><br /><span class="akismet-jetpack-email"><?php echo esc_html( $akismet_user->user_email ); ?></span></p> <?php } elseif ( $akismet_user->status == 'cancelled' ) { ?> <p><?php esc_html_e( 'Use your Jetpack connection to set up Akismet.', 'akismet' ); ?></p> <form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="akismet-right" target="_blank"> <input type="hidden" name="passback_url" value="
//phpcs:disable VariableAnalysis // There are "undefined" variables here because they're defined in the code that includes this file as a template.
$submit_classes_attr = 'akismet-button';

if ( isset( $classes ) && ( is_countable( $classes ) ? count( $classes ) : 0 ) > 0 ) {
    $submit_classes_attr = implode( ' ', $classes );
}
?> <form name="akismet_activate" action="https://akismet.com/get/" method="POST" target="_blank"> <input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/> <input type="hidden" name="blog" value="<?php echo esc_url( get_option( 'home' ) ); ?>"/> <input type="hidden" name="redirect" value="<?php echo isset( $redirect ) ? $redirect : 'plugin-signup'; ?>"/> <button type="submit" class="<?php echo esc_attr( $submit_classes_attr ); ?>" value="<?php echo esc_attr( $text ); ?>"><?php echo esc_attr( $text ) . '<span class="screen-reader-text">' . esc_html__( '(opens in a new tab)', 'akismet' ) . '</span>'; ?></button> </form>
<?php //phpcs:disable VariableAnalysis // There are "undefined" variables here because they're defined in the code that includes this file as a template. ?> <div class="akismet-masthead__logo-container"> <?php if ( isset( $include_logo_link ) && $include_logo_link === true ) : ?> <a href="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" class="akismet-masthead__logo-link"> <?php endif; ?> <img class="akismet-masthead__logo" src="<?php echo esc_url( plugins_url( '../_inc/img/akismet-refresh-logo@2x.png', __FILE__ ) ); ?>" srcset="<?php echo esc_url( plugins_url( '../_inc/img/akismet-refresh-logo.svg', __FILE__ ) ); ?>" alt="Akismet logo" /> <?php if ( isset( $include_logo_link ) && $include_logo_link === true ) : ?> </a> <?php endif; ?> </div>
<?php } ?> <?php } ?> <div class="akismet-card"> <div class="akismet-section-header"> <h2 class="akismet-section-header__label"> <span><?php esc_html_e( 'Statistics', 'akismet' ); ?></span> </h2> <?php if ( $stat_totals && isset( $stat_totals['all'] ) && (int) $stat_totals['all']->spam > 0 ) : ?> <div class="akismet-section-header__actions"> <a href="<?php echo esc_url( Akismet_Admin::get_page_url( 'stats' ) ); ?>"> <?php esc_html_e( 'Detailed stats', 'akismet' ); ?> </a> </div> </div> <!-- close akismet-section-header --> <div class="akismet-new-snapshot"> <?php /* name attribute on iframe is used as a cache-buster here to force Firefox to load the new style charts: https://bugzilla.mozilla.org/show_bug.cgi?id=356558 */ ?> <div class="akismet-new-snapshot__chart"> <iframe id="stats-iframe" allowtransparency="true" scrolling="no" frameborder="0" style="width: 100%; height: 220px; overflow: hidden;" src="<?php echo esc_url( sprintf( 'https://tools.akismet.com/1.0/snapshot.php?blog=%s&token=%s&height=200&locale=%s&is_redecorated=1', urlencode( get_option( 'home' ) )urlencode( Akismet::get_access_token() )get_locale() ) ); ?>" name="<?php echo esc_attr( 'snapshot-' . filemtime( __FILE__ ) ); ?>" title="<?php echo esc_attr__( 'Akismet stats' ); ?>"></iframe> </div> <ul class="akismet-new-snapshot__list"> <li class="akismet-new-snapshot__item"> <h3 class="akismet-new-snapshot__header">
<div id="akismet-plugin-container"> <div class="akismet-masthead"> <div class="akismet-masthead__inside-container"> <?php Akismet::view( 'logo', array( 'include_logo_link' => true ) ); ?> <div class="akismet-masthead__back-link-container"> <a class="akismet-masthead__back-link" href="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"><?php esc_html_e( 'Back to settings', 'akismet' ); ?></a> </div> </div> </div> <?php /* name attribute on iframe is used as a cache-buster here to force Firefox to load the new style charts: https://bugzilla.mozilla.org/show_bug.cgi?id=356558 */ ?> <iframe id="stats-iframe" src="<?php echo esc_url( sprintf( 'https://tools.akismet.com/1.0/user-stats.php?blog=%s&token=%s&locale=%s&is_redecorated=1', urlencode( get_option( 'home' ) )urlencode( Akismet::get_access_token() )esc_attr( get_locale() ) ) ); ?>" name="<?php echo esc_attr( 'user-stats- ' . filemtime( __FILE__ ) ); ?>" width="100%" height="2500px" frameborder="0" title="<?php echo esc_attr__( 'Akismet detailed stats' ); ?>"></iframe> </div>


        if ( isset( $_POST['action'] ) && $_POST['action'] == 'enter-key' ) {
            self::enter_api_key();
        }
    }

    public static function init_hooks() {
        // The standalone stats page was removed in 3.0 for an all-in-one config and stats page.         // Redirect any links that might have been bookmarked or in browser history.         if ( isset( $_GET['page'] ) && 'akismet-stats-display' == $_GET['page'] ) {
            wp_safe_redirect( esc_url_raw( self::get_page_url( 'stats' ) ), 301 );
            die;
        }

        self::$initiated = true;

        add_action( 'admin_init', array( 'Akismet_Admin', 'admin_init' ) );
        add_action( 'admin_menu', array( 'Akismet_Admin', 'admin_menu' ), 5 ); # Priority 5, so it's called before Jetpack's admin_menu.         add_action( 'admin_notices', array( 'Akismet_Admin', 'display_notice' ) );
        add_action( 'admin_enqueue_scripts', array( 'Akismet_Admin', 'load_resources' ) );
        add_action( 'activity_box_end', array( 'Akismet_Admin', 'dashboard_stats' ) );
        add_action( 'rightnow_end', array( 'Akismet_Admin', 'rightnow_stats' ) );
        
<div class="akismet-enter-api-key-box centered"> <a href="#"><?php esc_html_e( 'Manually enter an API key', 'akismet' ); ?></a> <div class="enter-api-key"> <form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post"> <?php wp_nonce_field( Akismet_Admin::NONCE ) ?> <input type="hidden" name="action" value="enter-key"> <p style="width: 100%; display: flex; flex-wrap: nowrap; box-sizing: border-box;"> <input id="key" name="key" type="text" size="15" value="" placeholder="<?php esc_attr_e( 'Enter your API key' , 'akismet' ); ?>" class="regular-text code" style="flex-grow: 1; margin-right: 1rem;"> <input type="submit" name="submit" id="submit" class="akismet-button" value="<?php esc_attr_e( 'Connect with API key', 'akismet' );?>"> </p> </form> </div> </div>
Home | Imprint | This part of the site doesn't use cookies.