12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- <?php
- if ( ! defined( 'ABSPATH' ) ) {
- exit;
- }
- if ( ! class_exists( 'ACF_Walker_Nav_Menu_Edit' ) ) :
- class ACF_Walker_Nav_Menu_Edit extends Walker_Nav_Menu_Edit {
-
- function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
-
- $item_output = '';
-
- parent::start_el( $item_output, $item, $depth, $args, $id );
-
- $output .= preg_replace(
-
- '/(?=<(fieldset|p)[^>]+class="[^"]*field-move)/',
- $this->get_fields( $item, $depth, $args, $id ),
- $item_output
- );
- }
-
- function get_fields( $item, $depth, $args = array(), $id = 0 ) {
- ob_start();
-
- do_action( 'wp_nav_menu_item_custom_fields', $item->ID, $item, $depth, $args, $id );
- return ob_get_clean();
- }
- }
- endif;
|