Ticket #3377: meta-3377.2.patch
File meta-3377.2.patch, 3.2 KB (added by , 7 years ago) |
---|
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/functions.php
68 68 } 69 69 70 70 /** 71 * WordPress Coding Standards handbook. 72 */ 73 if ( class_exists( '\\WordPressdotorg\\Markdown\\Importer' ) ) { 74 require __DIR__ . '/inc/coding-standards.php'; 75 } 76 77 /** 71 78 * Explanations for functions. hooks, classes, and methods. 72 79 */ 73 80 require( __DIR__ . '/inc/explanations.php' ); -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/coding-standards.php
3 3 use WordPressdotorg\Markdown\Editor; 4 4 use WordPressdotorg\Markdown\Importer; 5 5 6 class DevHub_REST_APIextends Importer {6 class WPCS_Coding_Standards extends Importer { 7 7 /** 8 8 * Singleton instance. 9 9 * … … 25 25 } 26 26 27 27 protected function get_base() { 28 return home_url( ' rest-api/' );28 return home_url( 'coding-standards/' ); 29 29 } 30 30 31 31 protected function get_manifest_url() { 32 return 'https://raw.githubusercontent.com/W P-API/docs/master/bin/manifest.json';32 return 'https://raw.githubusercontent.com/WordPress-Coding-Standards/docs/master/manifest.json'; 33 33 } 34 34 35 35 public function get_post_type() { 36 return ' rest-api-handbook';36 return 'coding-standards-handbook'; 37 37 } 38 38 39 39 public function init() { 40 40 add_filter( 'cron_schedules', array( $this, 'filter_cron_schedules' ) ); 41 41 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' ) ); 44 44 45 45 $editor = new Editor( $this ); 46 46 $editor->init(); … … 60 60 } 61 61 62 62 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' ); 65 65 } 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' ); 68 68 } 69 69 } 70 70 } 71 71 72 DevHub_REST_API::instance()->init();72 WPCS_Coding_Standards::instance()->init(); 73 73