function nova_filtered_url() { $config = apply_filters('nova/config', array()); if (isset($config['url_path'])) { Nova::$url = esc_url_raw($config['url_path']); } }
/** * Properly set the Nova URL for assets * Determines if Nova is installed as a plugin, in a child theme, or a parent theme * and then does some calculations to get the proper URL for its CSS & JS assets * * @return string */ public function set_url() { /** * Are we on a parent theme? */ if (Nova_Toolkit::is_parent_theme(__FILE__)) { $relative_url = str_replace(Nova_Toolkit::clean_file_path(get_template_directory()), '', dirname(dirname(__FILE__))); Nova::$url = trailingslashit(get_template_directory_uri() . $relative_url); } elseif (Nova_Toolkit::is_child_theme(__FILE__)) { $relative_url = str_replace(Nova_Toolkit::clean_file_path(get_stylesheet_directory()), '', dirname(dirname(__FILE__))); Nova::$url = trailingslashit(get_stylesheet_directory_uri() . $relative_url); } else { Nova::$url = plugin_dir_url(dirname(__FILE__) . 'nova.php'); } }