'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';
}
?>