*/ require_once ABSPATH . 'wp-admin/includes/nav-menu.php'; $admin_interface = new DSAMM_Admin_Interface(); $admin_interface->dsamm_menu_container_print(); // Load all the nav menu interface functions function dsamm_accordion_sections_own( $screen, $context, $object ) { include plugin_dir_path( __FILE__ ) . 'include/popup_add_menu_content.php'; } /** * */ function wpml_wp_get_nav_menus() { $allMenus = wp_get_nav_menus(); $menusCurrentLang = []; if ( !empty($allMenus) ) { foreach ( $allMenus as $menu ) { $translatedMenuID = apply_filters( 'wpml_object_id', $menu->term_id, 'nav_menu', false ); if ( $translatedMenuID === $menu->term_id ) { $menusCurrentLang[$translatedMenuID] = $menu; } } } return array_values( $menusCurrentLang ); } /** * Displays a metabox for the custom links menu item. * * @since 3.0.0 * * @global int $_nav_menu_placeholder * @global int|string $nav_menu_selected_id */ function dsamm_nav_menu_item_link_meta_box_own() { global $_nav_menu_placeholder, $nav_menu_selected_id ; $_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ? $_nav_menu_placeholder - 1 : -1 ); // phpcs:ignore ?>

class="button-secondary submit-add-to-menu right" value="" name="add-custom-menu-item" id="submit-customlinkdiv" />

name; // Paginate browsing for large numbers of post objects. //post per page dynamic $post_per_page = get_option( 'amm_' . $post_type_name ); if ( empty($post_per_page) ) { $post_per_page = get_option( 'amm_post_perpage_default' ); } if ( empty($post_per_page) ) { $post_per_page = '50'; } $per_page = (int) $post_per_page; $pagenum = ( isset( $_REQUEST[$post_type_name . '-tab'] ) && isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 1 ); // phpcs:ignore $offset = ( 0 < $pagenum ? $per_page * ($pagenum - 1) : 0 ); $args = array( 'offset' => $offset, 'order' => 'ASC', 'orderby' => 'title', 'posts_per_page' => $per_page, 'post_type' => $post_type_name, 'suppress_filters' => false, 'update_post_term_cache' => false, 'update_post_meta_cache' => false, ); if ( isset( $post_type['args']->_default_query ) ) { $args = array_merge( $args, (array) $post_type['args']->_default_query ); } // @todo transient caching of these results with proper invalidation on updating of a post of this type $get_posts = new WP_Query(); $posts = $get_posts->query( $args ); $get_posts_for_count = new WP_Query( $args ); $total_page_count = $get_posts_for_count->found_posts; $db_fields = false; if ( is_post_type_hierarchical( $post_type_name ) ) { $db_fields = array( 'parent' => 'post_parent', 'id' => 'ID', ); } $walker = new DSAMM_Walker_Nav_Menu_Checklist( $db_fields ); $current_tab = 'all'; if ( isset( $_REQUEST[$post_type_name . '-tab'] ) && in_array( $_REQUEST[$post_type_name . '-tab'], array( 'all', 'search' ) ) ) { // phpcs:ignore $current_tab = sanitize_text_field( $_REQUEST[$post_type_name . '-tab'] ); // phpcs:ignore } $removed_args = array( 'action', 'customlink-tab', 'edit-menu-item', 'menu-item', 'page-tab', '_wpnonce' ); $editor_id = 'amm_post_' . $post_type_name; ?>
    $data_cat ) { echo '
  • ' . esc_html( $data_cat ) . '
  • ' ; } ?>

'strong,em,italic,b-quote,img,close,del,ins,ul,li,ol,code,spell,more,fullscreen', ); $tinymce_buttons = array( 'toolbar1' => 'bold,italic,strikethrough,bullist,numlist,blockquote,hr,alignleft,aligncenter,alignright,wp_more,spellchecker,dfw,', 'toolbar2' => "formatselect,underline,alignjustify,forecolor,removeformat,outdent,indent", 'toolbar3' => "", 'toolbar4' => "", ); $settings = array( 'textarea_name' => 'amm_post_content_add', 'media_buttons' => false, 'editor_class' => 'amm-post-page-content', 'tinymce' => $tinymce_buttons, 'quicktags' => false, 'textarea_rows' => 20, ); wp_editor( '', $editor_id, $settings ); ?>
"/> label) ) { $newpage_lable = 'Add New ' . $post_type['args']->label; } } ?>
front_or_home = true; array_unshift( $posts, $front_page_obj ); } else { $_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ? intval( $_nav_menu_placeholder ) - 1 : -1 ); // phpcs:ignore } } $post_type = get_post_type_object( $post_type_name ); $archive_link = get_post_type_archive_link( $post_type_name ); if ( $post_type->has_archive ) { $_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ? intval( $_nav_menu_placeholder ) - 1 : -1 ); // phpcs:ignore array_unshift( $posts, (object) array( 'ID' => 0, 'object_id' => $_nav_menu_placeholder, 'object' => $post_type_name, 'post_content' => '', 'post_excerpt' => '', 'post_title' => $post_type->labels->archives, 'post_type' => 'nav_menu_item', 'type' => 'post_type_archive', 'url' => get_post_type_archive_link( $post_type_name ), ) ); } /** * Filter the posts displayed in the 'View All' tab of the current * post type's menu items meta box. * * The dynamic portion of the hook name, `$post_type_name`, refers * to the slug of the current post type. * * @since 3.2.0 * * @see WP_Query::query() * * @param array $posts The posts for the current post type. * @param array $args An array of WP_Query arguments. * @param object $post_type The current post type object for this menu item meta box. */ $posts = apply_filters( "nav_menu_items_{$post_type_name}", $posts, $args, $post_type ); $checkbox_items = walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $posts ), 0, (object) $args ); if ( 'all' === $current_tab && !empty($_REQUEST['selectall']) ) { // phpcs:ignore $checkbox_items = preg_replace( '/(type=(.)checkbox(\\2))/', '$1 checked=$2checked$2', $checkbox_items ); } $filter_author = array(); $filter_template = array(); $filter_publish_date = array(); $filter_cate = array(); $template_name_array = array(); $templates_all = get_page_templates(); foreach ( $templates_all as $template_name => $template_filename ) { $template_name_array[$template_filename] = $template_filename; } foreach ( $posts as $post_data ) { if ( isset( $post_data->post_author ) ) { $filter_author[] = $post_data->post_author; } if ( 'page' === $post_data->post_type ) { $tamplate_name = get_post_meta( $post_data->ID, '_wp_page_template', true ); $template_name_key = array_search( $tamplate_name, $template_name_array, true ); if ( !empty($template_name_key) ) { $tamplate_name = $template_name_key; } if ( !empty($tamplate_name) ) { $filter_template[] = $tamplate_name; } else { $filter_template[] = 'default'; } } else { $category_detail = get_the_category( $post_data->ID ); if ( !empty($category_detail) && count( $category_detail ) > 0 ) { $cate_array = array(); foreach ( $category_detail as $cd ) { $filter_cate[] = $cd->cat_name; } } } } if ( count( $filter_author ) > 1 ) { $filter_author = array_unique( $filter_author ); } if ( count( $filter_template ) > 1 ) { $filter_template = array_unique( $filter_template ); } if ( count( $filter_cate ) > 1 ) { $filter_cate = array_unique( $filter_cate ); } $post_data_calss = ''; if ( 'page' !== $post_type_name ) { $post_data_calss = 'post-data-show'; } ?>
    dsamm_allowed_html_tags() ) ; ?> No items. ' ; } ?>

