Skip to content

Commit 29650e7

Browse files
committed
REST API: Add export rel link for active theme response
1 parent d3c1b8b commit 29650e7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,15 @@ protected function prepare_links( $theme ) {
414414
);
415415
}
416416

417+
if ( $theme->is_block_theme() && $this->is_same_theme( $theme, wp_get_theme() ) ) {
418+
$links['https://api.w.org/export-theme'] = array(
419+
'href' => rest_url( 'wp-block-editor/v1/export' ),
420+
'targetHints' => array(
421+
'allow' => current_user_can( 'export' ) ? array( 'GET' ) : array(),
422+
),
423+
);
424+
}
425+
417426
return $links;
418427
}
419428

0 commit comments

Comments
 (0)