Home › Forums › General Issues › post_id is not defined › Reply To: post_id is not defined
Thank you John.
One thing I’ve noticed is that the following embedded php code in relationship.php doesn’t seem to execute/parse:
$this->l10n = array(
'max' => __("Maximum values reached ( {max} values )",'acf'),
'tmpl_li' => '
<li>
<a href="#" data-post_id="<%= post_id %>"><%= title %><span class="acf-button-remove"></span></a>
<input type="hidden" name="<%= name %>[]" value="<%= post_id %>" />
</li>
'
);
The result when run and viewed (via the chrome console) the result is the following, which still has the literal variables, not the values I would expect:
// new vars
acf.o = {"post_id":425,"nonce":"25e1faa643","admin_url":"http:\/\/stage.media.foodlandontario.ca\/wp-admin\/","ajaxurl":"http:\/\/stage.media.foodlandontario.ca\/wp-admin\/admin-ajax.php","wp_version":"4.8.1"};
acf.l10n = {"core":{"expand_details":"Expand Details","collapse_details":"Collapse Details"},"validation":{"error":"Validation Failed. One or more fields below are required."},"image":{"select":"Select Image","edit":"Edit Image","update":"Update Image","uploadedTo":"uploaded to this post"},"file":{"select":"Select File","edit":"Edit File","update":"Update File","uploadedTo":"uploaded to this post"},"relationship":{"max":"Maximum values reached ( {max} values )","tmpl_li":"\n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t<a href=\"#\" data-post_id=\"<%= post_id %>\"><%= title %><span class=\"acf-button-remove\"><\/span><\/a>\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"<%= name %>[]\" value=\"<%= post_id %>\" \/>\n\t\t\t\t\t\t\t<\/li>\n\t\t\t\t\t\t\t"},"google_map":{"locating":"Locating","browser_support":"Sorry, this browser does not support geolocation"},"date_picker":{"closeText":"Done","currentText":"Today","monthNames":["January","February","March","April","May","June","July","August","September","October","November","December"],"monthNamesShort":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"monthStatus":"Show a different month","dayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"dayNamesShort":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"dayNamesMin":["S","M","T","W","T","F","S"],"isRTL":false}};
acf.fields.wysiwyg.toolbars = {"full":{"theme_advanced_buttons1":"bold,italic,strikethrough,bullist,numlist,blockquote,hr,alignleft,aligncenter,alignright,link,unlink,wp_more,spellchecker,fullscreen,wp_adv","theme_advanced_buttons2":"formatselect,underline,alignjustify,forecolor,pastetext,removeformat,charmap,outdent,indent,undo,redo,wp_help,code","theme_advanced_buttons3":"","theme_advanced_buttons4":""},"basic":{"theme_advanced_buttons1":"bold,italic,underline,blockquote,strikethrough,bullist,numlist,alignleft,aligncenter,alignright,undo,redo,link,unlink,fullscreen"}};
Thoughts?
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.