title: Passing function arguments to add_action within a class
body: <p>As in codex the <code>add_action</code>, accept passing function parameters</p>
  
  <pre><code>add_action( $hook, $function_to_add, $priority, $accepted_args );
  </code></pre>
  
  <p>when i pass add_action in construct function return error and say <code>messing argument 2 in function YPE_bsn_gfont</code>.</p>
  
  <p>Also when I pass function parameters in <code>add_action</code> like this <code>add_action('wp_enqueue_scripts', array($this,'YPE_bsn_gfont'), 10, 2);</code> also return same error.</p>
  
  <p>How I can pass <code>YPE_bsn_gfont</code> method into <code>add_action</code> without occurs any error</p>
  
  <pre><code>&lt;?php
  class YPE_Bsn_Gfonts {
  public function __construct() {
      add_action('wp_enqueue_scripts', array($this,'YPE_bsn_gfont'));
  }
  public function YPE_bsn_gfont($bsn_option, $id) {
      $YPE_gfont = get_option($bsn_option_group);
      $font_name = str_replace(' ', '+', $YPE_gfont[$id]);
      $font_id   = str_replace(' ', '-', $YPE_gfont[$id].'-google-font');
      $fonts_url = esc_url(add_query_arg(array('family' =&gt; $font_name, 'subset' =&gt; urlencode('latin,latin-ext')), 'https://fonts.googleapis.com/css'));
      wp_enqueue_style($font_id, $fonts_url, array(), null);
  }
  public function YPE_bsn_use_fonts() {
      $this-&gt;YPE_bsn_gfont('YPE_layout_name', 'logo-fontfamily');
  }
  }
  $YPE_GFONTS = new YPE_Bsn_Gfonts();
  ?&gt;
  </code></pre>