| 1 |
<?php |
| 2 |
if (!defined( 'ABSPATH' ) )exit('No Such File'); |
| 3 |
wpsp_header(); |
| 4 |
if( is_user_logged_in() ) { |
| 5 |
global $current_user, $wpdb; |
| 6 |
$current_user_role=$current_user->roles[0]; |
| 7 |
wpsp_topbar(); |
| 8 |
wpsp_sidebar(); |
| 9 |
wpsp_body_start(); |
| 10 |
$filename = ''; |
| 11 |
$header = 'Posts'; |
| 12 |
|
| 13 |
if( isset($_GET['tab'] ) && sanitize_text_field($_GET['tab']) == 'addposts' ) { |
| 14 |
$header = $label = __( 'Add New Post', 'wpschoolpress'); |
| 15 |
//$filename = WPSP_PLUGIN_PATH .'includes/wpsp-classForm.php'; |
| 16 |
do_action('wpspsmpro_add_posts_html'); |
| 17 |
}elseif((isset($_GET['id']) && is_numeric($_GET['id']))) { |
| 18 |
$header = $label = __( 'Update Post', 'wpschoolpress'); |
| 19 |
// $filename = WPSP_PLUGIN_PATH .'includes/wpsp-classForm.php'; |
| 20 |
do_action('wpspsmpro_edit_posts_html'); |
| 21 |
} else { |
| 22 |
do_action('wpspsmpro_list_posts_html'); |
| 23 |
} |
| 24 |
|
| 25 |
wpsp_body_end(); |
| 26 |
wpsp_footer(); |
| 27 |
} else { |
| 28 |
include_once( WPSP_PLUGIN_PATH .'/includes/wpsp-login.php'); |
| 29 |
} |
| 30 |
?> |
| 31 |
|