How to load MetaBox only for backend

Support General How to load MetaBox only for backend

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #5990
    JackkyJackky
    Participant

    Hi! I have lot's of queries from metabox on front: http://clip2net.com/s/3L1Inic
    But I want to load it only for backend, because I don't use any built-in functions for frontend - only native WP.

    #5991
    JackkyJackky
    Participant

    *forum gives wrong category. This is general question.

    #5997
    Anh TranAnh Tran
    Keymaster

    If you want to run Meta Box only in the backend, you can wrap the code to register meta box within if ( is_admin() ), like this:

    if ( is_admin() ) {
        add_filter( 'rwmb_meta_boxes', 'your_function' );
    }

    Please note that this code will break helper functions to get meta values in the frontend. So please use with care.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘How to load MetaBox only for backend’ is closed to new replies.