array( 'type' => 'text', 'title' => esc_html__( 'Facebook', 'artistas' ), 'value' => 'https://www.facebook.com/' ), 'behance' => array( 'type' => 'text', 'title' => esc_html__( 'Behance', 'artistas' ), 'value' => 'https://www.behance.net/' ), 'dribbble' => array( 'type' => 'text', 'title' => esc_html__( 'Dribbble', 'artistas' ), 'value' => '' ), 'flickr' => array( 'type' => 'text', 'title' => esc_html__( 'Flickr', 'artistas' ), 'value' => 'https://plus.google.com/' ), 'google_plus' => array( 'type' => 'text', 'title' => esc_html__( 'Google Plus', 'artistas' ), 'value' => '' ), 'instagram' => array( 'type' => 'text', 'title' => esc_html__( 'Instagram', 'artistas' ), 'value' => '' ), 'linkedin' => array( 'type' => 'text', 'title' => esc_html__( 'Linkedin', 'artistas' ), 'value' => '' ), 'mail' => array( 'type' => 'text', 'title' => esc_html__( 'Mail', 'artistas' ), 'value' => '' ), 'pinterest' => array( 'type' => 'text', 'title' => esc_html__( 'Pinterest', 'artistas' ), 'value' => '' ), 'skype' => array( 'type' => 'text', 'title' => esc_html__( 'Skype', 'artistas' ), 'value' => '' ), 'tumblr' => array( 'type' => 'text', 'title' => esc_html__( 'Tumblr', 'artistas' ), 'value' => '' ), 'twitter' => array( 'type' => 'text', 'title' => esc_html__( 'Twitter', 'artistas' ), 'value' => 'http://twitter.com/' ), 'vimeo' => array( 'type' => 'text', 'title' => esc_html__( 'Vimeo', 'artistas' ), 'value' => '' ), 'yahoo' => array( 'type' => 'text', 'title' => esc_html__( 'Yahoo', 'artistas' ), 'value' => '' ) ); } public function __construct () { $this->artistas_custom = $this->artistas_default_settings(); add_action( 'show_user_profile', array( $this, 'artistas_add_field' ) ); add_action( 'edit_user_profile', array( $this, 'artistas_add_field' ) ); add_action( 'personal_options_update', array( $this, 'artistas_save' ) ); add_action( 'edit_user_profile_update', array( $this, 'artistas_save' ) ); } public function artistas_get_data ( $user ) { $user_id = $user->ID; $user_meta = get_user_meta( $user_id, 'artistas_user_meta', true ); if ( empty( $user_meta ) ) { $user_meta = array(); foreach ( $this->artistas_custom as $key => $item ) { $user_meta[ $key ] = $item['value']; } update_user_meta( $user_id, 'artistas_user_meta', $user_meta ); } } public function artistas_add_field ( $user ) { $this->artistas_get_data( $user ); $user_meta = get_user_meta( $user->ID, 'artistas_user_meta', true ); ?>

artistas_custom as $key => $settings ) : $function = 'artistas_render_' . $settings['type']; call_user_func( array( $this, $function ), $key, $settings, $user_meta[ $key ] ); endforeach; ?>

  • <?php esc_attr( $settings['title'] ); ?>