@@ -48,7 +48,7 @@ public static function enqueue_styles() {
4848 public static function maybe_enqueue_admin_and_editor_app_scripts () {
4949
5050 global $ pagenow ;
51- $ post_types = get_option ( ' edac_post_types ' );
51+ $ post_types = Settings:: get_scannable_post_types ( );
5252 $ current_post_type = get_post_type ();
5353 $ page = self ::get_current_page_slug ();
5454 $ enabled_pages = apply_filters (
@@ -82,18 +82,18 @@ public static function maybe_enqueue_admin_and_editor_app_scripts() {
8282 'edac ' ,
8383 'edac_script_vars ' ,
8484 [
85- 'postID ' => $ post_id ,
86- 'nonce ' => wp_create_nonce ( 'ajax-nonce ' ),
87- 'edacApiUrl ' => esc_url_raw ( rest_url () . 'accessibility-checker/v1 ' ),
88- 'restNonce ' => wp_create_nonce ( 'wp_rest ' ),
89- 'fixesProUrl ' => esc_url_raw ( edac_generate_link_type ( [ 'utm-content ' , ' __fix__ ' ] ) ),
85+ 'postID ' => $ post_id ,
86+ 'nonce ' => wp_create_nonce ( 'ajax-nonce ' ),
87+ 'edacApiUrl ' => esc_url_raw ( rest_url () . 'accessibility-checker/v1 ' ),
88+ 'restNonce ' => wp_create_nonce ( 'wp_rest ' ),
89+ 'proUrl ' => esc_url_raw ( edac_generate_link_type ( [ 'utm-content ' => ' __name__ ' ] ) ),
9090 ]
9191 );
9292
9393 if ( 'post.php ' === $ pagenow || 'post-new.php ' === $ pagenow ) {
9494
9595 // Is this posttype setup to be checked?
96- $ post_types = get_option ( ' edac_post_types ' );
96+ $ post_types = Settings:: get_scannable_post_types ( );
9797 $ current_post_type = get_post_type ();
9898 $ active = ( is_array ( $ post_types ) && in_array ( $ current_post_type , $ post_types , true ) );
9999
@@ -112,9 +112,17 @@ public static function maybe_enqueue_admin_and_editor_app_scripts() {
112112 if ( (int ) get_option ( 'page_on_front ' ) === $ post_id || (int ) get_option ( 'page_for_posts ' ) === $ post_id ) {
113113 $ scan_url = add_query_arg ( 'edac_pageScanner ' , 1 , get_permalink ( $ post_id ) );
114114 } else {
115- $ scan_url = get_preview_post_link (
116- $ post_id ,
117- [ 'edac_pageScanner ' => 1 ]
115+ $ post_view_link = apply_filters (
116+ 'edac_get_origin_url_for_virtual_page ' ,
117+ get_preview_post_link ( $ post_id ),
118+ $ post_id
119+ );
120+
121+ $ scan_url = add_query_arg (
122+ [
123+ 'edac_pageScanner ' => 1 ,
124+ ],
125+ $ post_view_link
118126 );
119127 }
120128
0 commit comments