Jump to content

bluefrog

Members
  • Posts

    36
  • Joined

  • Last visited

Community Answers

  1. bluefrog's post in Using php to display image based on text number was marked as the answer   
    Ah I got it. Is there a shorter version than this:
    function ball_callback($atts,$content,$tag){ //collect values, combining passed in values and defaults $values = shortcode_atts(array( 'num' => 'other' ),$atts); //based on input determine what to return $output = ''; if($values['num'] == '1'){ $output = 'output for 1'; } else if($values['num'] == '2'){ $output = 'output for 2'; } else if($values['num'] == '3'){ $output = 'output for 3'; } else{ $output = ' '; } return $output; } add_shortcode('ball','ball_callback');
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.