Whoops \ Exception \ ErrorException (E_NOTICE)
Undefined offset: 0 Whoops\Exception\ErrorException thrown with message "Undefined offset: 0" Stacktrace: #7 Whoops\Exception\ErrorException in /home/www/montmartre/wp-content/themes/gaandc-wp-theme/app/custom_functions.php:15 #6 Whoops\Run:handleError in /home/www/montmartre/wp-content/themes/gaandc-wp-theme/app/custom_functions.php:15 #5 mon_compte_redirection in /home/www/montmartre/wp-includes/class-wp-hook.php:286 #4 WP_Hook:apply_filters in /home/www/montmartre/wp-includes/class-wp-hook.php:310 #3 WP_Hook:do_action in /home/www/montmartre/wp-includes/plugin.php:465 #2 do_action in /home/www/montmartre/wp-includes/template-loader.php:13 #1 require_once in /home/www/montmartre/wp-blog-header.php:19 #0 require in /home/www/montmartre/index.php:17
Stack frames (8)
7
Whoops
\
Exception
\
ErrorException
/
home
/
www
/
montmartre
/
wp-content
/
themes
/
gaandc-wp-theme
/
app
/
custom_functions.php
15
6
Whoops
\
Run
handleError
/
home
/
www
/
montmartre
/
wp-content
/
themes
/
gaandc-wp-theme
/
app
/
custom_functions.php
15
5
mon_compte_redirection
/
home
/
www
/
montmartre
/
wp-includes
/
class-wp-hook.php
286
4
WP_Hook
apply_filters
/
home
/
www
/
montmartre
/
wp-includes
/
class-wp-hook.php
310
3
WP_Hook
do_action
/
home
/
www
/
montmartre
/
wp-includes
/
plugin.php
465
2
do_action
/
home
/
www
/
montmartre
/
wp-includes
/
template-loader.php
13
1
require_once
/
home
/
www
/
montmartre
/
wp-blog-header.php
19
0
require
/
home
/
www
/
montmartre
/
index.php
17
/
home
/
www
/
montmartre
/
wp-content
/
themes
/
gaandc-wp-theme
/
app
/
custom_functions.php
<?php
function my_acf_init() {
 
    acf_update_setting('google_api_key', 'AIzaSyBuOdU2nkUpOfafHG8ASVxLYKI_-9CYz60');
}
 
add_action('acf/init', 'my_acf_init');
 
 
function mon_compte_redirection(){
    if(is_page('mon-compte')){
        $user = wp_get_current_user();
        $user_lieu = get_field('choix_du_lieu','user_'.$user->ID);
 
        $role = $user->roles[0];
        $dashboard = admin_url();
        // debug($role);
        if( $role == 'administrator' OR $role == 'partenaire') {
            $redirect = $dashboard;
            wp_redirect($redirect);
            exit;
        }
 
    }
}
add_action( 'template_redirect', 'mon_compte_redirection' );
 
function admin_enqueue($hook) {
    wp_enqueue_script( 'admin_script', get_template_directory_uri() . '/js/admin.js' );
}
add_action( 'admin_enqueue_scripts', 'admin_enqueue' );
/*------------------------------------*\
    ACF
\*------------------------------------*/
 
/* Option pages */
 
