-
-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update class-acf-to-rest-api-acf-api.php #247
base: master
Are you sure you want to change the base?
Conversation
Hello @jacktator, |
@@ -130,8 +132,17 @@ public function get_field_objects( $id ) { | |||
$fields_tmp = array(); | |||
|
|||
if ( function_exists( 'acf_get_field_groups' ) && function_exists( 'acf_get_fields' ) && function_exists( 'acf_extract_var' ) ) { | |||
$field_groups = acf_get_field_groups( array( 'post_id' => $id ) ); | |||
|
|||
if ( strpos( $id, 'user_' ) !== false ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This condition never will match because of it:
https://github.com/airesvsg/acf-to-rest-api/pull/247/files#diff-2b1f470cce5f57d891c442678d8a5f6fR64
@@ -61,7 +61,9 @@ public function get_id( $object ) { | |||
$this->id = $object->term_id; | |||
} | |||
} | |||
|
|||
if(is_string($this->id)){ | |||
$this->id = preg_replace("/[^0-9,.]/", "", $this->id ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why dot and comma?
Hi @airesvsg and @jacktator, thanks for working on this. Much appreciated if this could be merged so updating Users works fluidly. (@jacktator - perhaps you didn't see @airesvsg's comments?) Thanks |
@airesvsg Hi. Sorry for the super late reply. As suggested in original comment, I merely applied the fix suggested by @ghost . I'm not sure how or why it worked, but it did. I just bumped into the same issue again in another project, and applied this fix again, and it's still working. So it would be much appreciated if you could have a look at the original issues and the fix suggested. Thank you. |
Hi, this fix doesn't work anymore for me using latest version for ACF Pro (5.7). It seems that the
with
line of 136 of your pull request Best regards |
This fix works for me, will this get merged someday? Also this line: if(is_string($this->id)) should become: if ( is_string( $this->id) && $this->id !== 'options') |
Oh my goodness, what a godsend! I applied @ghost's update and it wasn't working (even though all of the old Issues state that it will). @qduborper update was EXACTLY what was necessary - I cannot thank you enough. @airesvsg Please please please merge this PR, without it the plugin is completely ineffective at updating User ACF data. |
Thank you for the fix. This was driving me crazy. Is there any plan to add this fix to next updates ? |
Applied Fix from #141
Fixed #241 #129