lundi 25 septembre 2017

Unable to print php variable in __ and _e function of wordpress?

here is the code which is i am using i am trying to display the custom notice on the dashboard but i am unable to print the variables in all functions so please give me some better ways.

$count = 'boom';
   function my_error_notice() { ?>
      <div class="update notice">
          <p><?php printf( esc_html__( 'We deleted %s spam messages.', 'my-plugin-textdomain' ), $count ); ?></p>
      </div>
    <?php
      }
      add_action( 'admin_notices', 'my_error_notice' );




Aucun commentaire:

Enregistrer un commentaire