Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function symbiostock_social_credentials( $user ) { ?>
- <?php
- if ( !current_user_can( 'manage_options', $userid ) )
- return false;
- $prfx = 'symbiostock_';
- $text_fields = array(
- 'Personal Photo' => '(URL)',
- 'Software' => 'Illustrator, photoshop, 3d Studio Max, etc.',
- 'Equipment' => 'Cameras, computers, graphic tablets, etc.',
- 'Location' => 'Country/City',
- 'Languages' => 'Your spoken language(s)',
- 'Website 1' => '(URL)',
- 'Website 2' => '(URL)',
- 'Gallery Page' => '(URL)',
- 'Clients' => 'Who you\'ve worked for.',
- );
- $select_dropdowns = array(
- 'Profession 1' => array('-', 'Illustrator', 'Photographer', 'Developer', 'Artist', 'Marketing', 'Graphic Design', '3d Design' ),
- 'Profession 2' => array('-', 'Illustrator', 'Photographer', 'Developer', 'Artist', 'Marketing', 'Graphic Design', '3d Design' ),
- 'Portfolio Focus 1' => array('-', 'Photography', 'Vector', '3d Design', 'Digital Painting'),
- 'Portfolio Focus 2' => array('-', 'Photography', 'Vector', '3d Design', 'Digital Painting'),
- 'Gender' => array('-', 'Male', 'Female'),
- );
- if(isset($_POST['symbiostock_social_credentials'])){
- $symbiostock_social_credentials = array();
- foreach($text_fields as $key => $value){
- $name_id = $prfx . strtolower(str_replace(' ', '_', $key));
- if(isset($_POST[$prfx.$name_id])){
- array_push($symbiostock_social_credentials, array($key => $_POST[$prfx.$key]));
- }
- }
- foreach($select_dropdowns as $key => $value){
- $name_id = $prfx . strtolower(str_replace(' ', '_', $key));
- if(isset($_POST[$prfx.$key])){
- array_push($symbiostock_social_credentials, array($key => $_POST[$prfx.$name_id]));
- }
- }
- update_user_meta($user->ID, 'symbiostock_social_credentials', $symbiostock_social_credentials);
- }
- $credentials = get_user_meta($user->ID, 'symbiostock_social_credentials');
- print_r($_POST);
- ?>
- <h3>Symbiostock Profile and Extended Network Info</h3>
- <table class="form-table">
- <?php
- foreach($text_fields as $key => $text){
- $name_id = $prfx . strtolower(str_replace(' ', '_', $key));
- /*
- if (strpos($text_field,'URL') !== false) {
- if(symbiostock_validate_url($text_field) == false){
- echo '<p>Invalid URL for ' . $key . '. Please try again.</p>';
- continue;
- }*/
- ?>
- <tr>
- <th><label for="<?php echo $name_id; ?>"><?php echo $key; ?></label></th>
- <td>
- <input type="text" name="<?php echo $name_id; ?>" id="<?php echo $name_id; ?>" value="" class="regular-text" /><br />
- <span class="description"><?php echo $text; ?></span>
- </td>
- </tr>
- <?php
- }
- foreach ($select_dropdowns as $key => $options){
- $name_id = $prfx . strtolower(str_replace(' ', '_', $key));
- ?>
- <tr>
- <th><label for="<?php echo $prfx.$name_id; ?>"> <?php echo $key; ?></label> </th>
- <td>
- <select id="<?php echo $prfx.$name_id ?>" name="<?php echo $prfx.$name_id; ?>" id="<?php echo $name_id; ?>" class="regular-text">
- <?php
- foreach($options as $option){
- ?> <option value="<?php echo $option; ?>"><?php echo $option; ?></option> <?php
- }
- ?>
- </select><br />
- </td>
- </tr>
- <?php
- }
- ?>
- <input type="hidden" name="symbiostock_social_credentials" value="1" />
- </table>
- <?php }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement