advert_get_transactions_id(); $this->advert_do_transactions(); } public function advert_get_transactions_id(){ //who are we working with $this->user_id = $user_id = intval(get_current_user_id()); $this->howmany = $howmany = intval(apply_filters('check_advertiser', $user_id)); $this->adv_id = $adv_id = intval(apply_filters('get_advertiser_id', $user_id)); if ( 'POST' == $_SERVER['REQUEST_METHOD'] && $_POST['post_type'] == 'admin_transaction_filter' && $_POST['originalaction'] == 'admintransaction' && current_user_can('edit_adverts') ){ if ( !is_user_logged_in() || ! wp_verify_nonce( $_POST['admin-transactions'], 'admin_transactions' ) ){ print 'Woah, whats really going on...?'; return; } if( isset($_POST['advert-transaction-filter']) ){ if(current_user_can('edit_adverts') && !current_user_can('publish_adverts') && $howmany > 0){ $this->transaction_id = $adv_id; } elseif(current_user_can('publish_adverts')){ $this->transaction_id = sanitize_text_field($_POST['advert-transaction-filter']); } } } elseif(isset($_GET['transadv']) && intval($_GET['transadv']) > 0){ if ( isset($_GET['_nonce']) && wp_verify_nonce( $_GET['_nonce'], 'advert-transactions-link' ) ){ if(current_user_can('edit_adverts') && !current_user_can('publish_adverts') && $howmany > 0){ $this->transaction_id = $adv_id; } elseif(current_user_can('publish_adverts')){ $this->transaction_id = $_GET['transadv']; } } else{ print 'Woah, whats really going on...?'; return; } } } public function advert_do_transactions(){ $paged = ''; ?>