| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: Mark Posts |
| 4 |
* Description: Mark and highlight posts, pages and posts of custom post types within the posts overview. |
| 5 |
* Plugin URI: https://wordpress.org/plugins/mark-posts |
| 6 |
* Version: 2.2.1 |
| 7 |
* Author: Sven Hofmann & Michael Schoenrock |
| 8 |
* Author URI: https://hofmannsven.com |
| 9 |
* Contributor: Michael Schoenrock |
| 10 |
* Contributor URI: https://www.halloecho.de |
| 11 |
* License: GPL-2.0+ |
| 12 |
* License URI: https://www.gnu.org/licenses/gpl-2.0.txt |
| 13 |
* Text Domain: mark-posts |
| 14 |
* GitHub URI: https://github.com/hofmannsven/mark-posts |
| 15 |
*/ |
| 16 |
|
| 17 |
// If this file is called directly, abort. |
| 18 |
if (!defined('WPINC')) { |
| 19 |
exit; |
| 20 |
} |
| 21 |
|
| 22 |
/*----------------------------------------------------------------------------* |
| 23 |
* Public-Facing Functionality |
| 24 |
*----------------------------------------------------------------------------*/ |
| 25 |
|
| 26 |
/* |
| 27 |
* plugin version |
| 28 |
* |
| 29 |
*/ |
| 30 |
if (!defined('WP_MARK_POSTS_VERSION')) { |
| 31 |
define('WP_MARK_POSTS_VERSION', '2.2.1'); |
| 32 |
} |
| 33 |
|
| 34 |
/* |
| 35 |
* plugin dir path |
| 36 |
* |
| 37 |
*/ |
| 38 |
if (!defined('WP_MARK_POSTS_PATH')) { |
| 39 |
define('WP_MARK_POSTS_PATH', plugin_dir_path(__FILE__)); |
| 40 |
} |
| 41 |
|
| 42 |
/* |
| 43 |
* plugin's class file |
| 44 |
* |
| 45 |
*/ |
| 46 |
require_once plugin_dir_path(__FILE__).'public/class-mark-posts.php'; |
| 47 |
|
| 48 |
/* |
| 49 |
* Register hooks that are fired when the plugin is activated or deactivated. |
| 50 |
* When the plugin is deleted, the uninstall.php file is loaded. |
| 51 |
* |
| 52 |
*/ |
| 53 |
register_activation_hook(__FILE__, ['Mark_Posts', 'activate']); |
| 54 |
register_deactivation_hook(__FILE__, ['Mark_Posts', 'deactivate']); |
| 55 |
|
| 56 |
/* |
| 57 |
* Load the plugin text domain for translation |
| 58 |
* |
| 59 |
*/ |
| 60 |
function mark_posts_load_textdomain() |
| 61 |
{ |
| 62 |
load_plugin_textdomain('mark-posts', false, dirname(plugin_basename(__FILE__)).'/languages/'); |
| 63 |
} |
| 64 |
add_action('plugins_loaded', 'mark_posts_load_textdomain'); |
| 65 |
|
| 66 |
/* |
| 67 |
* Add action plugins_loaded |
| 68 |
* |
| 69 |
*/ |
| 70 |
add_action('plugins_loaded', ['Mark_Posts', 'get_instance']); |
| 71 |
|
| 72 |
/*----------------------------------------------------------------------------* |
| 73 |
* Dashboard and Administrative Functionality |
| 74 |
*----------------------------------------------------------------------------*/ |
| 75 |
|
| 76 |
if (is_admin()) { |
| 77 |
require_once plugin_dir_path(__FILE__).'admin/class-mark-posts-marker.php'; |
| 78 |
require_once plugin_dir_path(__FILE__).'admin/class-mark-posts-admin.php'; |
| 79 |
add_action('plugins_loaded', ['Mark_Posts_Admin', 'get_instance']); |
| 80 |
} |
| 81 |
|