Advertisement
wilcochris

Proposed social changes - mantra admin functions

Jun 15th, 2012
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.95 KB | None | 0 0
  1. /* mantra-admin-functions.php */
  2. /* Added Network » before the social network dropdown */
  3. /* Added Address  » before the URL text box */
  4. /* Added a new text box for a title for the link */
  5. function setting_socials1_fn() {
  6.     global $mantra_options, $mantra_global_socials;
  7.     echo "Network &raquo; <select id='mantra_social1' name='ma_options[mantra_social1]'>";
  8. foreach($mantra_global_socials as $item) {
  9.     echo "<option value='$item'";
  10.     selected($mantra_options['mantra_social1'],$item);
  11.     echo ">$item</option>";
  12. }
  13.     echo "</select><span class='address_span'><br/>";
  14.     echo "Address &nbsp;&raquo; <input id='mantra_social2' name='ma_options[mantra_social2]' size='32' type='text'  value='".esc_attr( $mantra_options['mantra_social2'] )."'  /><br/>";
  15.     echo "Link title &raquo; <input id='mantra_social_title2' name='ma_options[mantra_social_title2]' size='32' type='text'  value='".esc_attr( $mantra_options['mantra_social_title2'] )."'  /></span>";
  16.     echo "<div><small>".__("Select your social network from the dropdown. Insert your corresponding address in the address input field. (ex: <i>http://www.facebook.com/yourname</i> )","mantra").". Add a <acronym title='The text in this box is the title. It is shown when you hover over the link'>link title</acronym> in the link title input field if you wish</small></div>";
  17. }
  18.  
  19. /* functions.php */
  20. /* Added the title and alt options for the link and image */
  21. /* Added an if to display default title if user does not enter one */
  22. if ($mantra_social1 && $mantra_social2) {  ?><a target="_blank" href="<?php echo $mantra_social2; ?>" class="socialicons" id="<?php echo $mantra_social1; ?>" title="<?php if ($mantra_social_title2 == ''){echo $mantra_social1;}else{echo $mantra_social_title2;} ?>"><img alt="<?php if ($mantra_social_title2 == ''){echo $mantra_social1;}else{echo $mantra_social_title2;} ?>" src="<?php echo get_template_directory_uri().'/images/socials/'.$mantra_social1.'.png'; ?>" /></a><?php }
  23. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement