forked from jchristopher/menu-breadcrumb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenu-breadcrumb.php
More file actions
56 lines (52 loc) · 1.61 KB
/
menu-breadcrumb.php
File metadata and controls
56 lines (52 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
/**
* @link https://github.com/jchristopher/menu-breadcrumb
* @since 1.0.0
* @package Menu_Breadcrumb
*
* @menu-breadcrumb
* Plugin Name: Menu Breadcrumb
* Plugin URI: https://github.com/jchristopher/menu-breadcrumb
* Description: Generate a breadcrumb trail from a WordPress Menu
* Version: 1.0.2
* Author: Jonathan Christopher
* Author URI: https://mondaybynoon.com/
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: menu-breadcrumb
* Domain Path: /languages
*/
// abort if this file is called directly
if ( ! defined( 'WPINC' ) ) {
die;
}
/**
* The core plugin class that is used to define internationalization,
* dashboard-specific hooks, and public-facing site hooks.
*/
require plugin_dir_path( __FILE__ ) . 'includes/class-menu-breadcrumb.php';
/**
* Begins execution of the plugin.
*
* Since everything within the plugin is registered via hooks,
* then kicking off the plugin from this point in the file does
* not affect the page life cycle.
*
* @since 1.0.0
*/
function run_menu_breadcrumb() {
$plugin = new Menu_Breadcrumb();
$plugin->run();
}
run_menu_breadcrumb();
/**
* Automagic output of breadcrumb markup based on passed parameters
*
* @since 1.0.0
*/
if ( ! function_exists( 'menu_breadcrumb' ) ) {
function menu_breadcrumb( $menu_location = '', $separator = ' » ', $before = '', $after ='' ) {
$menu_breadcrumb = new Menu_Breadcrumb( $menu_location );
$menu_breadcrumb->render( $separator, $before, $after );
}
}