oneOf two possible objects in WP REST API?

Aight got it, the crucial missing thing was that you have to provide this part here: ‘type’ => ‘object’ twice; once when declaring the variable’s type, and once again when defining the possibilities. Otherwise, validation fails; so a proper example would be: ‘args’ => [ ‘data’ => [ ‘type’ => ‘object’, ‘oneOf’ => [ [ … Read more

Custom plugin not appearing

A few parameters need tweaking in midstory_fade_animation_script_register(): function midstory_fade_animation_script_register() { // Handle, script location, dependecies, version, in footer boolean wp_enqueue_script( ‘midstory-animation-fade-block’, plugin_dir_url( __FILE__ ) . ‘/midstory_animation_fade.js’, array( ‘wp-blocks’, ‘wp-i18n’, ‘wp-editor’ ), ‘1.0.1’, false ); } The script location needs a slash between the plugin folder and the filename. What you were calling “WordPress refresh?” is … Read more

Running one-off cron jobs when WP_DISABLE_CRON is true: can I hit /wp-cron.php?

The WP_DISABLE_CRON constant only removes WP-Cron from loading on the page so it’s no longer triggered by site traffic. You can absolutely hit the wp-cron.php file directly to trigger it. I use https://cron-job.org to ping my private sites at https://dev.example.com/wp-cron.php?doing_wp_cron for example. This is actually recommended in the WordPress handbook: https://developer.wordpress.org/plugins/cron/hooking-wp-cron-into-the-system-task-scheduler/ Editing to add: if … Read more

How can I get a plugin to hook ‘dbdelta_queries’ — a filter used during version update?

Must-use (mu) plugins are loaded during the version update process, unlike ordinary plugins. Explanation here. So it’s possible to hook dbdelta_queries and the related filters from within a mu plugin. (Thanks to Sergey Biryukov for the answer.) But, some plugins use the same dbDelta() function as core update, so it’s possible to get queries for … Read more

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