Making WordPress.org

Ticket #1763: #1763.patch

File #1763.patch, 5.7 KB (added by ck3lee, 7 years ago)
  • wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php

    diff --git wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php
    index acde21587..433be929b 100644
    class Plugin_Directory {  
    590590                register_widget( __NAMESPACE__ . '\Widgets\Committers' );
    591591                register_widget( __NAMESPACE__ . '\Widgets\Contributors' );
    592592                register_widget( __NAMESPACE__ . '\Widgets\Support_Reps' );
     593                register_widget( __NAMESPACE__ . '\Widgets\Adopt_Me' );
    593594        }
    594595
    595596        /**
  • new file wordpress.org/public_html/wp-content/plugins/plugin-directory/widgets/class-adopt-me.php

    diff --git wordpress.org/public_html/wp-content/plugins/plugin-directory/widgets/class-adopt-me.php wordpress.org/public_html/wp-content/plugins/plugin-directory/widgets/class-adopt-me.php
    new file mode 100644
    index 000000000..5428cb90f
    - +  
     1<?php
     2namespace WordPressdotorg\Plugin_Directory\Widgets;
     3
     4/**
     5 * A Widget to display adopt plugin link for a plugin.
     6 *
     7 * @package WordPressdotorg\Plugin_Directory\Widgets
     8 */
     9class Adopt_Me extends \WP_Widget {
     10
     11        /**
     12         * Adopt_Me constructor.
     13         */
     14        public function __construct() {
     15                parent::__construct( 'plugin_adopt_me', __( 'Plugin Adopt Me', 'wporg-plugins' ), array(
     16                        'classname'   => 'plugin-adopt-me',
     17                        'description' => __( 'Displays an adopt me panel.', 'wporg-plugins' ),
     18                ) );
     19        }
     20
     21        /**
     22         * Outputs the content of the widget.
     23         *
     24         * @param array $args
     25         * @param array $instance
     26         */
     27        public function widget( $args, $instance ) {
     28                $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Adopt this plugin', 'wporg-plugins' ) : $instance['title'], $instance, $this->id_base );
     29                $is_adopt_me = has_term( 'adopt-me', 'plugin_section' );
     30
     31                if ( $is_adopt_me ) {
     32
     33                        echo $args['before_widget'];
     34                        echo $args['before_title'] . $title . $args['after_title'];
     35                        ?>
     36
     37                        <div>
     38                                <p>
     39                                        <?php _e( 'This plugin is seeking new, active, developers. Are you interested in assuming that responsibility?', 'wporg-plugins' ); ?></p>
     40                                <p>
     41                                        <a class="button" href="https://developer.wordpress.org/plugins/wordpress-org/take-over-an-existing-plugin/"><?php _e( 'Read more', 'wporg-plugins' ); ?></a>
     42                                </p>
     43                        </div>
     44                        <?php
     45
     46                        echo $args['after_widget'];
     47                }
     48        }
     49}
  • new file wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/client/components/widget-area/widgets/adopt-me/style.scss

    diff --git wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/client/components/widget-area/widgets/adopt-me/style.scss wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/client/components/widget-area/widgets/adopt-me/style.scss
    new file mode 100644
    index 000000000..a7debaad5
    - +  
     1.plugin-adopt-me {
     2    background: #e6f4fa;
     3    font-size: ms( -2 );
     4    padding: 12px;
     5    margin-top: 36px;
     6    .widget-title {
     7        margin-top: 0;
     8    }
     9    p {
     10        margin-bottom: 0;
     11    }
     12}
     13 No newline at end of file
  • wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/client/styles/components/_components.scss

    diff --git wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/client/styles/components/_components.scss wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/client/styles/components/_components.scss
    index b222e188f..7551b4678 100644
     
    4747@import "../../components/site-header/style";
    4848@import "../../components/site-main/style";
    4949@import "../../components/widget-area/style";
     50@import "../../components/widget-area/widgets/adopt-me/style";
    5051@import "../../components/widget-area/widgets/committers/style";
    5152@import "../../components/widget-area/widgets/contributors/style";
    5253@import "../../components/widget-area/widgets/meta/style";
  • wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-parts/plugin-sidebar-advanced.php

    diff --git wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-parts/plugin-sidebar-advanced.php wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-parts/plugin-sidebar-advanced.php
    index 2abbef48d..1b30dc89d 100644
    $widget_args = array(  
    1414        'after_title'  => '</h4>',
    1515);
    1616
     17the_widget( 'WordPressdotorg\Plugin_Directory\Widgets\Adopt_Me', array(), $widget_args );
    1718the_widget( 'WordPressdotorg\Plugin_Directory\Widgets\Meta', array(), $widget_args );
    1819the_widget( 'WordPressdotorg\Plugin_Directory\Widgets\Ratings', array(), $widget_args );
    1920the_widget( 'WordPressdotorg\Plugin_Directory\Widgets\Support', array(), $widget_args );
  • wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-parts/plugin-sidebar.php

    diff --git wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-parts/plugin-sidebar.php wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-parts/plugin-sidebar.php
    index b056e3197..ee54abe58 100644
    $widget_args = array(  
    1414        'after_title'  => '</h3>',
    1515);
    1616
     17the_widget( 'WordPressdotorg\Plugin_Directory\Widgets\Adopt_Me', array(), $widget_args );
    1718the_widget( 'WordPressdotorg\Plugin_Directory\Widgets\Meta', array(), $widget_args );
    1819the_widget( 'WordPressdotorg\Plugin_Directory\Widgets\Ratings', array(), $widget_args );
    1920the_widget( 'WordPressdotorg\Plugin_Directory\Widgets\Contributors', array(), array(