Forum Replies Created

Viewing 1 replies (of 1 total)
  • modify the function i123_widgets_custom_fields_add() and per page widgets will work with custom post types

    function i123_widgets_custom_fields_add() {
    i123_widgets_admin_init();
    add_meta_box( 'i123_widgets_custom_fields', __('Per Page Widgets', 'i123_widgets'), 'i123_widgets_custom_fields_controllbox', 'post', 'side', 'high' );
    add_meta_box( 'i123_widgets_custom_fields', __('Per Page Widgets', 'i123_widgets'), 'i123_widgets_custom_fields_controllbox', 'page', 'side', 'high' );
    $args=array(
    'public' => true,
    '_builtin' => false
    );
    $operator = "and"; //'and or 'or'
    $output = "names"; //names or objects - names is default
    $post_types = get_post_types($args,$output,$operator);
    foreach($post_types as $post_type) {
    add_meta_box( 'i123_widgets_custom_fields', __('Per Page Widgets', 'i123_widgets'), 'i123_widgets_custom_fields_controllbox', $post_type, 'side', 'high' );
    }
    }
Viewing 1 replies (of 1 total)