Merge pull request #1580 from AMorgachev/wordpress

Wordpress
This commit is contained in:
gregory-p
2018-08-21 11:29:02 +03:00
committed by GitHub
11 changed files with 578 additions and 107 deletions

View File

@@ -8,7 +8,9 @@
"wpackagist-plugin/contact-form-7": "~5.0.3",
"wpackagist-plugin/flamingo": "~1.9",
"wpackagist-plugin/really-simple-captcha": "~2.0.1",
"wpackagist-plugin/enhanced-media-library": "~2.6.4"
"wpackagist-plugin/enhanced-media-library": "~2.6.4",
"wpackagist-plugin/menu-item-custom-fields": "~1.0.0",
"wpackagist-plugin/wp-rest-api-v2-menus": "~0.3.1"
},
"repositories": [
{

42
composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "8f1b0c2c233bc65a8beacc1f7117be9d",
"content-hash": "1fc59596dfbe4e5a31e63ea12335e532",
"packages": [
{
"name": "composer/installers",
@@ -186,6 +186,26 @@
"type": "wordpress-plugin",
"homepage": "https://wordpress.org/plugins/flamingo/"
},
{
"name": "wpackagist-plugin/menu-item-custom-fields",
"version": "1.0.0",
"source": {
"type": "svn",
"url": "https://plugins.svn.wordpress.org/menu-item-custom-fields/",
"reference": "tags/1.0.0"
},
"dist": {
"type": "zip",
"url": "https://downloads.wordpress.org/plugin/menu-item-custom-fields.1.0.0.zip",
"reference": null,
"shasum": null
},
"require": {
"composer/installers": "~1.0"
},
"type": "wordpress-plugin",
"homepage": "https://wordpress.org/plugins/menu-item-custom-fields/"
},
{
"name": "wpackagist-plugin/really-simple-captcha",
"version": "2.0.1",
@@ -265,6 +285,26 @@
},
"type": "wordpress-plugin",
"homepage": "https://wordpress.org/plugins/toggle-wpautop/"
},
{
"name": "wpackagist-plugin/wp-rest-api-v2-menus",
"version": "0.3.1",
"source": {
"type": "svn",
"url": "https://plugins.svn.wordpress.org/wp-rest-api-v2-menus/",
"reference": "tags/0.3.1"
},
"dist": {
"type": "zip",
"url": "https://downloads.wordpress.org/plugin/wp-rest-api-v2-menus.0.3.1.zip",
"reference": null,
"shasum": null
},
"require": {
"composer/installers": "~1.0"
},
"type": "wordpress-plugin",
"homepage": "https://wordpress.org/plugins/wp-rest-api-v2-menus/"
}
],
"packages-dev": [],

View File

@@ -5,4 +5,7 @@ define( 'DB_USER', 'local_db_user' );
define( 'DB_PASSWORD', 'local_db_password' );
define( 'DB_HOST', 'local_db_host' );
define('DOMAIN_CURRENT_SITE', 'local_domain_current_site');
define('DOMAIN_CURRENT_SITE', 'local_domain_current_site');
define('LAWCARTA_SUBDOMAIN', 'app');
define('LAWCARTA_PORT', '');

View File

@@ -1,78 +1,81 @@
<?php
/**
* The base configuration for WordPress
*
* The wp-config.php creation script uses this file during the
* installation. You don't have to use the web site, you can
* copy this file to "wp-config.php" and fill in the values.
*
* This file contains the following configurations:
*
* * MySQL settings
* * Secret keys
* * Database table prefix
* * ABSPATH
*
* @link https://codex.wordpress.org/Editing_wp-config.php
*
* @package WordPress
*/
if ( file_exists( dirname( __FILE__ ) . '/wp-config-local.php' ) ) {
include( dirname( __FILE__ ) . '/wp-config-local.php' );
} else {
define('DB_NAME', getenv('DB_NAME'));
define('DB_USER', getenv('DB_USER'));
define('DB_PASSWORD', getenv('DB_PASSWORD'));
define('DB_HOST', getenv('DB_HOST'));
define('WP_LOCAL_DEV', true);
define('WP_DEBUG', true);
define('DOMAIN_CURRENT_SITE', 'lawcarta.loc');
}
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');
/** Multisite */
define('WP_ALLOW_MULTISITE', true);
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
define('SUNRISE', 'on');
/**
* Authentication Unique Keys and Salts.
*
* Change these to different unique phrases!
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
* You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
*
* @since 2.6.0
*/
define('AUTH_KEY', 'i*V4B`A#NWjOUQu->3vSB@zE1#gtH4#02;1q,t[Wzd%1C&$K+-k2yXFz-r3LSR<#');
define('SECURE_AUTH_KEY', ':*S8U~Xl~`+QUWMxDp%1e?7`:-nt9Ccz@.d0o Y/)LRJCls&r[:zl]+NeUxu1V|v');
define('LOGGED_IN_KEY', 'GG&iWQx&fPj6Q]lx*Ts1F!QNKV:qVVRS&Y-P/-NN!|4wrz:_*EQcXIuy};piV|-e');
define('NONCE_KEY', '|kLD9iG,F/kw,225&|VZNH(VoE[&{EDQkb7YA0h<{N`2}I7 }=8qdGl&OeD[UzBk');
define('AUTH_SALT', '2TMhC58*(LTTaPdK8:hWl6+yCV-]p%M-*HN$]:HZ7,y|P3ew-$D( i}.|r+<VXH|');
define('SECURE_AUTH_SALT', '?~*:ck|!M_@:CV- )quHp50vcN<;72q*j5u+YD%3DpM.-L/p|3QYQP|N/78KKmSo');
define('LOGGED_IN_SALT', '1X?t.RE+q@V?X*0PxOxwzehc)_vTk,y/nc5;bWXBD|H6UFM5OiWS6X[]i|vg}Au8');
define('NONCE_SALT', '3!Fc.@gSB}&Q2lr[HRx^K}+p[wx!RaC496P ^U/fsgcP_>QCOVoicd@234)D$L/5');
/**
* WordPress Database Table prefix.
*
* You can have multiple installations in one database if you give each
* a unique prefix. Only numbers, letters, and underscores please!
*/
$table_prefix = 'wp_';
/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');
/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');
<?php
/**
* The base configuration for WordPress
*
* The wp-config.php creation script uses this file during the
* installation. You don't have to use the web site, you can
* copy this file to "wp-config.php" and fill in the values.
*
* This file contains the following configurations:
*
* * MySQL settings
* * Secret keys
* * Database table prefix
* * ABSPATH
*
* @link https://codex.wordpress.org/Editing_wp-config.php
*
* @package WordPress
*/
if ( file_exists( dirname( __FILE__ ) . '/wp-config-local.php' ) ) {
include( dirname( __FILE__ ) . '/wp-config-local.php' );
} else {
define('DB_NAME', getenv('DB_NAME'));
define('DB_USER', getenv('DB_USER'));
define('DB_PASSWORD', getenv('DB_PASSWORD'));
define('DB_HOST', getenv('DB_HOST'));
define('WP_LOCAL_DEV', true);
define('WP_DEBUG', true);
define('DOMAIN_CURRENT_SITE', 'lawcarta.loc');
define('LAWCARTA_SUBDOMAIN', '');
define('LAWCARTA_PORT', '8080');
}
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');
/** Multisite */
define('WP_ALLOW_MULTISITE', true);
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
define('SUNRISE', 'on');
/**
* Authentication Unique Keys and Salts.
*
* Change these to different unique phrases!
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
* You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
*
* @since 2.6.0
*/
define('AUTH_KEY', 'i*V4B`A#NWjOUQu->3vSB@zE1#gtH4#02;1q,t[Wzd%1C&$K+-k2yXFz-r3LSR<#');
define('SECURE_AUTH_KEY', ':*S8U~Xl~`+QUWMxDp%1e?7`:-nt9Ccz@.d0o Y/)LRJCls&r[:zl]+NeUxu1V|v');
define('LOGGED_IN_KEY', 'GG&iWQx&fPj6Q]lx*Ts1F!QNKV:qVVRS&Y-P/-NN!|4wrz:_*EQcXIuy};piV|-e');
define('NONCE_KEY', '|kLD9iG,F/kw,225&|VZNH(VoE[&{EDQkb7YA0h<{N`2}I7 }=8qdGl&OeD[UzBk');
define('AUTH_SALT', '2TMhC58*(LTTaPdK8:hWl6+yCV-]p%M-*HN$]:HZ7,y|P3ew-$D( i}.|r+<VXH|');
define('SECURE_AUTH_SALT', '?~*:ck|!M_@:CV- )quHp50vcN<;72q*j5u+YD%3DpM.-L/p|3QYQP|N/78KKmSo');
define('LOGGED_IN_SALT', '1X?t.RE+q@V?X*0PxOxwzehc)_vTk,y/nc5;bWXBD|H6UFM5OiWS6X[]i|vg}Au8');
define('NONCE_SALT', '3!Fc.@gSB}&Q2lr[HRx^K}+p[wx!RaC496P ^U/fsgcP_>QCOVoicd@234)D$L/5');
/**
* WordPress Database Table prefix.
*
* You can have multiple installations in one database if you give each
* a unique prefix. Only numbers, letters, and underscores please!
*/
$table_prefix = 'wp_';
/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');
/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');

File diff suppressed because one or more lines are too long

View File

@@ -1,3 +1,8 @@
<?php
require_once 'inc/walker-nav-menu.php';
?>
</div><!-- .content -->
<footer>
@@ -10,18 +15,25 @@
'container' => 'div',
'container_class' => 'footer-menu',
'depth' => 1,
'walker' => new LawCarta_Walker_Nav_Menu(),
'theme_location' => 'bottom',
]);
}
if (has_nav_menu('social')):
if (has_nav_menu('social')) {
wp_nav_menu([
'menu' => 'social',
'menu_class' => 'nav',
'container' => 'div',
'container_class' => 'footer-social',
'depth' => 1,
'walker' => new LawCarta_Walker_Nav_Menu(),
'hide_title' => true,
'item_wrap' => '',
'items_wrap' => '%3$s',
'theme_location' => 'social',
]);
}
?>
<div class="footer-social">
<!--
<a href="#" class="twitter"><span class="icon-twitter"></span></a>
<a href="#" class="facebook"><span class="icon-facebook"></span></a>
-->
</div>
<?php endif; ?>
</div>
<div class="footer-copyright">&copy; <?= get_option('lawcarta_company'); ?>. All rights reserved.</div>
</div>

