@@ -78,6 +78,11 @@ public static function maybe_enqueue_admin_and_editor_app_scripts() {
7878
7979 global $ post ;
8080 $ post_id = is_object ( $ post ) ? $ post ->ID : null ;
81+
82+ // On a latest-posts homepage the global $post is the first blog post, not the page;
83+ // let extensions supply the correct ID (e.g. a Pro virtual-page ID).
84+ $ post_id = apply_filters ( 'edac_filter_admin_post_id ' , $ post_id );
85+
8186 wp_enqueue_script ( 'edac ' , plugin_dir_url ( EDAC_PLUGIN_FILE ) . 'build/admin.bundle.js ' , [ 'jquery ' ], EDAC_VERSION , false );
8287 wp_set_script_translations ( 'edac ' , 'accessibility-checker ' , plugin_dir_path ( EDAC_PLUGIN_FILE ) . 'languages ' );
8388
@@ -99,8 +104,9 @@ public static function maybe_enqueue_admin_and_editor_app_scripts() {
99104
100105 if ( 'post.php ' === $ pagenow || 'post-new.php ' === $ pagenow ) {
101106
102- // Is this posttype setup to be checked?
103- $ active = $ is_scannable_post ;
107+ // Base the scannable check on the filtered $post_id, not the original global $post.
108+ $ filtered_post_type = $ post_id ? get_post_type ( $ post_id ) : false ;
109+ $ active = $ filtered_post_type && is_array ( $ post_types ) && in_array ( $ filtered_post_type , $ post_types , true );
104110
105111 $ pro = defined ( 'EDACP_VERSION ' ) && EDAC_KEY_VALID ;
106112
@@ -113,8 +119,15 @@ public static function maybe_enqueue_admin_and_editor_app_scripts() {
113119 wp_enqueue_script ( 'edac-editor-app ' , plugin_dir_url ( EDAC_PLUGIN_FILE ) . 'build/editorApp.bundle.js ' , false , EDAC_VERSION , false );
114120 wp_set_script_translations ( 'edac-editor-app ' , 'accessibility-checker ' , plugin_dir_path ( EDAC_PLUGIN_FILE ) . 'languages ' );
115121
116- // If this is the frontpage or homepage, preview URLs won't work. Use the live URL.
117- if ( (int ) get_option ( 'page_on_front ' ) === $ post_id || (int ) get_option ( 'page_for_posts ' ) === $ post_id ) {
122+ // Preview URLs don't work for the homepage. On a latest-posts homepage (including the
123+ // show_on_front=page fallback with no static front page) use the live home URL instead.
124+ $ show_on_front = get_option ( 'show_on_front ' , 'posts ' );
125+ $ is_latest_posts_home = ( 'posts ' === $ show_on_front || ( 'page ' === $ show_on_front && ! get_option ( 'page_on_front ' ) ) )
126+ && apply_filters ( 'edac_filter_post_is_latest_posts_home ' , false , $ post_id );
127+
128+ if ( $ is_latest_posts_home ) {
129+ $ scan_url = add_query_arg ( 'edac_pageScanner ' , 1 , trailingslashit ( get_home_url () ) );
130+ } elseif ( (int ) get_option ( 'page_on_front ' ) === $ post_id || (int ) get_option ( 'page_for_posts ' ) === $ post_id ) {
118131 $ scan_url = add_query_arg ( 'edac_pageScanner ' , 1 , get_permalink ( $ post_id ) );
119132 } else {
120133 $ post_view_link = apply_filters (
0 commit comments