Parse error: syntax error, unexpected ‘,’

You’ve got unbalanced and improperly placed closing parenthesis. There shouldn’t be the closing parenthesis after the ‘stylesheet’. Because the closing parenthesis is there, the PHP processor thought that was the end of the function’s parameters. Which caused the comma character after that to cause the error. Watch the balancing of your parenthesis (and quotes) as … Read more

How to get posts by category at /%category%/ url?

Is the archive.php correct template for that? archive.php is the most common file to load any kind of archive posts. But anytime the user loads a category archive page, WordPress template system looks for files in this order: category-slug.php → category-id.php → category.php → archive.php → index.php If you want to create a specific template … Read more

How to automatically redirect to custom admin menu after plugin activation?

You can use register_activation_hook(). Add this to your plugin, tested and works. register_activation_hook(__FILE__, ‘redirect_after_activation’); function redirect_after_activation() { add_option(‘redirect_after_activation_option’, true); } add_action(‘admin_init’, ‘activation_redirect’); function activation_redirect() { if (get_option(‘redirect_after_activation_option’, false)) { delete_option(‘redirect_after_activation_option’); exit(wp_redirect(admin_url( ‘wp-admin/admin.php?page=axl_ads’ ))); } }

Why WordPress not using JSON_UNESCAPED_UNICODE by default?

Because until relatively recently WordPress supported PHP 5.2+, but that constant was only added in PHP 5.4. Given that wp_json_encode is meant to encapsulate and account for the differing behaviour of json_encode across multiple PHP versions, it doesn’t make sense to deliberatly change its behaviour for PHP 5.4+ Now that WordPress has raised its minimum … Read more