Indeed I did swap that text (all 4 instances), but worth checking for silly errors!
I tried your other suggestion but it made no difference.
Then I started tinkering. My knowledge on PHP is minimal but I thought I’d just try merging your new code with the existing code on line 532. I changed it from this:
### Function: Add Rating Custom Fields
add_action('publish_post', 'add_ratings_fields');
add_action('publish_page', 'add_ratings_fields');
function add_ratings_fields($post_ID) {
global $wpdb;
if(!wp_is_post_revision($post_ID)) {
add_post_meta($post_ID, 'ratings_users', 0, true);
add_post_meta($post_ID, 'ratings_score', 0, true);
add_post_meta($post_ID, 'ratings_average', 0, true);
}
}
To this:
### Function: Add Rating Custom Fields
add_action('publish_post', 'add_ratings_fields');
add_action('publish_page', 'add_ratings_fields');
add_action('publish_<CUSTOM_POST_TYPE_NAME>', 'add_ratings_fields');
function add_ratings_fields($post_ID) {
global $wpdb;
if(!wp_is_post_revision($post_ID)) {
add_post_meta($post_ID, 'ratings_users', 0, true);
add_post_meta($post_ID, 'ratings_score', 0, true);
add_post_meta($post_ID, 'ratings_average', 0, true);
}
}
And that seemed to do the trick. I just figured the two functions were largely the same, and the way WordPress handles custom post types is mostly the same as posts or pages.
I know you’re unable to test the code Lester, but is there anythign with this change that I should be careful of? As I say it all seems to work, but just in case there’s a specific reason you didn’t attempt something along these lines?
Thanks