Every AJAX functionality must have the following:
When to use the REST API:
When to use admin-ajax.php:
The REST API processes faster than admin-ajax.php!
https://deliciousbrains.com/comparing-wordpress-rest-api-performance-admin-ajax-php/
Pay attention when registering custom post types.
'has_archive' => false
Do you need single posts?
'publicly_queryable' => false
Do you need posts in search results?
'exclude_from_search' => true
Do you need an archive page?
Use wp_redirect() for other things
if (is_tag()) {
wp_redirect(home_url(), 301);
exit;
}
Do you need a taxonomy archive?
'public' => false
Removed/disabled in Skeletor:
301 redirect /store homepage if not used
Does the content need specific formatting that's easy to screw up, like numerical data?
setlocale(LC_MONETARY, 'en_US');
echo money_format('%.0n', get_field('price'));
Make pages with many fields more easily digestible and understandable by sectioning out content with tabs.
'supports' => array('title', 'editor') // Remove 'editor' to disable WYSIWYG
Custom post type (register_post_type):
Native posts/pages or third-party post types:
Just take your time when you create ANY field and maximize your field UI. It will help users: