Making WordPress.org


Ignore:
Timestamp:
01/25/2017 02:36:41 PM (10 years ago)
Author:
danielbachhuber
Message:

make/cli: Append a "Edit on GitHub" link to Handbook document titles

Also removes padding from pre code that's no longer necessary

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-cli/wporg-cli.php

    r4754 r4782  
    1818add_action( 'edit_form_after_title', array( 'WPOrg_Cli\Markdown_Import', 'action_edit_form_after_title' ) );
    1919add_action( 'save_post', array( 'WPOrg_Cli\Markdown_Import', 'action_save_post' ) );
    20 
     20add_filter( 'the_title', array( 'WPOrg_Cli\Handbook', 'filter_the_title_edit_link' ) );
    2121add_filter( 'get_edit_post_link', array( 'WPOrg_Cli\Handbook', 'redirect_edit_link_to_github' ), 10, 3 );
    2222add_filter( 'o2_filter_post_actions', array( 'WPOrg_Cli\Handbook', 'redirect_o2_edit_link_to_github' ), 11, 2 );
     
    2626        <style>
    2727                pre code {
    28                         padding: 0;
    2928                        line-height: 16px;
     29                }
     30                a.github-edit {
     31                        margin-left: .5em;
     32                        font-size: .5em;
     33                        vertical-align: top;
     34                        display: inline-block;
     35                        border: 1px solid #eeeeee;
     36                        border-radius: 2px;
     37                        background: #eeeeee;
     38                        padding: .5em .6em .4em;
     39                        color: black;
     40                        margin-top: 0.1em;
     41                }
     42                a.github-edit > * {
     43                        opacity: 0.6;
     44                }
     45                a.github-edit:hover > * {
     46                        opacity: 1;
     47                        color: black;
     48                }
     49                a.github-edit img {
     50                        height: .8em;
    3051                }
    3152        </style>
Note: See TracChangeset for help on using the changeset viewer.