Changeset 9764 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/import-block-editor.php
- Timestamp:
- 04/22/2020 09:22:31 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/import-block-editor.php
r9678 r9764 24 24 add_filter( 'wporg_markdown_before_transform', array( $this, 'wporg_markdown_before_transform' ), 10, 2 ); 25 25 add_filter( 'wporg_markdown_after_transform', array( $this, 'wporg_markdown_after_transform' ), 10, 2 ); 26 add_filter( 'wporg_markdown_edit_link', array( $this, 'wporg_markdown_edit_link' ), 10, 2 ); 26 27 27 28 add_filter( 'syntaxhighlighter_htmlresult', array( $this, 'fix_code_entity_encoding' ) ); … … 290 291 291 292 /** 293 * Modifies the GitHub edit URL to point to master instead of the imported branch. 294 * 295 * @param string $link The link to edit the post on GitHub. 296 * @param int $post_id The post ID. 297 * @return string 298 */ 299 public function wporg_markdown_edit_link( $link, $post_id ) { 300 if ( $this->get_post_type() === get_post_type( $post_id ) ) { 301 $link = str_replace( '/wp/' . WP_CORE_STABLE_BRANCH . '/', '/master/', $link ); 302 } 303 304 return $link; 305 } 306 307 /** 292 308 * Callback for the preg_replace_callback() in wporg_markdown_after_transform() 293 309 * to transform a block of code tabs into HTML.
Note: See TracChangeset
for help on using the changeset viewer.