wordpress woocommerce php variable usage %1$s

Posted by tech on Pro Webmasters See other posts from Pro Webmasters or by tech
Published on 2014-06-08T15:36:55Z Indexed on 2014/06/08 15:45 UTC
Read the original article Hit count: 286

Filed under:
|
|

I am using wordpress with woocommerce and I am trying to manipulate a copy of myaccount.php The default code uses some variables of some sort that I am not familiar with nor have I been able to find documentation on. The variables in question are %1$s, %2$s and %s

<p class="myaccount_user">
<?php
printf(
    __( 'Hello <strong>%1$s</strong> (not %1$s? <a href="%2$s">Sign out</a>).', 'woocommerce' ) . ' ',
    $current_user->display_name,
    wp_logout_url( get_permalink( wc_get_page_id( 'myaccount' ) ) )
);
?>

<?php
printf( __( 'From this page you can view your recent orders, manage your shipping and billing addresses and <a href="%s">edit your password and account details</a>.', 'woocommerce' ),
    wc_customer_edit_account_url()
);
?>
</p>

How can I identify the variables, what they represent and how to use them?

Thank you.

© Pro Webmasters or respective owner

Related posts about php

Related posts about Wordpress