Making WordPress.org


Ignore:
Timestamp:
08/07/2017 06:54:18 PM (9 years ago)
Author:
danielbachhuber
Message:

devhub/cli: Transform emdash back to triple-dash

See ​https://github.com/wp-cli/wp-cli/issues/4270

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/cli.php

    r5475 r5761  
    1414                add_action( 'devhub_cli_manifest_import', array( __CLASS__, 'action_devhub_cli_manifest_import' ) );
    1515                add_action( 'devhub_cli_markdown_import', array( __CLASS__, 'action_devhub_cli_markdown_import' ) );
     16                add_filter( 'the_content', array( __CLASS__, 'filter_the_content' ) );
    1617        }
    1718
    … …  
    256257        }
    257258
     259        /**
     260         * Filter the content of command pages
     261         */
     262        public static function filter_the_content( $content ) {
     263                if ( 'command' !== get_post_type() ) {
     264                        return $content;
     265                }
     266                // Transform emdash back to triple-dashes
     267                $content = str_replace( '-–', '---', $content );
     268                return $content;
     269        }
     270
    258271}
    259272
Note: See TracChangeset for help on using the changeset viewer.