Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* mantra-admin-functions.php */
- /* Added Network » before the social network dropdown */
- /* Added Address » before the URL text box */
- /* Added a new text box for a title for the link */
- function setting_socials1_fn() {
- global $mantra_options, $mantra_global_socials;
- echo "Network » <select id='mantra_social1' name='ma_options[mantra_social1]'>";
- foreach($mantra_global_socials as $item) {
- echo "<option value='$item'";
- selected($mantra_options['mantra_social1'],$item);
- echo ">$item</option>";
- }
- echo "</select><span class='address_span'><br/>";
- echo "Address » <input id='mantra_social2' name='ma_options[mantra_social2]' size='32' type='text' value='".esc_attr( $mantra_options['mantra_social2'] )."' /><br/>";
- echo "Link title » <input id='mantra_social_title2' name='ma_options[mantra_social_title2]' size='32' type='text' value='".esc_attr( $mantra_options['mantra_social_title2'] )."' /></span>";
- 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>";
- }
- /* functions.php */
- /* Added the title and alt options for the link and image */
- /* Added an if to display default title if user does not enter one */
- 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 }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement