Follow us on

Codestar Support Forum » WordPress Plugins » Codestar Framework

Running from theme or plugin

  1. The instructions are super simple to embed in a theme, but it won't load. I actually want to embed it into a plugin I wrote and it won't load there.

    I uploaded the file in the ../inc dir and added the require to the theme. There are not errors in the debug file. Any suggestions?

    Posted 2 years ago #

  2. Codestar
    Admin

    Hi,

    Welcome to support forum and thanks for purchasing.

    Also did you include the your config file ?

    Regards, Codestar

    Posted 2 years ago #
  3. The plugin doesn't load, meaning the the settings page under tools doesn't show, but if I activate the plugin the settings load and I can activate the demo.

    I have added a simple config file you have in your doc, but given that I can get the plugin to load under a theme or as embedded inside my plugin, I stopped bothering.

    From my plugin I have tried requiring the the file ../codestar-framework.ph' and directly requiring the file ../setup.class.php bypassing the your plugin loader file codestar-framework.php.

    Inside my plugin I have tried reaching your loader file(s) by hooking init, plugin_loaded and theme loaded.

    Even if I follow your directions exactly the register your plugin in a theme, I don't get a debug error or the settings link under tools.

    Posted 2 years ago #
  4. Plus if I sabotage the require links, i.e., put a path that does not exist or add a syntax code in the required files the site crashes so I know the require_once's are working and your files are loaded.

    Posted 2 years ago #

  5. Codestar
    Admin

    Hi,

    Let's check your setup, can you send me your theme or project as lite zip. and show me where you want to put settings page on a JPG.

    It will be more easy

    Regards, Codestar

    Posted 2 years ago #
  6. Great, thanks!

    I am using the WP Boilerplate Plugin Framework.

    All admin files that need to be loaded, i.e., require_once() are located in: ../plugins/accsc/includes/class-accsc.php.

    I added a line that loads the plugin file around line #165.

    You plugin file are here: ../plugins/accsc/vendors/codestar-framework/codestar-framework.php

    Instead of a jpg, I want the settings page to load as a submenu under Appearance.

    As the plugins sits in the zip, codestar-framework.php is loading and calling setup.class.php.

    Posted 2 years ago #
  7. I started clean and the config files are loading the panels now, but the Demo submenu is still not registering.

    Posted 2 years ago #

  8. Codestar
    Admin

    Hi,

    I think you missing a minor thing. Let's see the setup types:

    // This is for admin top menu framework example
    CSF::createOptions( $prefix, array(
      'menu_title' => 'My Framework',
      'menu_slug'  => 'my-framework',
    ) );
    
    // Appearance > submenu example
    CSF::createOptions( $prefix, array(
      'menu_title'  => 'My Framework',
      'menu_slug'   => 'my-framework',
      'menu_type'   => 'submenu', // see this parameter
      'menu_parent' => 'themes.php', // see this parameter
    ) );
    
    // Settings > submenu example
    CSF::createOptions( $prefix, array(
      'menu_title'  => 'My Framework',
      'menu_slug'   => 'my-framework',
      'menu_type'   => 'submenu', // see this parameter
      'menu_parent' => 'options-general.php', // see this parameter
    ) );CopyCopied!

    You can get more info from doc: http://codestarframework.com/documentation/#/configurations?id=admin-option-framework

    Or there is another issue and I didn't understand issue ?

    Regards, Codestar

    Posted 2 years ago #