wordpress共通経路関数のまとめ

4743 ワード

  ->    “WordPress   (URL)”。
    $op_admin_url = admin_url(); //  :http://www.solagirl.net/wp-admin/
    $op_content_url = content_url(); //  :http://www.solagirl.net/wp-content    wp-config.php    wp-content     ,           
    $op_includes_url = includes_url( '/js/'); //  :http://www.solagirl.net/wp-includes/js/
    
    $op_wp_upload_dir = wp_upload_dir();
    /**     
    *   :$upload_dir = wp_upload_dir();  
    * echo $upload_dir['baseurl'];  //  :http://www.solagirl.net/wp-content/uploads
    * 'path' -             ,      (/)  
    * 'url' -        URL
    * 'subdir' -      ,     /          ,  /2012/07
    * 'basedir' -             ,      
    * 'baseurl' -        URL,      
    * 'error' -     .
    */
    
    $op_get_theme_root_uri = get_theme_root_uri(); //         URI   :http://www.solagirl.net/wp-content/themes
    $op_get_theme_root = get_theme_root(); //                    :/home/user/public_html/wp-content/themes
    $op_get_theme_roots = get_theme_roots(); //           ,         /wp-content/themes,   :/themes
    
    $op_get_stylesheet_directory = get_stylesheet_directory(); 
    /** //                   ,
    * /home/user/public_html/wp-content/themes/twentyeleven
    *     include  ,  
    * 
    */
    
    $op_get_stylesheet_directory_uri = get_stylesheet_directory_uri();
    /** //            URI 
    *   :http://www.solagirl.net/wp-content/themes/twentyeleven
    *            URI   ,    
    *  
    */
    
    $op_GET_TEMPLATE_DIRECTORY_URI = GET_TEMPLATE_DIRECTORY_URI(); //            child theme,     parent theme     URI,   get_stylesheet_directory_uri()  。
    $op_GET_TEMPLATE_DIRECTORY = GET_TEMPLATE_DIRECTORY(); //            child theme,     parent theme             ,   get_stylesheet_directory()  。
    $op_get_stylesheet = get_stylesheet();//               , get_template()    ,    child theme,   child theme     。
    $op_get_template = get_template();//               ,          twentyeleven,   :twentyeleven
    
    //        
    $op_plugins_url() = plugins_url(); //  :http://www.solagirl.net/wp-content/plugins
    $op_plugins_url('',__FILE__) = plugins_url(); //  :http://www.solagirl.net/wp-content/plugins/myplugin
    $op_plugins_url('js/myscript.js',__FILE__); = plugins_url(); //  :http://www.solagirl.net/wp-content/plugins/myplugin/js/myscript.js
    $op_plugin_dir_url( __FILE__ ) = plugin_dir_url( __FILE__ ); //  :(        ):http://www.solagirl.net/wp-content/plugins/myplugin/
    
    
    $op_plugin_dir_path( __FILE__ ) = plugin_dir_path( __FILE__ ); 
    /** 
    *   :/home/user/public_html/wp-content/plugins/myplugin/
    *     include  ,  
    * 
    */
    
    
    $op_plugin_basename(__FILE__) = plugin_basename(__FILE__); 
    /** 
    *               (      )
           myplugin  myplugin.php        ,    
      echo plugin_basename(__FILE__); 
      //  :myplugin/myplugin.php
         myplugin/include/test.php     (test.php  include   myplugin.php ),    
      echo plugin_basename(__FILE__);
      //  :myplugin/include/test.php
    */
    $op_redux_path = get_template_directory() . '/redux';
    $op_redux_path = get_template_directory() . '/redux';
    
    
    $op_redux_path = get_template_directory() . '/redux';
    //       ,         redux
    $op_plugins_path = get_template_directory() . '/redux/plugins';
    //       ,         redux
    $op_themes_path = get_template_directory() . '/redux/themes';
    //       ,         redux
    $op_uploads_path = get_template_directory() . '/redux/uploads';
    //       ,         redux
    $op_languages_path = get_template_directory() . '/redux/languages';
    //       ,         redux
    $op_wp_content_path = get_template_directory() . '/redux';
    //       ,         redux
    $op_wp_includes = get_template_directory() . '/redux';