This topic has 4 replies, 3 voices, and was last updated 8 years by Radu.

  • Author
  • #137030
     Kida
    Participant

    Hello team!

     

    I’m trying to create a custom post type with views on the front end using Toolset Type and Toolset Views.

    I’d like to integrate the Kleo framework to it and would need the following info:

     

    The Argument $framework_data is a array, that needs the following info:

    ‘name’
    This is an optional string containing the display name that will be used to refer to the framework.
    If it is missing, Views will use the framework_id instead.

    ‘api_mode’ is a mandatory string that states the way that the framework gets the value for each of its options.
    Some frameworks have a dedicated function for this
    (so they should pass ‘function’ here as the value).
    Some other frameworks just store their data in a serialized array in the WordPress options, so they should pass ‘option’ here as the value.
    So, the value here can either ‘function’ or ‘option’

    How the Framework gets its values, should be queried in the Support Forums of the Framework Provider.

    ‘api_handler’ is a mandatory string that complements the api_mode one.
    It should contain the relevant data on the selected mode.
    In case the framework has a dedicated function (‘function’ in ‘api_mode’) to get option values,
    api_handler should be that function’s name (example: ot_get_option).
    If the framework just accesses a serialized array stored as a WordPress option (‘option’ in ‘api_mode’),
    the key of that option should be passed here.

    Depending on how the Framework gets its values, here you should either enter the Functions Name or the Options Key should be entered here.
    The Framework Provider will be able to pass your this information.

    This is for the following code :

     

    add_action( 'init', 'wpv_dummy_framework_api' );
      
    function wpv_dummy_framework_api() {
        $framework_id = 'OptionTree'; //This is actually unique value and can be anything.
        $framework_data = array(
            'name' => __( 'OptionTree' ), //This is actually optional value and can be anything.
            'api_mode' => 'option', //Your framework provider states: "We use the options table"
            'api_handler' => 'of_get_option', //Your Framework provider states "We use of_get_option"
        );
        if ( function_exists( 'wpv_api_register_framework' ) ) {
            wpv_api_register_framework( $framework_id, $framework_data );
        }
    }

    Thanks in advance!

    #137124
     Laura
    Moderator

    Hello, will assign the ticket to a higher support level who can help and advise you in your query.
    Thanks! ?

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #137191
     Radu
    Moderator

    Hi,

    Before running the function with the next details please perform a database backup.

    I’ve placed the new values directly in function

    COPY CODE
    
    add_action( 'init', 'wpv_dummy_framework_api' );
      
    function wpv_dummy_framework_api() {
        $framework_id = 'kleo_framework'; //This is actually unique value and can be anything.
        $framework_data = array(
            'name' => __( 'kleo_framework' ), //This is actually optional value and can be anything.
            'api_mode' => 'option', //Your framework provider states: "We use the options table"
            'api_handler' => 'sq_option', //Your Framework provider states "We use of_get_option"
        );
        if ( function_exists( 'wpv_api_register_framework' ) ) {
            wpv_api_register_framework( $framework_id, $framework_data );
        }
    }
    

    According to the documentation that you have provided instead of kleo_framework you can write anything you need but that’s is our framework domain name.

    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #137262
     Kida
    Participant

    Thanks a lot Radu!

    #137317
     Radu
    Moderator

    You’re welcome

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 5 posts - 1 through 5 (of 5 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?