WC_Admin::admin_footer_text( string $footer_text )
Change the admin footer text on WooCommerce admin pages.
Description Description
Parameters Parameters
- $footer_text
-
(Required) text to be rendered in the footer.
Return Return
(string)
Source Source
File: includes/admin/class-wc-admin.php
public function admin_footer_text( $footer_text ) { if ( ! current_user_can( 'manage_woocommerce' ) || ! function_exists( 'wc_get_screen_ids' ) ) { return $footer_text; } $current_screen = get_current_screen(); $wc_pages = wc_get_screen_ids(); // Set only WC pages. $wc_pages = array_diff( $wc_pages, array( 'profile', 'user-edit' ) ); // Check to make sure we're on a WooCommerce admin page. if ( isset( $current_screen->id ) && apply_filters( 'woocommerce_display_admin_footer_text', in_array( $current_screen->id, $wc_pages, true ) ) ) { // Change the footer text. if ( ! get_option( 'woocommerce_admin_footer_text_rated' ) ) { $footer_text = sprintf( /* translators: 1: WooCommerce 2:: five stars */ __( 'If you like %1$s please leave us a %2$s rating. A huge thanks in advance!', 'woocommerce' ), sprintf( '<strong>%s</strong>', esc_html__( 'WooCommerce', 'woocommerce' ) ), '<a href="https://wordpress.org/support/plugin/woocommerce/reviews?rate=5#new-post" target="_blank" class="wc-rating-link" aria-label="' . esc_attr__( 'five star', 'woocommerce' ) . '" data-rated="' . esc_attr__( 'Thanks :)', 'woocommerce' ) . '">★★★★★</a>' ); wc_enqueue_js( "jQuery( 'a.wc-rating-link' ).click( function() { jQuery.post( '" . WC()->ajax_url() . "', { action: 'woocommerce_rated' } ); jQuery( this ).parent().text( jQuery( this ).data( 'rated' ) ); });" ); } else { $footer_text = __( 'Thank you for selling with WooCommerce.', 'woocommerce' ); } } return $footer_text; }
Changelog Changelog
Version | Description |
---|---|
2.3 | Introduced. |