Forum Replies Created

  • Actually var_dump did a job for me within my function, and in my case revealed that plugin_dir_url( __FILE__ ) was providing a url ending with / so my constructed path of:

    plugin_dir_url( __FILE__ ) . ‘/acf-json’

    (which similar to yours above skrabbel features a / in the final part) was producing an erroneous // in the URL.

    ….frustratingly though this hasn’t resolved my issue (which has similar symptoms to the above – filtering load_json within a plugin failing to then implement the field (group) ), and the above prioritizing doesn’t either.

  • I’ve used the following workaround (in this specific example I was forming it for use echoed as inline CSS):

    – 2 fields, one the colour picker and the other for a number for opacity (0 to 1 in 0.1 increments)

    – In PHP convert the hex colour value to an RGB and then tack the opacity value on the end, like so:

    list($r, $g, $b) = sscanf($colour_field_value, "#%02x%02x%02x");
    $rgba_colour = 'rgba(' . $r . ',' . $g . ',' . $b . ',' . $opacity_field_value .')';
Viewing 2 posts - 1 through 2 (of 2 total)