My plugin is now live here: http://ww.wp.xz.cn/plugins/publish-view/
However I’m not currently checking for the existence of a view page. I just added an if statement so that ACF worked. This is my code:
function publish_view_submitbox_start(){
global $post;
global $wp_version;
if($post->post_type != 'acf') {
if($post->post_status == 'auto-draft' || $post->post_status == 'draft') {
submit_button('','primary','publish',false, array('onclick'=>"jQuery(this).after('<input type=\"hidden\" name=\"publishview\" value=\"Y\" />')",'title'=>'Publish & View','id'=>'publishview'));
} else if($post->post_status == 'publish') {
submit_button('','primary','publish',false, array('onclick'=>"jQuery(this).after('<input type=\"hidden\" name=\"publishview\" value=\"Y\" />')",'title'=>'Update & View','id'=>'publishview'));
}
}
}
Note the ACF if statement. I would like to avoid being so specific and detect if I should output anything. Any help would be appreciated!