2

I am trying to figure out how a plugin works. The plugin essentially places social media icons into a header file (it is a Genesis themed plugin). At any rate, the plugin's PHP file has this language:

'email' => array(
    'label'       => __( 'Email URI', 'ssiw' ),
    'pattern'     => '<li class="social-email"><a href="%s" %s>&#x2709;</a></li>',

I understand that this is a link but I can't figure out how to translate it. I thought that it might be a form of PHP argument swapping but researching that topic didn't really help. Can anyone shed any light on this href call?

brasofilo
  • 25,496
  • 15
  • 91
  • 179
Chris Moye
  • 21
  • 2

1 Answers1

1

Later on in the loading of the application it's going to leverage the pattern portion of the array and perform string replacement where you see %s. You might see something like this later:

sprintf(pattern, 'http://www.msn.com');
Mike Perrenoud
  • 66,820
  • 29
  • 157
  • 232
  • The second `%s` seems to be `target=_something`. – brasofilo Jul 05 '13 at 14:52
  • @brasofilo, agreed, but I'm really not sure exactly. I just wanted to give the OP an idea of what they are reading. – Mike Perrenoud Jul 05 '13 at 14:54
  • I looked through the entire php file and there's no sprintf reference in the file. There is no images folder so I'm trying to figure out how the href in the array translates the URL. I assumed that it was some kind of code that needed to be translated (like a bit.ly) but there's no string replacement like the one that Michael mentioned above... – Chris Moye Jul 05 '13 at 18:28