How can I save the selected page in the dropdown after anyone clicks on Save Changes?

You can do this by using ajax call. Try out the below code for your solution. I have made an example for you. I have added comments for better understanding. Check and let me know if it helps. main plugin file class kb_setup { /** * Construct function */ public function __construct() { /* Use … Read more

How can precision be improved for the debug log timestamp?

WordPress does not manage the format of the timestamp. Instead, WordPress hands off error message contents to the PHP function error_log(), which creates the timestamp. Finding no easy way to ask error_log() for higher resolution timestamp, combined with the fact that I’m creating the message content myself, I’ve added a microsecond string ahead of my … Read more

PHP Fatal error: Uncaught Error: Cannot unset string offsets when trying to upload any file to media library

I have the same issue on only one of the three wordpress sites managed by a multisite wordpress. I am not experienced with WordPress either, but I have managed to get uploads working by replacing if ( empty( $directory_cache ) ) { return; } by if ( empty( $directory_cache ) || !is_array($directory_cache) ) { return; … Read more

is_preview() always return false

is_preview() should return true is it is a preview. Did you try the following on the page.php? if(is_preview()){ echo “preview” }else{ echo “no preview” } to check if the is_preview() function is working? EDIT2: You could work your way around it and check for: if($_GET[‘preview’] == true){}