summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--giglogadmin.php8
-rw-r--r--includes/admin/views/giglog_admin_page.php12
2 files changed, 12 insertions, 8 deletions
diff --git a/giglogadmin.php b/giglogadmin.php
index d71496b..c8ae9b0 100644
--- a/giglogadmin.php
+++ b/giglogadmin.php
@@ -82,7 +82,11 @@ if ( !class_exists( 'GiglogAdmin_Plugin' ) ) {
"giglog_import", // menu slug
array( 'GiglogAdmin_ImportGigsPage', 'render_html' )); // callable
- add_action( 'load-' . $import_hook, array( 'GiglogAdmin_ImportGigsPage', 'submit_form' ) );
+ if ($import_hook !== false) {
+ add_action(
+ 'load-' . $import_hook,
+ array( 'GiglogAdmin_ImportGigsPage', 'submit_form' ) );
+ }
wp_register_style( 'css_style', plugins_url( '/includes/css/main.css', __FILE__ ) );
wp_enqueue_style('css_style');
@@ -121,7 +125,7 @@ if ( !class_exists( 'GiglogAdmin_Plugin' ) ) {
* Giglog admin pages should only be visible for logged in users/can eventually
* be customized by role if needed
*/
- static function nav_menu_args( $args = '' ) {
+ static function nav_menu_args( array $args = [] ) : array {
if ( is_user_logged_in() ) {
$args['menu'] = 'Loggedusers';
} else {
diff --git a/includes/admin/views/giglog_admin_page.php b/includes/admin/views/giglog_admin_page.php
index f2b6edd..85c4193 100644
--- a/includes/admin/views/giglog_admin_page.php
+++ b/includes/admin/views/giglog_admin_page.php
@@ -36,7 +36,7 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) {
echo(GiglogAdmin_AdminPage::editforms()); //not sure why it doesn't show without the echo?
}
- static function get_allvenues($invenue): string
+ static function get_allvenues(int $invenue): string
{
$select = '<select name="selectvenueadmin">';
$select .= '<option value="">Please Select..</option>';
@@ -50,7 +50,7 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) {
}
- static function get_user($cid, $ctype): string
+ static function get_user( int $cid, int $ctype): string
{
$hf_user = wp_get_current_user();
$hf_username = $hf_user->user_login;
@@ -107,7 +107,7 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) {
$select .= '<select name="selectvenue">';
- foreach ( $venues AS $venue ) {
+ foreach ( $venue_list as $venue ) {
$select .= '<option value="' . $venue[0] . '"' . selected($venue, $selected_venue) . '>';
$select .= $venue[1] . '</option>';
}
@@ -167,7 +167,7 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) {
return $content;
}
- static function adminactions($concert_id): string
+ static function adminactions( int $concert_id ) : string
{
global $wpdb;
$query = "SELECT id,wpgs_name from wpg_pressstatus" ;
@@ -195,7 +195,7 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) {
/**
* @return null|string
*/
- static function getpublishstatus($concert_id)
+ static function getpublishstatus(int $concert_id)
{
global $wpdb;
$date1 = new DateTime("now");
@@ -216,7 +216,7 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) {
{
$hf_user = wp_get_current_user();
$hf_username = $hf_user->user_login;
- $roles = ( array ) $hf_user->roles;
+ $roles = $hf_user->roles;
global $wpdb;
$content = '<table class="assignit">';