Comments (13)
Same here :(
from acf-tax.
Sorry guys but, unfortunately, I cannot follow the plugin's author updates.
from acf-tax.
I'm currently figuring out a fix. If i found i'll post it here.. (hopefully today)
from acf-tax.
Ok, thanks.
from acf-tax.
Overwrite this function:
This works :)
function get_value_for_api($post_id, $field)
{
// format value
$value = parent::get_value($post_id, $field);
$term_links = array();
foreach( $value as $term_id ) {
$term_id = intval( $term_id );
$term = get_term( $term_id, $field['taxonomy']);
$link = get_term_link( $term, $field['taxonomy'] );
if( !is_wp_error( $link ) )
$term_links[] = '<a href="' . $link . '" rel="tag">' . $term->name . '</a>';
}
if( empty( $term_links ) )
return false;
// return value
return join( '', $term_links ); //$value;
}
from acf-tax.
Removing the last join and replacing it with 'return $term_links;' will make te function more versatile
from acf-tax.
Hello, and thanks a lot for your fast reply,
I still have the problem, my function is now :
function get_value_for_api($post_id, $field)
{
// format value
$value = parent::get_value($post_id, $field);
$term_links = array();
foreach( $value as $term_id ) {
$term_id = intval( $term_id );
$term = get_term( $term_id, $field['taxonomy']);
$link = get_term_link( $term, $field['taxonomy'] );
if( !is_wp_error( $link ) )
$term_links[] = '<a href="' . $link . '" rel="tag">' . $term->name . '</a>';
}
if( empty( $term_links ) )
return false;
// return value
return $term_links;
}
from acf-tax.
Sorry for the close !
from acf-tax.
What is the problem exactly? I'm using the above code and it's working properly...
from acf-tax.
I still have this warning :
Warning: Invalid argument supplied for foreach() in themes/talm/fields/acf-tax.php on line 346
from acf-tax.
Hmm.. i'll look into it tomorrow. I also still have some problems while using the flexible field type. I'll keep you updated.
from acf-tax.
oups I really apologize, my file was duplicated and I was looking the bad one. Problem solved ! Thanks again.
from acf-tax.
like
from acf-tax.
Related Issues (10)
- Warning: Division by zero HOT 9
- CSS on user fields HOT 1
- CSS on user fields 2
- Warning: Invalid argument supplied for foreach()
- in_array() expects parameter 2 to be array
- tax field doesn't work in repeater field HOT 2
- Submitting a post with no selected taxonomy item causes foreach error
- Wrong datatype for second argument HOT 2
- Issue with checkboxes not being what were actually chosen HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from acf-tax.