Cron Job not working

The default supported recurrences are ‘hourly’, ‘twicedaily’, ‘daily’, and ‘weekly’. From the WordPress definition https://developer.wordpress.org/reference/functions/wp_get_schedules/ If you’re using wp_schedule_event(time(), ‘every_minute’, ‘recurring_event’);, you may need to change the recurrence parameter to one of the correct options mentioned above. Refer to the documentation for guidance. To check and trigger your Cron function, you can use a plugin … Read more

Call to undefined function create_function() – PHP 8.2

You are going to want to edit this line: add_action( ‘plugins_loaded’, create_function( ”, ‘global $BBCode; $BBCode = new BBCode();’ ) ); You will want to make yourself an actual function. Probably something like this: function my_hacked_function(){ global $BBCode; $BBCode = new BBCode(); } add_action( ‘plugins_loaded’, ‘my_hacked_function’); I’ve not tested this. However, this is the general … Read more

How to secure custom endpoint for rest api in WordPress

Add permission_callback parameter and set it to whatever authentication you want to apply. So, if you want to make it accessible to a user having manage_options capability, your code should be something like this- add_action(‘rest_api_init’, function(){ register_rest_route(‘fs/v1’, ‘posts’, [ ‘methods’ => ‘GET’, ‘callback’ => ‘fs_posts’, ‘permission_callback’ => function( $request ) { return current_user_can( ‘manage_options’ ); … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)