Skip to content

Tag: wordpress

Any hook in WordPress that runs after session is started?

I need to set a session value in my plugin, but session isn’t started when WordPress loads my plugin and I don’t want to run if (!session_id()) session_start(); manually, because other plugins might rely on setting cookies, etc and face a “headers already sent error”. Is there any hook…

Query database for last modified date

I am trying to query my WordPress server to echo the date of the last modified post. In this case the database name is local and I am checking the posts table. My current code is close to what I need, it will display the date and time as Y-m-d H:i (2021-01-13 12:18) How do remove the time and display