I am trying to: use a currency formatting function that crashes when a zero or 0 is encountered in the price field. I was able to do a conditional output that would not load anything less the a dollar and in the past it worked ok. While testing a mirrored test site with the later php 8** the conditional output button does not function like no link there and when I copy from old code the conditional output code in the view it breaks the system since it isn't working and loads the $0 Zero.
Link to a page where the issue can be seen: hidden link
I expected to see:
When I click the Conditional Output Button it should open the boxes to insert the shortcode
Instead, I got:
NOTHING.
The main problem is the "Conditional Output" button does nothing, it is a dead button.
When you click on it, it is supposed to open the pop up menu to create the code.
there are several steps after that that may also have issues, don't know yet till the button actually works. In the older version of PHP 7.4 it worked fine.
PS, I HAVE DELETED ALL OTHER PLUGINS TO VERIFY NO CONFLICTS THERE. I believe it is a conflict/bug between the VIEW plugin and PHP 8.1
I believe that the problem is with the PHP 8.1 conflict with the button somehow. I will check back tomorrow for possible answers.
Thanks, tony
PS The reason I must have this Conditional is the Currency function crashes when the price is null or 0. I used the Conditional to avoid that issue by returning only with numbers greater than 1. Worked great for a long time. I may be able to still use the function if I create a filter in the VIEW itself instead of the code. Any way thanks for the help.
I checked the "Conditional ooutput" button on the following view with all sections like "Output Editor", "Loop Editor" and "Search and Pagination":
- hidden link
For me its working without any issues. Please check the following video:
- hidden link
Did you try the "Templates For This View" which is the section I use to show the output. Since that is where all the individual formatting is for the individual post. I guess I could do it in the other sections you named. But still why does it not work in the Templates section too. I was able to use the Conditional Button in the other sections like you did, just not in the Templates section where I was using it for years.
Ok, I can use the button in the "Edit Content Template" page
Now to the real problem this is all about. The Condition to not display non Zero, Null, or O is working. but it no longer allows the function to display currency formatting no longer works even with the exception; Following is the code and where it is located:
=============================================================
/* ADD YOUR CUSTOM FUNCTIONS BELOW */
/* On 12/14/2017 I added this for the money formating $0,000.00 */
function format_money( $atts ) {
extract( shortcode_atts( array(
'price' => '0'), $atts) );
return $price = number_format($price, 2);
}
add_shortcode('format_money', 'format_money');
==============================================================
This is located in the Child-Theme Sydney Functions.php file.