Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I try load external script as plugin , the idea it´s use one easy plugin and call script and load this script into admin but i have problems with some configuration files and css files , in the case of css files for example load and the path it´s right but no add the styles to the forms , by other side i have one file of configuration for insert some strings and take values as the type as this :

$path="../configuration";

The problem it´s no take the values of this string or other

My functions this :

if (is_admin())
{
  function load_libraries()
  {
    locate_template(array('core/funciones/funciones_config.php'), true,false);
  }
  ?>
  <?php
  function plugin_admin_options_page() {
    add_action('admin_menu', 'load_libraries');
    echo $ruta_path;
    ?>
    <div class="wrap">
      <h2>Plugin Options Admin Page</h2>
      <?php
      locate_template(array('core/modulos/mod_dominios/index_adm_menu.php'), true,true);
      ?>
    </div>
    <?php
  }
  //add_options_page("Dominios", "sistema de dominios", "administrator", "dominios_options", "plugin_admin_options_page");
  ?>
  <?php
  function searcher_domains() 
  {
    //add_options_page('Hello World', 'Hello World', 'administrator','hello-world', 'hello_world_html_page');
    add_options_page('Dominios', 'Dominios', 'administrator', 'adm_dominios', 'plugin_admin_options_page');
  }
  add_action('admin_menu', 'searcher_domains');
}

The idea it´s load external scripts into admin of WordPress for manage the same other plugins but the real problem it´s with the paths and include this kind of files and also css or js from this little plugin.

share|improve this question

1 Answer 1

I am having a hard time understanding exactly what the problem is but two things come to mind.

  1. locate_template searches theme directories. It is not a general purpose file loader. I don't know if that is relevant to your case. There is not enough detail in the question to work that out. Given that you have not mentioned themes at all and are only talking about "external scripts" and plugins, I suspect that this is the problem.
  2. You may be having scope issues with the includes.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.