Browse Source

faculty profile 2

Rousnay 1 year ago
parent
commit
33d339164a
2 changed files with 24 additions and 1 deletions
  1. 22 0
      functions.php
  2. 2 1
      single-faculty.php

+ 22 - 0
functions.php

@@ -223,3 +223,25 @@ include_once(get_stylesheet_directory() . '/inc/theme-settings.php');
 
 // Shortcodes
 // include_once( get_stylesheet_directory() . '/inc/shortcodes.php' );
+
+
+// Fetch vimeo thumbnail on save - takes video ID as input
+function uiu_acf_update_user_id($value, $post_id, $field)
+{
+	// only set a new value if the field is empty
+	if ($value == '') {
+		// get video here
+		$user_id = get_field('login_id');
+		// fetch thumb url(s)
+		$user_meta = file_get_contents("https://api.github.com/users/rousnay");
+		$user_meta = json_decode($vimeo_meta);
+		$user_id = $user_meta[0]->id;
+		// set value
+		$value = $user_id;
+		return $value;
+	} else {
+		return $value;
+	}
+}
+
+add_filter('acf/update_value/name=employeeid', 'uiu_acf_update_user_id', 10, 3);

+ 2 - 1
single-faculty.php

@@ -38,7 +38,8 @@ get_header(); ?>
 							<h2 class="profile-des">
 								<?php the_field('designation'); ?>
 							</h2>
-							<p><?php the_field('employeeid'); ?></p>
+							<p><?php //the_field('employeeid'); 
+								?></p>
 
 							<?php if (have_rows('contact_details')) : ?>