Fatal Error Call To Undefined Function Get_field In Wordpress
Contents |
error: Call to undefined function the_field_return() Tagged:error, function, the_field_return uberspeck November 22, 2013 at 1:37 pm I've inherited a WP project that uses v2.0.5 of ACF. I'm attempting to bring it up fatal error call to undefined function wordpress to date. After updating the plugin I've started to get the following
Fatal Error: Call To Undefined Function Php
error… Fatal error: Call to undefined function the_field_return() Googling for it returns no results and this forum doesn't seem call to undefined function wp_removable_query_args() to return any either. Anyone have any suggestions? I'm new to ACF so I'm starting from scratch… Elliot November 22, 2013 at 5:00 pm Hi @uberspeck the_field_return is not a function
Fatal Error: Call To Undefined Function Wp_removable_query_args() In
known to ACF. Please use get_field instead. Visit the docs to see all available functions. Thanks E uberspeck November 23, 2013 at 2:59 am Hi Elliot, thanks for the quick response! I dug through the archive of the site (before I updated ACF) and I came across the method in api.php. Maybe the previous developer added it? Maybe if I add it wordpress call to undefined function wp_removable_query_args() to functions.php that will take care of it? // the field return function the_field_return($field_name, $post_id = false) { //echo 'field name: '.$field_name.', post id: '.$post_id; $value = get_field($field_name, $post_id); if(is_array($value)) { $value = @implode(', ',$value); } return $value; } Elliot November 24, 2013 at 2:56 pm Hi @uberspeck Yes, this looks like a custom function added to the plugin. I would move this to your theme functions.php file, or just use the standard get_field instead. Thanks E Viewing 4 posts - 1 through 4 (of 4 total) You must be logged in to reply to this topic. Welcome Welcome to the Advanced Custom Fields community forum. Browse through ideas, snippets of code, questions and answers between fellow ACF users Open a new forum thread Forums General Issues Front-end Issues Backend Issues (wp-admin) ACF PRO Add-ons Bug Reports Feature Requests Feedback Helping Others Helping others is a great way to earn karma, gain badges and help ACF development! Help solve topics Stay up to date with ACF news The Advanced custom fields plugin is proudly created and maintained by Elliot Condon Copyright 2016 Elliot Condon
tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about
Wp_convert_hr_to_bytes()
Stack Overflow the company Business Learn more about hiring developers or posting ads
Fatal Error Call To Undefined Function Drupal
with us WordPress Development Questions Tags Users Badges Unanswered Ask Question _ WordPress Development Stack Exchange is a question and answer manually update wordpress site for WordPress developers and administrators. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise https://support.advancedcustomfields.com/forums/topic/fatal-error-call-to-undefined-function-the_field_return/ to the top Fatal error: Call to undefined function get_post() with ajax up vote 0 down vote favorite 1 I have an index.php page with about link, which will get about author content from created page (post) inside WordPress dashboard with name about. I'm using Magnific Popup plugin for poups. I have about.php which includes content of about page like this: http://wordpress.stackexchange.com/questions/182279/fatal-error-call-to-undefined-function-get-post-with-ajax of about page/post $about = get_post($pageid); ?>
post_title; ?>
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack http://stackoverflow.com/questions/23562157/cant-use-get-field Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a https://www.reddit.com/r/Wordpress/comments/2pu1q2/pages_wont_show_displays_this_error/ community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Can't use get_field() up vote 0 down vote favorite I have a working AJAX function call to that sends a variable to a page I made within the template directory. I am using Advanced Custom Fields and execute the get_field($name, $id) function, but I get a 500 server error. I looked in my error log (Apache) and saw that it got an undefined function error. That's strange, because when I use it on front-page.php it actually works. [Fri May 09 11:56:19.336469 2014] [:error] [pid 2235] [client 192.168.1.111:54118] PHP call to undefined Fatal error: Call to undefined function get_field() in /var/www/html/wp-content/themes/Custom Theme/setphoto.php on line 4, referer: 192.168.1.115/ PHP JavaScript $(".a_item").mouseover(function(){ // Krijg url + id van href var href = $(this).attr("href"); var p = href.replace("http://192.168.1.115/?p=", ""); var xhr = new XMLHttpRequest(); xhr.open("GET", "wp-content/themes/HSV Saints/setphoto.php?p="+p, true); xhr.send(); xhr.onload = function(){ console.log(xhr.responseText); } // $("#photo_news_photo").attr("src", img_url); }); How can I enable WordPress to use get_field in an external file within my template directory? ajax wordpress share|improve this question edited Apr 13 at 13:06 Rob 9,58662442 asked May 9 '14 at 10:21 user3510787 44 Can you show your code. –Mr.Happy May 9 '14 at 11:26 1 I have addes my JavaScript code, but that's not the problem. The problem is that Advanced Custom Fields somehow is not enabled on that page or something, it does not recognise the function... –user3510787 May 9 '14 at 12:10 Any idea? I'm like stuck on this –user3510787 May 9 '14 at 14:02 add a comment| active oldest votes Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook. Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign
»WordpresscommentsWant to join? Log in or sign up in seconds.|Englishlimit my search to /r/Wordpressuse the following search parameters to narrow your results:subreddit:subredditfind submissions in "subreddit"author:usernamefind submissions by "username"site:example.comfind submissions from "example.com"url:textsearch for "text" in urlselftext:textsearch for "text" in self post contentsself:yes (or self:no)include (or exclude) self postsnsfw:yes (or nsfw:no)include (or exclude) results marked as NSFWe.g. subreddit:aww site:imgur.com dogsee the search faq for details.advanced search: by author, subreddit...this post was submitted on 19 Dec 20140 points (33% upvoted)shortlink: remember mereset passwordloginSubmit a new linkAsk a question or start a discussion.Wordpresssubscribeunsubscribe32,731 readers~18 users here nowWelcome to r/WordPress The place for news, articles and discussion regarding WordPress. Filter posts by flair: News Discussion Tutorial How to? Plugin Development Theme Development WordPress Core Plugin Request Help