WordPress.org

Making WordPress.org

Ticket #3377: meta-3377.2.patch

File meta-3377.2.patch, 3.2 KB (added by netweb, 3 years ago)
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/functions.php

     
    6868}
    6969
    7070/**
     71 * WordPress Coding Standards handbook.
     72 */
     73if ( class_exists( '\\WordPressdotorg\\Markdown\\Importer' ) ) {
     74        require __DIR__ . '/inc/coding-standards.php';
     75}
     76
     77/**
    7178 * Explanations for functions. hooks, classes, and methods.
    7279 */
    7380require( __DIR__ . '/inc/explanations.php' );
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/coding-standards.php

     
    33use WordPressdotorg\Markdown\Editor;
    44use WordPressdotorg\Markdown\Importer;
    55
    6 class DevHub_REST_API extends Importer {
     6class WPCS_Coding_Standards extends Importer {
    77        /**
    88         * Singleton instance.
    99         *
     
    2525        }
    2626
    2727        protected function get_base() {
    28                 return home_url( 'rest-api/' );
     28                return home_url( 'coding-standards/' );
    2929        }
    3030
    3131        protected function get_manifest_url() {
    32                 return 'https://raw.githubusercontent.com/WP-API/docs/master/bin/manifest.json';
     32                return 'https://raw.githubusercontent.com/WordPress-Coding-Standards/docs/master/manifest.json';
    3333        }
    3434
    3535        public function get_post_type() {
    36                 return 'rest-api-handbook';
     36                return 'coding-standards-handbook';
    3737        }
    3838
    3939        public function init() {
    4040                add_filter( 'cron_schedules', array( $this, 'filter_cron_schedules' ) );
    4141                add_action( 'init', array( $this, 'register_cron_jobs' ) );
    42                 add_action( 'devhub_restapi_import_manifest', array( $this, 'import_manifest' ) );
    43                 add_action( 'devhub_restapi_import_all_markdown', array( $this, 'import_all_markdown' ) );
     42                add_action( 'devhub_coding_standards_import_manifest', array( $this, 'import_manifest' ) );
     43                add_action( 'devhub_coding_standards_import_all_markdown', array( $this, 'import_all_markdown' ) );
    4444
    4545                $editor = new Editor( $this );
    4646                $editor->init();
     
    6060        }
    6161
    6262        public function register_cron_jobs() {
    63                 if ( ! wp_next_scheduled( 'devhub_restapi_import_manifest' ) ) {
    64                         wp_schedule_event( time(), '15_minutes', 'devhub_restapi_import_manifest' );
     63                if ( ! wp_next_scheduled( 'devhub_coding_standards_import_manifest' ) ) {
     64                        wp_schedule_event( time(), '15_minutes', 'devhub_coding_standards_import_manifest' );
    6565                }
    66                 if ( ! wp_next_scheduled( 'devhub_restapi_import_all_markdown' ) ) {
    67                         wp_schedule_event( time(), '15_minutes', 'devhub_restapi_import_all_markdown' );
     66                if ( ! wp_next_scheduled( 'devhub_coding_standards_import_all_markdown' ) ) {
     67                        wp_schedule_event( time(), '15_minutes', 'devhub_coding_standards_import_all_markdown' );
    6868                }
    6969        }
    7070}
    7171
    72 DevHub_REST_API::instance()->init();
     72WPCS_Coding_Standards::instance()->init();
    7373