beapi / bea-beautiful-flexible Goto Github PK
View Code? Open in Web Editor NEWTransform ACF's flexible layouts list into a nice and UX popup.
Home Page: https://wordpress.org/plugins/bea-beautiful-flexible
License: Other
Transform ACF's flexible layouts list into a nice and UX popup.
Home Page: https://wordpress.org/plugins/bea-beautiful-flexible
License: Other
First of all: Great work!
But the images for the popup are not found if the Flexible field is in a Repeater field.
I found a solution for an existing scenario on my site, but I don't know if this is the correct way for all. I changed the foreach ( $fields as $field )
loop in the retrieve_flexible_keys
function to this:
foreach ( $fields as $field ) {
if ( 'repeater' === $field['type'] ) {
foreach ($field['sub_fields'] as $repeaterfield) {
if ( 'flexible_content' === $repeaterfield['type'] ) {
foreach ( $repeaterfield['layouts'] as $layout_field ) {
$keys[ $layout_field['key'] ] = $layout_field['name'];
}
}
}
} else if ( 'flexible_content' === $field['type'] ) {
// Flexible is recursive structure with sub_fields into layouts
foreach ( $field['layouts'] as $layout_field ) {
if ( $keys [ $layout_field ] ) {
continue;
}
$keys[ $layout_field['key'] ] = $layout_field['name'];
}
}
}
Hope, this helps for further development.
Thomas
Nothing
Hi there !
You declare the same constant BEA_ACF_OPTIONS_MAIN_FILE_DIR on your 2 projects : ACF Options for Polylang and BEA Beautiful Flexible.
=^.^=
It would be great if not only png files would be allowed. Considering the context, it's very likely that jpg is a better candidate to get more compressed files. Gif could also be useful if some field requires a tiny screencast showing something.
Let me know if I can help, I can submit a PR about this.
Hello, how are you?
I would like to know if it is possible to put another way for the plugin get the images.
Currently he get the images at:
my-theme \ assets \ bea-beautiful-flexible \
I would like to leave it like this:
my-theme \ assets \ img \ bea-beautiful-flexible \
or a custom name for the folder
my-theme \ assets \ img \ blocks \
Thank you for your attention. 🙂
I am developing a theme and including ACF directly in the theme via composer. I added this plugin to the same composer file but cannot activate the plugin because ACF is not being loaded in the list of plugins but rather as part of my theme. Would be nice to be able to filter where ACF is located in my theme, like this:
/**
* Customize ACF path
*/
add_filter('acf/settings/path', function ( $path ) {
$path = get_stylesheet_directory() . '/../vendor/advanced-custom-fields/advanced-custom-fields-pro/';
return $path;
});
/**
* Customize ACF dir
*/
add_filter('acf/settings/dir', function ( $dir ) {
$dir = get_stylesheet_directory_uri() . '/../vendor/advanced-custom-fields/advanced-custom-fields-pro/';
return $dir;
});
I get a warning here: https://github.com/BeAPI/bea-beautiful-flexible/blob/master/classes/main.php#L68
$layout_field
is an array and can't be used as an array key. I didn't submit a PR because I didn't dig further and don't know what this condition is here to prevent. Did you mean by chance:
if ( $keys [ $layout_field['key'] ] ) {
continue;
}
?
Let me know if you need more informations.
No notice or warning.
Illegal offset type in /path/to/plugins/bea-beautiful-flexible/classes/main.php on line 69
JS is good but not launching at time :(
Images should be visible in the modal
Images are not visible (all other plugins functions seems to work properly)
NB : Tested as well the flexible content outside of Gutenberg, it worked properly.
There seems to be 3 "$" instead of a "jQuery" in bea-beautiful-flexible-57.min.js
Replacing the $ with jQuery works to fix this.
jQuery(document).ready(function(t){var a=acf.getField("acf-field-flexible-content");a._open=function(n){var e=t(this.$el.children(".tmpl-popup").html());return 1==e.find("a").length?(a.add(e.find("a").attr("data-layout")),!1):a.apply(this,arguments)}}),jQuery("body").on("click",'a[data-name="add-layout"]',function(){setTimeout(function(){$(".acf-fc-popup a").each(function(){var t="<div>"+$(this).text()+"</div>";$(this).html(t)})},0)});
becomes
jQuery(document).ready(function(t){var a=acf.getField("acf-field-flexible-content");a._open=function(n){var e=t(this.$el.children(".tmpl-popup").html());return 1==e.find("a").length?(a.add(e.find("a").attr("data-layout")),!1):a.apply(this,arguments)}}),jQuery("body").on("click",'a[data-name="add-layout"]',function(){setTimeout(function(){jQuery(".acf-fc-popup a").each(function(){var t="<div>"+jQuery(this).text()+"</div>";jQuery(this).html(t)})},0)});
As for now labels are loaded from css before/after there is no possibility to i18n. Maybe do the same with JS which could be i18n.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.