'; if ( is_object( $data ) || is_array( $data ) ) { print_r( $data ); } else { var_dump( $data ); } echo ''; if ( is_admin() && $hide_adminbar ) { echo ''; } } /** * Includes a template file from the 'view' directory. * * @param string $template The template file name. * @param array $args Optional. An associative array of variables to pass to the template file. */ public static function get_template( $template, $args = array() ) { $path = TPSA_PLUGIN_DIR . 'views/' . $template; if ( file_exists( $path ) ) { if ( !empty( $args ) && is_array( $args ) ) { extract( $args ); } ob_start(); include $path; return ob_get_clean(); } } /** * Includes a template file from the 'tp-secure-plugin-pro/views' directory. * * This method is used to load a view/template file specifically from the pro version * of the plugin. It supports passing variables to the template via an associative array. * * @param string $template The relative path to the template file inside the 'tp-secure-plugin-pro/views/' directory. * @param array $args Optional. An associative array of variables to extract into the template's scope. * * @return string|null The output of the template file, or null if the file doesn't exist. */ public static function get_pro_template( $template, $args = array() ) { if ( is_plugin_active( 'admin-safety-guard-pro/admin-safety-guard-pro.php' ) ) { $path = TPASG_PRO_REAL_PATH . '/admin-safety-guard-pro/views/' . $template; if ( file_exists( $path ) ) { if ( !empty( $args ) && is_array( $args ) ) { extract( $args ); } ob_start(); include $path; return ob_get_clean(); } } } /** * @param string $var the variable name * @return string */ public static function get_screen( $var = '' ) { return isset( $_GET[$var] ) ? sanitize_text_field( $_GET[$var] ) : null; } }