WPIntell

Source evidence

ACF Pro Conflict

Qi Blocks · support · 2023-03-02T12:01:00+00:00

mixedsentiment
mediumseverity
0.85relevance
7replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

6 / 35 rows with source links

17.1% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

29 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
fabeluna resolved
There is some issue with the ACF Pro Plugin. If I create a new Block Template with ACF Pro, some of the output will fire multiple times. For example: If I’m using an add_action hook, this hook fires 25 times. This occures only if Qui Blocks plugin is activated, too. Could you have a look at this? Thanks, Leni Hi there, Thanks for writing in! Could you please tell us which hook you are using exactly as well as provide us a video or a screenshot of the issue so we can try to reproduce this on our side as well. So as much information possible would be helpful. Thank you Best, Qode Hello, thank you very much for the reply, I’m using the wp_head hook. See Screenshots: https://drive.filen.io/f/f35d4f77-38e2-4f1e-9976-a3deafb0ff02#ZKQ0CPCpSP0kub1ohqLldjyRnxrPhcm9 ). Thanks, Leni Thank you for providing us with the info. Our dev team managed to reproduce this on our local installation and the fix should be included in the next update. Best, Qode Hello, thank you very much for the Update. It’s much better now, but the hook is still firing twice. Could you check it again? Thanks, Leni Hi, Due to the way functions are set up, if the wp_head hook is used, it will fire twice. Best, Qode Hello, thank you for the answer. If the Qi Blocks Plugin is deactivated, is fires ones, if it is activated, it fires twice.. Hi, This occurs due to the default WordPress function we use to get the whole HTML content of the page to check if the there are Qi Blocks on the page. This is done for performance reasons, this function checks if there are Qi Blocks on the page and then loads scripts only if there are any. This default WordPress function calls for wp_head hook and this is why it is being called twice, first initially and the second time by our function. We are still investigating on how to get this to be called just once, however, for now it will be called twice. In your case you can use the code below: $cssContent = ‘*{color: red;}’; add_action( ‘wp_enqueue_scripts’, function () use ( $cssContent ) { wp_add_inline_style( ‘global-styles’, $cssContent ); } ); This should resolve it in your case. Best, Qode

Comments

7 shown
Qode 2023-03-03T09:44:00+00:00

Hi there, Thanks for writing in! Could you please tell us which hook you are using exactly as well as provide us a video or a screenshot of the issue so we can try to reproduce this on our side as well. So as much information possible would be helpful. Thank you Best, Qode

fabeluna 2023-03-03T13:00:00+00:00

Hello, thank you very much for the reply, I’m using the wp_head hook. See Screenshots: https://drive.filen.io/f/f35d4f77-38e2-4f1e-9976-a3deafb0ff02#ZKQ0CPCpSP0kub1ohqLldjyRnxrPhcm9 ). Thanks, Leni

Qode 2023-03-07T14:40:00+00:00

Thank you for providing us with the info. Our dev team managed to reproduce this on our local installation and the fix should be included in the next update. Best, Qode

fabeluna 2023-03-11T16:38:00+00:00

Hello, thank you very much for the Update. It’s much better now, but the hook is still firing twice. Could you check it again? Thanks, Leni

Qode 2023-03-14T12:58:00+00:00

Hi, Due to the way functions are set up, if the wp_head hook is used, it will fire twice. Best, Qode

fabeluna 2023-03-14T13:25:00+00:00

Hello, thank you for the answer. If the Qi Blocks Plugin is deactivated, is fires ones, if it is activated, it fires twice..

Qode 2023-03-16T15:36:00+00:00

Hi, This occurs due to the default WordPress function we use to get the whole HTML content of the page to check if the there are Qi Blocks on the page. This is done for performance reasons, this function checks if there are Qi Blocks on the page and then loads scripts only if there are any. This default WordPress function calls for wp_head hook and this is why it is being called twice, first initially and the second time by our function. We are still investigating on how to get this to be called just once, however, for now it will be called twice. In your case you can use the code below: $cssContent = ‘*{color: red;}’; add_action( ‘wp_enqueue_scripts’, function () use ( $cssContent ) { wp_add_inline_style( ‘global-styles’, $cssContent ); } ); This should resolve it in your case. Best, Qode