if( function_exists('acf_add_options_page') ) {
    acf_add_options_sub_page(array(
        'menu_title' => 'Logos et icônes',
Arguments
  1. "Undefined offset: 0"
    
/
home
/
www
/
montmartre
/
wp-content
/
themes
/
gaandc-wp-theme
/
app
/
custom_functions.php
<?php
function my_acf_init() {
 
    acf_update_setting('google_api_key', 'AIzaSyBuOdU2nkUpOfafHG8ASVxLYKI_-9CYz60');
}
 
add_action('acf/init', 'my_acf_init');
 
 
function mon_compte_redirection(){
    if(is_page('mon-compte')){
        $user = wp_get_current_user();
        $user_lieu = get_field('choix_du_lieu','user_'.$user->ID);
 
        $role = $user->roles[0];
        $dashboard = admin_url();
        // debug($role);
        if( $role == 'administrator' OR $role == 'partenaire') {
            $redirect = $dashboard;
            wp_redirect($redirect);
            exit;
        }
 
    }
}
add_action( 'template_redirect', 'mon_compte_redirection' );
 
function admin_enqueue($hook) {
    wp_enqueue_script( 'admin_script', get_template_directory_uri() . '/js/admin.js' );
}
add_action( 'admin_enqueue_scripts', 'admin_enqueue' );
/*------------------------------------*\
    ACF
\*------------------------------------*/
 
/* Option pages */
 
if( function_exists('acf_add_options_page') ) {
    acf_add_options_sub_page(array(
        'menu_title' => 'Logos et icônes',
Arguments
  1. 8
    
  2. "Undefined offset: 0"
    
  3. "/home/www/montmartre/wp-content/themes/gaandc-wp-theme/app/custom_functions.php"
    
  4. 15
    
  5. array:2 [
      "user" => WP_User {}
      "user_lieu" => null
    ]
    
/
home
/
www
/
montmartre
/
wp-includes
/
class-wp-hook.php
        }
 
        $nesting_level = $this->nesting_level++;
 
        $this->iterations[ $nesting_level ] = array_keys( $this->callbacks );
        $num_args                           = count( $args );
 
        do {
            $this->current_priority[ $nesting_level ] = $priority = current( $this->iterations[ $nesting_level ] );
 
            foreach ( $this->callbacks[ $priority ] as $the_ ) {
                if ( ! $this->doing_action ) {
                    $args[0] = $value;
                }
 
                // Avoid the array_slice if possible.
                if ( $the_['accepted_args'] == 0 ) {
                    $value = call_user_func_array( $the_['function'], array() );
                } elseif ( $the_['accepted_args'] >= $num_args ) {
                    $value = call_user_func_array( $the_['function'], $args );
                } else {
                    $value = call_user_func_array( $the_['function'], array_slice( $args, 0, (int) $the_['accepted_args'] ) );
                }
            }
        } while ( false !== next( $this->iterations[ $nesting_level ] ) );
 
        unset( $this->iterations[ $nesting_level ] );
        unset( $this->current_priority[ $nesting_level ] );
 
        $this->nesting_level--;
 
        return $value;
    }
 
    /**
     * Executes the callback functions hooked on a specific action hook.
     *
     * @since 4.7.0
     *
     * @param mixed $args Arguments to pass to the hook callbacks.
Arguments
  1. ""
    
/
home
/
www
/
montmartre
/
wp-includes
/
class-wp-hook.php
        } while ( false !== next( $this->iterations[ $nesting_level ] ) );
 
        unset( $this->iterations[ $nesting_level ] );
        unset( $this->current_priority[ $nesting_level ] );
 
        $this->nesting_level--;
 
        return $value;
    }
 
    /**
     * Executes the callback functions hooked on a specific action hook.
     *
     * @since 4.7.0
     *
     * @param mixed $args Arguments to pass to the hook callbacks.
     */
    public function do_action( $args ) {
        $this->doing_action = true;
        $this->apply_filters( '', $args );
 
        // If there are recursive calls to the current action, we haven't finished it until we get to the last one.
        if ( ! $this->nesting_level ) {
            $this->doing_action = false;
        }
    }
 
    /**
     * Processes the functions hooked into the 'all' hook.
     *
     * @since 4.7.0
     *
     * @param array $args Arguments to pass to the hook callbacks. Passed by reference.
     */
    public function do_all_hook( &$args ) {
        $nesting_level                      = $this->nesting_level++;
        $this->iterations[ $nesting_level ] = array_keys( $this->callbacks );
 
        do {
            $priority = current( $this->iterations[ $nesting_level ] );
Arguments
  1. null
    
  2. array:1 [
      0 => ""
    ]
    
/
home
/
www
/
montmartre
/
wp-includes
/
plugin.php
            array_pop( $wp_current_filter );
        }
        return;
    }
 
    if ( ! isset( $wp_filter['all'] ) ) {
        $wp_current_filter[] = $tag;
    }
 
    $args = array();
    if ( is_array( $arg ) && 1 == count( $arg ) && isset( $arg[0] ) && is_object( $arg[0] ) ) { // array(&$this)
        $args[] =& $arg[0];
    } else {
        $args[] = $arg;
    }
    for ( $a = 2, $num = func_num_args(); $a < $num; $a++ ) {
        $args[] = func_get_arg( $a );
    }
 
    $wp_filter[ $tag ]->do_action( $args );
 
    array_pop( $wp_current_filter );
}
 
/**
 * Retrieve the number of times an action is fired.
 *
 * @since 2.1.0
 *
 * @global array $wp_actions Increments the amount of times action was triggered.
 *
 * @param string $tag The name of the action hook.
 * @return int The number of times action hook $tag is fired.
 */
function did_action( $tag ) {
    global $wp_actions;
 
    if ( ! isset( $wp_actions[ $tag ] ) ) {
        return 0;
    }
Arguments
  1. array:1 [
      0 => ""
    ]
    
/
home
/
www
/
montmartre
/
wp-includes
/
template-loader.php
<?php
/**
 * Loads the correct template based on the visitor's url
 *
 * @package WordPress
 */
if ( wp_using_themes() ) {
    /**
     * Fires before determining which template to load.
     *
     * @since 1.5.0
     */
    do_action( 'template_redirect' );
}
 
/**
 * Filters whether to allow 'HEAD' requests to generate content.
 *
 * Provides a significant performance bump by exiting before the page
 * content loads for 'HEAD' requests. See #14348.
 *
 * @since 3.5.0
 *
 * @param bool $exit Whether to exit without generating any content for 'HEAD' requests. Default true.
 */
if ( 'HEAD' === $_SERVER['REQUEST_METHOD'] && apply_filters( 'exit_on_http_head', true ) ) {
    exit();
}
 
// Process feeds and trackbacks even if not using themes.
if ( is_robots() ) :
    /**
     * Fired when the template loader determines a robots.txt request.
     *
     * @since 2.1.0
     */
    do_action( 'do_robots' );
    return;
elseif ( is_feed() ) :
    do_feed();
Arguments
  1. "template_redirect"
    
/
home
/
www
/
montmartre
/
wp-blog-header.php
<?php
/**
 * Loads the WordPress environment and template.
 *
 * @package WordPress
 */
 
if ( ! isset( $wp_did_header ) ) {
 
    $wp_did_header = true;
 
    // Load the WordPress library.
    require_once( dirname( __FILE__ ) . '/wp-load.php' );
 
    // Set up the WordPress query.
    wp();
 
    // Load the theme template.
    require_once( ABSPATH . WPINC . '/template-loader.php' );
 
}
 
Arguments
  1. "/home/www/montmartre/wp-includes/template-loader.php"
    
/
home
/
www
/
montmartre
/
index.php
<?php
/**
 * Front to the WordPress application. This file doesn't do anything, but loads
 * wp-blog-header.php which does and tells WordPress to load the theme.
 *
 * @package WordPress
 */
 
/**
 * Tells WordPress to load the WordPress theme and output it.
 *
 * @var bool
 */
define( 'WP_USE_THEMES', true );
 
/** Loads the WordPress Environment and Template */
require( dirname( __FILE__ ) . '/wp-blog-header.php' );
 
Arguments
  1. "/home/www/montmartre/wp-blog-header.php"
    

Environment & details:

Key Value
query_vars
array:2 [
  "page" => ""
  "pagename" => "mon-compte"
]
query_string
"pagename=mon-compte"
request
"mon-compte"
matched_rule
"(.?.+?)(?:/([0-9]+))?/?$"
matched_query
"pagename=mon-compte&page="
did_permalink
true
Key Value
query
array:2 [
  "page" => ""
  "pagename" => "mon-compte"
]
query_vars
array:9 [
  "pagename" => "mon-compte"
  "name" => "mon-compte"
  "cache_results" => true
  "update_post_term_cache" => true
  "lazy_load_term_meta" => true
  "update_post_meta_cache" => true
  "posts_per_page" => 40
  "comments_per_page" => "50"
  "order" => "DESC"
]
meta_query
WP_Meta_Query {}
queried_object
WP_Post {}
queried_object_id
7
request
"SELECT   GkZbp_posts.* FROM GkZbp_posts  WHERE 1=1  AND (GkZbp_posts.ID = '7') AND GkZbp_posts.post_type = 'page'  ORDER BY GkZbp_posts.post_date DESC "
post_count
1
current_post
-1
current_comment
-1
found_posts
1
is_page
true
is_singular
true
Key Value
ID
7
post_author
"1"
post_date
"2018-03-23 16:40:47"
post_date_gmt
"2018-03-23 15:40:47"
post_content
"[woocommerce_my_account]"
post_title
"Mon compte"
post_excerpt
""
post_status
"publish"
comment_status
"closed"
ping_status
"closed"
post_password
""
post_name
"mon-compte"
to_ping
""
pinged
""
post_modified
"2018-06-12 18:18:14"
post_modified_gmt
"2018-06-12 16:18:14"
post_content_filtered
""
post_parent
0
guid
"https://montmartre.dev-app.net/my-account/"
menu_order
0
post_type
"page"
post_mime_type
""
comment_count
"0"
filter
"raw"
empty
empty
empty
empty
Key Value
gac_flash
[]
Key Value
SERVER_SOFTWARE
"nginx/1.10.3"
REQUEST_URI
"/mon-compte/"
USER
"www-data"
HOME
"/var/www"
HTTP_ACCEPT_ENCODING
"gzip"
HTTP_CONNECTION
"Keep-Alive"
HTTP_HOST
"montmartre.dev-app.net"
HTTP_IF_MODIFIED_SINCE
"Mon, 19 Aug 2019 04:12:17 UTC"
HTTP_ACCEPT_LANGUAGE
"en-US,en;q=0.5"
HTTP_ACCEPT
"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
HTTP_USER_AGENT
"CCBot/2.0 (https://commoncrawl.org/faq/)"
SCRIPT_FILENAME
"/home/www/montmartre/index.php"
REDIRECT_STATUS
"200"
SERVER_NAME
"montmartre.dev-app.net"
SERVER_PORT
"443"
SERVER_ADDR
"176.31.105.227"
REMOTE_PORT
"33742"
REMOTE_ADDR
"3.227.2.109"
GATEWAY_INTERFACE
"CGI/1.1"
HTTPS
"on"
REQUEST_SCHEME
"https"
SERVER_PROTOCOL
"HTTP/1.1"
DOCUMENT_ROOT
"/home/www/montmartre"
DOCUMENT_URI
"/index.php"
SCRIPT_NAME
"/index.php"
CONTENT_LENGTH
""
CONTENT_TYPE
""
REQUEST_METHOD
"GET"
QUERY_STRING
""
FCGI_ROLE
"RESPONDER"
PHP_SELF
"/index.php"
REQUEST_TIME_FLOAT
"1571399717.8936"
REQUEST_TIME
"1571399717"
empty
0. Whoops\Handler\PrettyPageHandler
1. GAC\Whoops\AjaxHandler
2. GAC\Whoops\APIHandler