| 1 |
<?php |
| 2 |
/** |
| 3 |
* Module: Table Ordering. |
| 4 |
* |
| 5 |
* @package Orderable/Classes |
| 6 |
*/ |
| 7 |
|
| 8 |
defined( 'ABSPATH' ) || exit; |
| 9 |
|
| 10 |
/** |
| 11 |
* Addons module class. |
| 12 |
*/ |
| 13 |
class Orderable_Table_Ordering { |
| 14 |
/** |
| 15 |
* Init. |
| 16 |
*/ |
| 17 |
public static function run() { |
| 18 |
add_filter( 'orderable_valid_admin_pages', array( __CLASS__, 'add_valid_admin_pages' ) ); |
| 19 |
add_action( 'admin_menu', array( __CLASS__, 'add_settings_page' ) ); |
| 20 |
} |
| 21 |
|
| 22 |
/** |
| 23 |
* Add valid admin page. |
| 24 |
*/ |
| 25 |
public static function add_valid_admin_pages( $pages = array() ) { |
| 26 |
$pages[] = 'orderable-table-ordering'; |
| 27 |
|
| 28 |
return $pages; |
| 29 |
} |
| 30 |
|
| 31 |
/** |
| 32 |
* Add settings page. |
| 33 |
*/ |
| 34 |
public static function add_settings_page() { |
| 35 |
add_submenu_page( 'orderable', __( 'Table Ordering', 'orderable' ), sprintf( '%s <span class="update-plugins" style="background-color: #ffffff1c"><span class="plugin-count">%s</span></span>', __( 'Table Ordering', 'orderable' ), __( 'Pro', 'orderable' ) ), 'manage_options', 'orderable-table-ordering', array( __CLASS__, 'page_content' ), 10 ); |
| 36 |
} |
| 37 |
|
| 38 |
/** |
| 39 |
* Page content. |
| 40 |
*/ |
| 41 |
public static function page_content() { |
| 42 |
Orderable_Settings::upgrade_page_content( __( 'Table Ordering', 'orderable' ) ); |
| 43 |
} |
| 44 |
} |
| 45 |
|