| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: Ultimate Markdown |
| 4 |
* Description: Create WordPress posts with the popular Markdown syntax. |
| 5 |
* Version: 1.13 |
| 6 |
* Author: DAEXT |
| 7 |
* Author URI: https://daext.com |
| 8 |
* Text Domain: ultimate-markdown |
| 9 |
* License: GPLv3 |
| 10 |
* |
| 11 |
* @package ultimate-markdown |
| 12 |
*/ |
| 13 |
|
| 14 |
// Prevent direct access to this file. |
| 15 |
if ( ! defined( 'WPINC' ) ) { |
| 16 |
die(); |
| 17 |
} |
| 18 |
|
| 19 |
// Class shared across public and admin. |
| 20 |
require_once plugin_dir_path( __FILE__ ) . 'shared/class-daextulma-shared.php'; |
| 21 |
|
| 22 |
// Perform the Gutenberg related activities only if Gutenberg is present. |
| 23 |
if ( function_exists( 'register_block_type' ) ) { |
| 24 |
require_once plugin_dir_path( __FILE__ ) . 'blocks/src/init.php'; |
| 25 |
} |
| 26 |
|
| 27 |
// Admin. |
| 28 |
if ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) { |
| 29 |
|
| 30 |
// Admin. |
| 31 |
require_once plugin_dir_path( __FILE__ ) . 'admin/class-daextulma-admin.php'; |
| 32 |
add_action( 'plugins_loaded', array( 'Daextulma_Admin', 'get_instance' ) ); |
| 33 |
|
| 34 |
// Activate. |
| 35 |
register_activation_hook( __FILE__, array( Daextulma_Admin::get_instance(), 'ac_activate' ) ); |
| 36 |
|
| 37 |
} |
| 38 |
|
| 39 |
// Ajax. |
| 40 |
if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { |
| 41 |
|
| 42 |
// Admin. |
| 43 |
require_once plugin_dir_path( __FILE__ ) . 'class-daextulma-ajax.php'; |
| 44 |
add_action( 'plugins_loaded', array( 'daextulma_Ajax', 'get_instance' ) ); |
| 45 |
|
| 46 |
} |
| 47 |
|
| 48 |
/** |
| 49 |
* Customize the action links in the "Plugins" menu. |
| 50 |
* |
| 51 |
* @param array $actions An array of plugin action links. |
| 52 |
* |
| 53 |
* @return mixed |
| 54 |
*/ |
| 55 |
function daextulma_customize_action_links( $actions ) { |
| 56 |
$actions[] = '<a href="https://daext.com/ultimate-markdown/">' . esc_html__( 'Buy the Pro Version', 'ultimate-markdown' ) . '</a>'; |
| 57 |
return $actions; |
| 58 |
} |
| 59 |
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'daextulma_customize_action_links' ); |
| 60 |
|