Frédéric Santi
Forum Replies Created
-
Forum: Plugins
In reply to: [Advanced Custom Fields (ACF?)] Absence of repeating fieldsHi,
The repeater fields were in the Pro version of ACF unfortunately, what SCF is not.We are waiting for the respository to be open so this way we can work on developing this missing key feature in the free version. I myself want to contribute in this task.
Wait and see.
Forum: Plugins
In reply to: [Advanced Custom Fields (ACF?)] One SCF field causing random pages to breakThis error is occurring because the
esc_url()
function is receiving aWP_Error
object instead of a string. This can happen when there is an issue retrieving a URL, and instead of returning a string, WordPress returns aWP_Error
object to signal a problem.Here’s a potential solution to handle this error in your theme’s
functions.php
file on line 159, where theesc_url()
function is being called:- Check for
WP_Error
: Wrap the URL in a conditional check to ensure that it’s a valid string before passing it toesc_url()
. This avoids passingWP_Error
objects into functions expecting strings.Update line 159 in yourfunctions.php
file to something like this:$url = get_some_url_function(); // Replace with the actual function or variable that gets the URL.
if (!is_wp_error($url)) {
$url = esc_url($url);
} else {
$url = ''; // Or handle the error as needed, like setting a default URL.
}
- Debug the URL Source: Find the function or code returning this URL and verify why it’s returning a
WP_Error
instead of a URL string. This can happen if the URL retrieval logic encounters an error (e.g., the ACF field is missing or misconfigured).
Forum: Plugins
In reply to: [Advanced Custom Fields (ACF?)] Are there shorcodes for SCF?Hi,
Unfortunately not, but you can create your own like that :function display_scf_field($atts) {
$atts = shortcode_atts(array( 'field' => '', 'post_id' => get_the_ID(), ), $atts, 'scf');
if (!empty($atts['field'])) {
$value = get_field($atts['field'], $atts['post_id']);
return $value ? esc_html($value) : '';
}
return '';
}
add_shortcode('scf', 'display_scf_field');
And use the shortcode this way :[scf field="org_address_1"]
- This reply was modified 5 months ago by Frédéric Santi.
- This reply was modified 5 months ago by Frédéric Santi.
Hi,
We are waiting for the respository to be open so this way we can work on developing this missing key feature in the free version. I myself want to contribute in this task.
Wait and see.- This reply was modified 5 months ago by Frédéric Santi.
Forum: Plugins
In reply to: [Advanced Custom Fields (ACF?)] Sync Custom Download Links to PostsHi,
You can do it by using the hook'acf/save_post'
, and when the ACF fields of a post are saved, then you have 2 options :
– Save it also as a post meta :update_post_meta()
– Save it also in the content of the post :wp_update_post()
- This reply was modified 5 months ago by Frédéric Santi.
Forum: Plugins
In reply to: [WooCommerce] Cannot rebind js function after removing cart itemThank you very much for your reply
- Check for