I have had issue with DIV Builder, the newest version, and this plugin. What was happening is that with more complex challenges I was getting JS error and when trying to Update the post or page it would attempt to open the Preview view in a new tab.
Very frustrating.
So, to overcome this, I created custom functions to do the work in the child theme functions.php file. For example, I am using WPFORO as a discussion board and have a section at the top of the main forums page that will give “hints” as to what to do next when a user is not logged in.
Here’s the function:
function is_okay_to_show_login_hint()
{
$url = wpforo_get_request_uri();
return !is_user_logged_in() && ($_GET['wpforo'] != 'signin' && $_GET['wpforo'] != 'signup') && !strpos($url, 'public-discussions');
}
Now, instead of doing a complex challenge within the “Visibility” part of DIVI, I simply add a call to my custom function.
is_okay_to_show_login_hint()
This method works well and while it may require that you create multiple purpose built functions, it seems to be the most reliable.
Note:
The real problem is that the script (content-visibility-for-divi-builder.php) is not effectively decoding the characters in the string $atts[‘cvdb_content_visibility_check’]. So when you have left/right brackets they fail the eval. To tackle this, I added my own set of decodes in content-visibility-for-divi-builder.php in the add_filter bit starting at line #352.
// List of circumstances
$ar_encoded_vals = array(
'%22',
'%5D',
'%91',
'%93'
);
// List of solutions
$ar_decoded_vals = array(
'"',
']',
'[',
']'
);
// Do the solutions for the circumstances
$fixed_cvdb_content_visibility_check = str_replace($ar_encoded_vals, $ar_decoded_vals, $atts['cvdb_content_visibility_check']);
// eval and cross your fingers.
eval('$visibility = ' . $fixed_cvdb_content_visibility_check . ';');
I will, however, continue to use custom functions. It is update proof.
-
This reply was modified 5 years, 8 months ago by moongear.
-
This reply was modified 5 years, 8 months ago by moongear.
-
This reply was modified 5 years, 8 months ago by moongear.