View File

@@ -1,4 +1,6 @@
<?php
require 'inc/menu-item-custom-fields.php';
/**
* Setup WordPress
*/
@@ -73,24 +75,20 @@ add_action('wp_enqueue_scripts', function () {
/**
* Filter Menu Item Class
*/
add_filter('nav_menu_item_args', function ($args, $item) {
$classes = get_post_meta($item->ID, '_menu_item_classes', true);
if (is_array($classes)) {
$classes = array_filter($classes);
if (count($classes) > 0) {
$args->link_before = '<i class="' . implode(' ', $classes) . '"></i> ';
}
}
return $args;
}, 10, 2);
add_filter('wp_setup_nav_menu_item', function ($menu_item)
{
$meta = LawCarta_Menu_Item_Custom_Fields::getMeta($menu_item);
$menu_item->meta = $meta;
add_filter('nav_menu_css_class', function ($classes, $item, $args) {
$classes = [];
if ($args->theme_location === 'bottom' && in_array('current-menu-item', $classes)) {
$classes[] = 'active';
$menu_item->meta['type'] = $menu_item->object;
if ($menu_item->object == 'page') {
$menu_item->meta['slug'] = get_post_field( 'post_name', $menu_item->object_id );
} else if ($menu_item->object == 'media_category') {
$menu_item->meta['slug'] = get_term_field( 'slug', $menu_item->object_id );
}
return $classes;
}, 10, 3);
return $menu_item;
});
/**
* Setup Admin Portal

View File

@@ -1,3 +1,33 @@
<?php
require_once 'inc/walker-nav-menu.php';
$urlParts = parse_url(home_url());
$scheme = isset($urlParts['scheme']) ? $urlParts['scheme'] . '://' : '';
$host = isset($urlParts['host']) ? $urlParts['host'] : '';
if (defined('LAWCARTA_SUBDOMAIN')) {
$hostParts = explode('.', $host);
if (count($hostParts) === 3) {
array_shift($hostParts);
}
if (!empty(LAWCARTA_SUBDOMAIN)) {
array_unshift($hostParts, LAWCARTA_SUBDOMAIN);
}
$host = implode('.', $hostParts);
}
$port = isset($urlParts['port']) ? $urlParts['port'] : '';
if (defined('LAWCARTA_PORT')) {
$port = LAWCARTA_PORT;
}
if (!empty($port)) {
$port = ':' . $port;
}
$lawCartaUrl = "$scheme$host$port";
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
@@ -20,7 +50,7 @@
<div class="wrapper">
<header>
<div class="cont">
<div id="header-menu" class="cont">
<a href="<?= site_url(); ?>" class="main-logo"><img src="<?= get_theme_file_uri('/assets/img/logo.png'); ?>"></a>
<?php
@@ -31,11 +61,24 @@
'container' => 'div',
'container_class' => 'header-menu',
'depth' => 1,
'walker' => new LawCarta_Walker_Nav_Menu(),
'icon_wrap' => 'i',
'theme_location' => 'top',
]);
}
?>
</div>
<iframe src="<?= $lawCartaUrl ?>/menu" style="display: none;"></iframe>
<script type="application/javascript">
var eventMethod = window.addEventListener ? "addEventListener" : "attachEvent";
var eventer = window[eventMethod];
var messageEvent = eventMethod === "attachEvent" ? "onmessage" : "message";
eventer(messageEvent, function (ev) {
if (ev.origin.indexOf('<?= $lawCartaUrl ?>') !== -1) {
document.getElementById('header-menu').insertAdjacentHTML('beforeend', ev.data);
}
});
</script>
</header>
<div class="content">

View File

@@ -0,0 +1,159 @@
<?php
/**
* Menu item custom fields example
*
* Copy this file into your wp-content/mu-plugins directory.
*
* @package Menu_Item_Custom_Fields_Example
* @version 0.2.0
* @author Dzikri Aziz <kvcrvt@gmail.com>
*
*
* Plugin name: Menu Item Custom Fields Example
* Plugin URI: https://github.com/kucrut/wp-menu-item-custom-fields
* Description: Example usage of Menu Item Custom Fields in plugins/themes
* Version: 0.2.0
* Author: Dzikri Aziz
* Author URI: http://kucrut.org/
* License: GPL v2
* Text Domain: menu-item-custom-fields-example
*/
/**
* Sample menu item metadata
*
* This class demonstrate the usage of Menu Item Custom Fields in plugins/themes.
*
* @since 0.1.0
*/
class LawCarta_Menu_Item_Custom_Fields {
/**
* Holds our custom fields
*
* @var array
* @access protected
* @since Menu_Item_Custom_Fields_Example 0.2.0
*/
protected static $fields = array();
protected static $templates = [
'text' => '<label for="%1$s">%2$s<br /><input type="text" id="%1$s" class="widefat %1$s" name="%3$s" value="%4$s" /></label>',
];
/**
* Initialize plugin
*/
public static function init() {
add_action( 'wp_nav_menu_item_custom_fields', array( __CLASS__, '_fields' ), 10, 4 );
add_action( 'wp_update_nav_menu_item', array( __CLASS__, '_save' ), 10, 3 );
self::$fields = array(
'a-classes' => [
'label' => __('Anchor Classes', 'lawcarta'),
'type' => 'text'
],
'icon-classes' => [
'label' => __('Icon Classes', 'lawcarta'),
'type' => 'text'
],
);
}
/**
* Save custom field value
*
* @wp_hook action wp_update_nav_menu_item
*
* @param int $menu_id Nav menu ID
* @param int $menu_item_db_id Menu item ID
* @param array $menu_item_args Menu item data
*/
public static function _save( $menu_id, $menu_item_db_id, $menu_item_args ) {
if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
return;
}
check_admin_referer( 'update-nav_menu', 'update-nav-menu-nonce' );
foreach ( self::$fields as $field => $config ) {
$key = sprintf( 'menu-item-%s', $field );
// Sanitize
if ( ! empty( $_POST[ $key ][ $menu_item_db_id ] ) ) {
$value = $_POST[ $key ][ $menu_item_db_id ];
if ($config['type'] === 'checkbox') {
$value = (bool) $value;
}
} else {
$value = null;
}
// Update
if ( ! is_null( $value ) ) {
update_post_meta( $menu_item_db_id, $key, $value );
} else {
delete_post_meta( $menu_item_db_id, $key );
}
}
}
/**
* Print field
*
* @param object $item Menu item data object.
* @param int $depth Depth of menu item. Used for padding.
* @param array $args Menu item args.
* @param int $id Nav menu ID.
*
* @return string Form fields
*/
public static function _fields( $id, $item, $depth, $args ) {
foreach ( self::$fields as $field => $config ) :
$key = sprintf( 'menu-item-%s', $field );
$id = sprintf( 'edit-%s-%s', $key, $item->ID );
$name = sprintf( '%s[%s]', $key, $item->ID );
$value = get_post_meta( $item->ID, $key, true );
$class = sprintf( 'field-%s', $field );
$extra = '';
if ($config['type'] === 'checkbox') {
if ($value) {
$extra = 'checked="checked"';
}
$value = 1;
}
?>
<p class="description description-wide <?php echo esc_attr( $class ) ?>">
<?php printf(
self::$templates[$config['type']],
esc_attr( $id ),
esc_html( $config['label'] ),
esc_attr( $name ),
esc_attr( $value ),
$extra
) ?>
</p>
<?php
endforeach;
}
public static function getMeta($item)
{
$meta = [];
foreach ( self::$fields as $field => $config ) {
$key = sprintf( 'menu-item-%s', $field );
$value = get_post_meta( $item->ID, $key, true );
if (!empty($value)) {
if ($config['type'] === 'checkbox') {
$value = (bool) $value;
}
$meta[$field] = $value;
}
}
return $meta;
}
}
LawCarta_Menu_Item_Custom_Fields::init();

View File

@@ -0,0 +1,195 @@
<?php
class LawCarta_Walker_Nav_Menu extends Walker_Nav_Menu
{
/**
* Starts the element output.
*
* @since 3.0.0
* @since 4.4.0 The {@see 'nav_menu_item_args'} filter was added.
*
* @see Walker::start_el()
*
* @param string $output Used to append additional content (passed by reference).
* @param WP_Post $item Menu item data object.
* @param int $depth Depth of menu item. Used for padding.
* @param stdClass $args An object of wp_nav_menu() arguments.
* @param int $id Current item ID.
*/
public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
if ( isset( $args->item_spacing ) && 'discard' === $args->item_spacing ) {
$t = '';
$n = '';
} else {
$t = "\t";
$n = "\n";
}
$indent = ( $depth ) ? str_repeat( $t, $depth ) : '';
//var_dump($item);
$classes = get_post_meta($item->ID, '_menu_item_classes', true);
if (is_array($classes)) {
$classes = array_filter($classes);
} else {
$classes = [];
}
/**
* Filters the arguments for a single nav menu item.
*
* @since 4.4.0
*
* @param stdClass $args An object of wp_nav_menu() arguments.
* @param WP_Post $item Menu item data object.
* @param int $depth Depth of menu item. Used for padding.
*/
$args = apply_filters( 'nav_menu_item_args', $args, $item, $depth );
/**
* Filters the CSS class(es) applied to a menu item's list item element.
*
* @since 3.0.0
* @since 4.1.0 The `$depth` parameter was added.
*
* @param array $classes The CSS classes that are applied to the menu item's `<li>` element.
* @param WP_Post $item The current menu item.
* @param stdClass $args An object of wp_nav_menu() arguments.
* @param int $depth Depth of menu item. Used for padding.
*/
$class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args, $depth ) );
$class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : '';
/**
* Filters the ID applied to a menu item's list item element.
*
* @since 3.0.1
* @since 4.1.0 The `$depth` parameter was added.
*
* @param string $menu_id The ID that is applied to the menu item's `<li>` element.
* @param WP_Post $item The current menu item.
* @param stdClass $args An object of wp_nav_menu() arguments.
* @param int $depth Depth of menu item. Used for padding.
*/
$id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item->ID, $item, $args, $depth );
$id = $id ? ' id="' . esc_attr( $id ) . '"' : '';
$itemWrap = isset($args->item_wrap) ? $args->item_wrap : 'li';
if (!empty($itemWrap)) {
$output .= $indent . '<' . $itemWrap . $id . $class_names .'>';
} else {
$output .= $indent;
}
$atts = array();
$atts['title'] = ! empty( $item->attr_title ) ? $item->attr_title : '';
$atts['target'] = ! empty( $item->target ) ? $item->target : '';
$atts['rel'] = ! empty( $item->xfn ) ? $item->xfn : '';
$atts['href'] = ! empty( $item->url ) ? $item->url : '';
$atts['class'] = !empty($item->meta['a-classes']) ? $item->meta['a-classes'] : '';
/**
* Filters the HTML attributes applied to a menu item's anchor element.
*
* @since 3.6.0
* @since 4.1.0 The `$depth` parameter was added.
*
* @param array $atts {
* The HTML attributes applied to the menu item's `<a>` element, empty strings are ignored.
*
* @type string $title Title attribute.
* @type string $target Target attribute.
* @type string $rel The rel attribute.
* @type string $href The href attribute.
* }
* @param WP_Post $item The current menu item.
* @param stdClass $args An object of wp_nav_menu() arguments.
* @param int $depth Depth of menu item. Used for padding.
*/
$atts = apply_filters( 'nav_menu_link_attributes', $atts, $item, $args, $depth );
$attributes = '';
foreach ( $atts as $attr => $value ) {
if ( ! empty( $value ) ) {
$value = ( 'href' === $attr ) ? esc_url( $value ) : esc_attr( $value );
$attributes .= ' ' . $attr . '="' . $value . '"';
}
}
/** This filter is documented in wp-includes/post-template.php */
$title = apply_filters( 'the_title', $item->title, $item->ID );
/**
* Filters a menu item's title.
*
* @since 4.4.0
*
* @param string $title The menu item's title.
* @param WP_Post $item The current menu item.
* @param stdClass $args An object of wp_nav_menu() arguments.
* @param int $depth Depth of menu item. Used for padding.
*/
$title = apply_filters( 'nav_menu_item_title', $title, $item, $args, $depth );
$icon = '';
$iconClasses = !empty($item->meta['icon-classes']) ? $item->meta['icon-classes'] : '';
if (!empty($iconClasses)) {
$iconEl = !empty($args->icon_wrap) ? $args->icon_wrap : 'span';
$icon = '<' . $iconEl . ' class="' . $iconClasses . '"></' . $iconEl . '>';
}
if (isset($args->hide_title) && $args->hide_title === true) {
$title = '';
}
$item_output = $args->before;
$item_output .= '<a'. $attributes .'>';
$item_output .= $args->link_before . $icon . $title . $args->link_after;
$item_output .= '</a>';
$item_output .= $args->after;
/**
* Filters a menu item's starting output.
*
* The menu item's starting output only includes `$args->before`, the opening `<a>`,
* the menu item's title, the closing `</a>`, and `$args->after`. Currently, there is
* no filter for modifying the opening and closing `<li>` for a menu item.
*
* @since 3.0.0
*
* @param string $item_output The menu item's starting HTML output.
* @param WP_Post $item Menu item data object.
* @param int $depth Depth of menu item. Used for padding.
* @param stdClass $args An object of wp_nav_menu() arguments.
*/
$output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
}
/**
* Ends the element output, if needed.
*
* @since 3.0.0
*
* @see Walker::end_el()
*
* @param string $output Used to append additional content (passed by reference).
* @param WP_Post $item Page data object. Not used.
* @param int $depth Depth of page. Not Used.
* @param stdClass $args An object of wp_nav_menu() arguments.
*/
public function end_el( &$output, $item, $depth = 0, $args = array() ) {
if ( isset( $args->item_spacing ) && 'discard' === $args->item_spacing ) {
$t = '';
$n = '';
} else {
$t = "\t";
$n = "\n";
}
$itemWrap = isset($args->item_wrap) ? $args->item_wrap : 'li';
if (!empty($itemWrap)) {
$output .= "</$itemWrap>{$n}";
} else {
$output .= "{$n}";
}
}
}

View File

@@ -339,6 +339,22 @@ h1, .sign-page h1 {
.top-panel h1 {
color: #fff; }
.student-casebook-title .sct-bg {
background: #fff; }
.casebook-top-options .dropdown .button.xl.white {
background: none;
border: 2px solid #fff;
color: #fff;
font-weight: 600;
line-height: 30px; }
.casebook-top-options .dropdown span {
color: #fff; }
.casebook-top-options .dropdown .casebook-options:after, .casebook-top-options .dropdown .casebook-options:before, .casebook-top-options .dropdown .casebook-options i {
background: #fff; }
.casebook-item .casebook-bottom .casebook-title {
color: #475669; }