|
@@ -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);
|