• Resolved PDidee

    (@pdidee)


    I have an on/off feature that I’d like to use to turn on some back end custom SEO plugin features. However this code doesn’t seem to work:

    if ( function_exists( 'ot_get_option' ) ) {
    if ( ot_get_option('seo_module') == "on" ) {
    require_once( get_template_directory() . '/framework/extended/seo-module/seo_module.php' );
    }
    }

    Am I missing something?

    https://www.ads-software.com/plugins/option-tree/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter PDidee

    (@pdidee)

    It seems to be an issue trying to use option tree settings to add functionality to the backend. Is this possible?

    Thanks for any help in advance.

    Plugin Author Derek Herman

    (@valendesigns)

    It’s most likely that you need to wrap the whole thing in a filter or action to get it to work.

    function toggle_seo_module() {
      if ( function_exists( 'ot_get_option' ) ) {
        if ( ot_get_option( 'seo_module' ) == 'on' ) {
          require_once( get_template_directory() . '/framework/extended/seo-module/seo_module.php' );
        }
      }
    }
    add_action( 'after_setup_theme', 'toggle_seo_module' );
    Thread Starter PDidee

    (@pdidee)

    Awesome!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘On/Off Feature not working’ is closed to new replies.