Custom Fields
Re-Envisioned
Support Meta Box AIO Filter mb_aoi_extensions fails unless at least one item checked in "All-In-One"

This topic contains 12 replies, has 3 voices, and was last updated by  criv23 1 week, 3 days ago.

  • Creator
    Topic
  • #12811

    Theodore Darling
    Participant

    First, if there are no modules checked in the “all-in-one” settings page, then the filter “mb_aio_extensions” never gets called. I’ll add my code change below that makes this work for me.

    Next, even if the options are changed in the filter, they don’t show as checked for the page.

    Finally, every time I un-check the dashboard, it just returns filled back in.

    Here is the code that I changed in the file class-mb-aio-loader.php that shows the content in the menu, but it doesn’t check the boxes. Maybe it can be updated in the next version. Original code commented out.

    
            public function load_premium_extensions() {
            $option = get_option( 'meta_box_aio' );
    
            // Change the commented below to this. Otherwise, unless there is an extension already selected,
            // the code below will never call the filter.
            // Allows developers to filter the list of premium extensions.
            $extensions = apply_filters( 'mb_aio_extensions', $option['extensions'] );
            
            if ( ! is_array( $extensions ) || empty( $extensions ) ) {
                return;
            }
            foreach ( $extensions as $extension ) {
                require_once dirname( __FILE__ ) . "/extensions/$extension/$extension.php";
            }
            
            /*
            $option = get_option( 'meta_box_aio' );
    
                    if ( empty( $option['extensions'] ) ) {
                return;
            }
    
            // Allows developers to filter the list of premium extensions.
            $extensions = apply_filters( 'mb_aio_extensions', $option['extensions'] );
            
            if ( ! is_array( $extensions ) ) {
                return;
            }
            foreach ( $extensions as $extension ) {
                require_once dirname( __FILE__ ) . "/extensions/$extension/$extension.php";
            }*/
        }
    
Viewing 2 replies - 11 through 12 (of 12 total)
  • Author
    Replies
  • #12983

    Anh Tran
    Keymaster

    Hi criv23,

    In the callback filter mb_aio_extension, can you change the code to return $extensions instead of $option and see if it works?

    #12987

    criv23
    Participant

    Hi Anh,

    Switching option to extensions also works in 1.6.17.

Viewing 2 replies - 11 through 12 (of 12 total)

You must be logged in to reply to this topic.