class="button-secondary submit-add-to-menu right" value="" name="add-post-type-menu-item" id="" />

0 ) { ?>

name; // Paginate browsing for large numbers of objects. $post_per_page = get_option( 'amm_' . $taxonomy_name ); if ( empty($post_per_page) ) { $post_per_page = get_option( 'amm_post_perpage_default' ); } if ( empty($post_per_page) ) { $post_per_page = '50'; } $per_page = (int) $post_per_page; $pagenum = ( isset( $_REQUEST[$taxonomy_name . '-tab'] ) && isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 1 ); // phpcs:ignore $offset = ( 0 < $pagenum ? $per_page * ($pagenum - 1) : 0 ); $args = array( 'child_of' => 0, 'hide_empty' => false, 'hierarchical' => 1, 'include' => '', 'number' => $per_page, 'offset' => $offset, 'order' => 'ASC', 'orderby' => 'name', 'pad_counts' => false, ); $terms = get_terms( $taxonomy_name, $args ); if ( !$terms || is_wp_error( $terms ) ) { echo '

' . esc_html__( 'No items.', 'advance-menu-manager' ) . '

' ; return; } $num_pages = ceil( wp_count_terms( $taxonomy_name, array_merge( $args, array( 'number' => '', 'offset' => '', ) ) ) / $per_page ); $total_page_count = wp_count_terms( $taxonomy_name, array_merge( $args, array( 'number' => '', 'offset' => '', ) ) ); $post_type_name = $taxonomy_name; $db_fields = false; if ( is_taxonomy_hierarchical( $taxonomy_name ) ) { $db_fields = array( 'parent' => 'parent', 'id' => 'term_id', ); } $walker = new DSAMM_Walker_Nav_Menu_Checklist( $db_fields ); $removed_args = array( 'action', 'customlink-tab', 'edit-menu-item', 'menu-item', 'page-tab', '_wpnonce' ); ?>

class="button-secondary submit-add-to-menu right" value="" name="add-taxonomy-menu-item" id="" />

0 ) { ?>