use a hook provided by the plugin for configuring meta "robots" */ add_filter( 'wpseo_robots_array', function ( $robots ) { if ( ! tve_dash_should_index_page() ) { $robots = array( 'index' => 'noindex' ); } return $robots; } ); } else { /* Default behaviour: add a meta "robots" noindex if needed */ add_action( 'wp_head', 'tve_dash_custom_post_no_index' ); } add_action( 'wp_enqueue_scripts', 'tve_dash_frontend_enqueue' ); if ( is_admin() ) { require TVE_DASH_PATH . '/inc/db-updater/init.php'; add_action( 'init', 'tve_dash_check_default_cap' ); add_action( 'admin_menu', 'tve_dash_admin_menu', 10 ); add_action( 'admin_enqueue_scripts', 'tve_dash_admin_enqueue_scripts' ); add_action( 'admin_enqueue_scripts', 'tve_dash_admin_dequeue_conflicting', 90000 ); add_action( 'wp_ajax_tve_dash_backend_ajax', 'tve_dash_backend_ajax' ); add_action( 'wp_ajax_tve_dash_front_ajax', 'tve_dash_frontend_ajax_load' ); add_action( 'wp_ajax_nopriv_tve_dash_front_ajax', 'tve_dash_frontend_ajax_load' ); add_action( 'current_screen', 'tve_dash_current_screen' ); add_action( 'admin_enqueue_scripts', 'add_generic_admin_css' ); } /** * Hook when a user submits a WordPress login form & the login has been successful * * Adds a user meta with last login timestamp */ add_action( 'wp_login', 'tve_dash_on_user_login', 10, 2 ); /** * Hook when a user submits a WordPress login form & the login has been failed */ add_action( 'wp_login_failed', 'tve_dash_on_user_login_failed', 10, 2 );