Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




wp_ajax_menu_get_metabox [ WordPress Function ]

wp_ajax_menu_get_metabox ( No parameters )
Defined at:



No description yet.

Source


<?php
function wp_ajax_menu_get_metabox() {
    if ( ! 
current_user_can'edit_theme_options' ) )
        
wp_die( -);

    require_once 
ABSPATH 'wp-admin/includes/nav-menu.php';

    if ( isset( 
$_POST['item-type'] ) && 'post_type' == $_POST['item-type'] ) {
        
$type 'posttype';
        
$callback 'wp_nav_menu_item_post_type_meta_box';
        
$items = (array) get_post_types( array( 'show_in_nav_menus' => true ), 'object' );
    } elseif ( isset( 
$_POST['item-type'] ) && 'taxonomy' == $_POST['item-type'] ) {
        
$type 'taxonomy';
        
$callback 'wp_nav_menu_item_taxonomy_meta_box';
        
$items = (array) get_taxonomies( array( 'show_ui' => true ), 'object' );
    }

    if ( ! empty( 
$_POST['item-object'] ) && isset( $items[$_POST['item-object']] ) ) {
        
$item apply_filters'nav_menu_meta_box_object'$items$_POST['item-object'] ] );
        
ob_start();
        
call_user_func_array($callback, array(
            
null,
            array(
                
'id' => 'add-' $item->name,
                
'title' => $item->labels->name,
                
'callback' => $callback,
                
'args' => $item,
            )
        ));

        
$markup ob_get_clean();

        echo 
json_encode(array(
            
'replace-id' => $type '-' $item->name,
            
'markup' => $markup,
        ));
    }

    
wp_die();
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics