Limited Support
Our team is currently on holiday, so support will be limited during this period. Response times may be slower than usual, and some inquiries may be delayed.
We appreciate your patience and understanding, and we’ll resume our usual support by the end of August.
I want to write in a message for forum guests: "XXX users are registered. Become XXX+1". Number of users, I want to call php function. How can I add a php script to the field on the screen?
you can use this code
add_action( 'wp_head', function () { ?> <script> $(document).ready(function() { $('#wpforo #wpforo-wrap .wpforo-admin-note').prepend($('<div class="usercount"> <?php $stat = WPF()->statistic(); ?> <?php echo $stat['members']; ?> users are registered. Become <?php echo $stat['members']; ?> + 1</div>')); }); </script> <?php } );
either via the Code Snippets plugin
or in the functions.php of your WP theme
you also have to add text to the admin note, to make it active
I don't know where the problem is on your side
for me the code works without any problem
use the plugin if it doesn't work for you via functions.php
you asked for a way to add php to the admin note
the php code above is just an example, you can use your own