|
| 1 | +<?php |
| 2 | +/** |
| 3 | + * Launches the Git Contributing plugin. |
| 4 | + * |
| 5 | + * @package KnowTheCode\GitContributing |
| 6 | + * @author hellofromTonya |
| 7 | + * @license GPL-2.0+ |
| 8 | + * |
| 9 | + * @wordpress-plugin |
| 10 | + * Plugin Name: Git Contributing |
| 11 | + * Plugin URI: https://github.com/KnowTheCode/git-contributing |
| 12 | + * Description: Git Contributing - an awesome collaborative project to teach you the contributor workflow. |
| 13 | + * Version: 1.0.0 |
| 14 | + * Author: Git Contributing Team |
| 15 | + * Author URI: https://KnowTheCode.io |
| 16 | + * Text Domain: git-contributing |
| 17 | + * License: GPL-2.0+ |
| 18 | + * License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
| 19 | + */ |
| 20 | + |
| 21 | +namespace KnowTheCode\GitContributing; |
| 22 | + |
| 23 | +/** |
| 24 | + * Gets this plugin's absolute directory path. |
| 25 | + * |
| 26 | + * @since 1.0.0 |
| 27 | + * @ignore |
| 28 | + * @access private |
| 29 | + * |
| 30 | + * @return string |
| 31 | + */ |
| 32 | +function _get_plugin_directory() { |
| 33 | + return __DIR__; |
| 34 | +} |
| 35 | + |
| 36 | +/** |
| 37 | + * Gets this plugin's URL. |
| 38 | + * |
| 39 | + * @since 1.0.0 |
| 40 | + * @ignore |
| 41 | + * @access private |
| 42 | + * |
| 43 | + * @return string |
| 44 | + */ |
| 45 | +function _get_plugin_url() { |
| 46 | + static $plugin_url; |
| 47 | + |
| 48 | + if ( empty( $plugin_url ) ) { |
| 49 | + $plugin_url = plugins_url( null, __FILE__ ); |
| 50 | + } |
| 51 | + |
| 52 | + return $plugin_url; |
| 53 | +} |
| 54 | + |
| 55 | +/** |
| 56 | + * Checks if this plugin is in development mode. |
| 57 | + * |
| 58 | + * @since 1.0.0 |
| 59 | + * |
| 60 | + * @return bool |
| 61 | + */ |
| 62 | +function _is_in_development_mode() { |
| 63 | + return defined( WP_DEBUG ) && WP_DEBUG === true; |
| 64 | +} |
| 65 | + |
| 66 | +/** |
| 67 | + * Autoload the plugin's files. |
| 68 | + * |
| 69 | + * @since 1.0.0 |
| 70 | + * |
| 71 | + * @return void |
| 72 | + */ |
| 73 | +function autoload_files() { |
| 74 | + $files = array( |
| 75 | + // add the list of files to load here. |
| 76 | + ); |
| 77 | + |
| 78 | + foreach ( $files as $file ) { |
| 79 | + require __DIR__ . '/src/' . $file; |
| 80 | + } |
| 81 | +} |
| 82 | + |
| 83 | +/** |
| 84 | + * Launch the plugin. |
| 85 | + * |
| 86 | + * @since 1.0.0 |
| 87 | + * |
| 88 | + * @return void |
| 89 | + */ |
| 90 | +function launch() { |
| 91 | + autoload_files(); |
| 92 | +} |
| 93 | + |
| 94 | +launch(); |
0 commit comments