0

In functions such as the wordpress function wp_title. I have noticed they can have multiple parameters such as $sep, $display, $seplocation (using wp_title as a example).

I know with Ruby on Rails you can change any parameter such as $seplocation by using :seplocation => "left" or :seplocation => "right" while still keeping the other parameters as their defualt value. Therefore to bring me to my question: How do you make parameters such as $seplocation a specified parameter while keeping the others their default parameters?

Btw sorry if this is a duplicate, I did search to make sure it was not a duplicate however I am pressed for time and could not search as long as I would like.

Thanks for the help.

P.S. The ruby-on-rails tag was put in because I used ruby on rails as an example for my question.

8bitedge
  • 3
  • 2
  • Are you talking about function parameters? `wp_title($something, $something_else);` etc... – AbraCadaver May 27 '14 at 19:56
  • yes and i was wondering how to specify later ones ei. $somthing_else while keeping the earlier one the default value ei. $somthing – 8bitedge May 27 '14 at 19:58

1 Answers1

0

I don't know WordPress, but to pass arguments to a function and skip some, just pass null for the ones to skip:

$result = wp_title($sep, null, $seplocation);
AbraCadaver
  • 78,200
  • 7
  • 66
  • 87