Changeset 577868
- Timestamp:
- 07/26/2012 10:47:27 PM (14 years ago)
- Location:
- shortcode-reference/branches/20120726_include_fix
- Files:
-
- 2 edited
-
conf/include.php (modified) (3 diffs)
-
shortcode_reference.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
shortcode-reference/branches/20120726_include_fix/conf/include.php
r318972 r577868 1 1 <?php 2 2 /** 3 * This file contains some utilities to get the extension working. 3 * This file contains some utilities to get the extension working. 4 4 **/ 5 define (SHORTCODE_REFERENCE_PLUGIN_DIR, '/'.str_replace(array(ABSPATH,conf),array('',''),dirname(__FILE__)));6 5 7 6 /** … … 33 32 34 33 /** 34 * Function to include static files for using this plugins. 35 * Thanks to Stephanie Leary for the suggestion! 36 * 37 * 38 **/ 39 function shortcode_reference_scripts() { 40 $referrer = realpath(dirname(__FILE__)); 41 wp_enqueue_style( 'shortcode-reference-style', plugins_url('/css/shortcode-reference.css', $referrer) ); 42 wp_enqueue_script( 'shortcode-reference-js', plugins_url('/js/shortcode-reference.js', $referrer) ); 43 } 44 45 /** 35 46 * A little utility-function to retrieve the shortcode's details. Executed in a custom action 36 47 */ … … 40 51 $ShortcodeReferenceUIManager->getReference($shortcode); 41 52 } 42 43 wp_register_style('shortcode-reference-style', SHORTCODE_REFERENCE_PLUGIN_DIR.'/css/shortcode-reference.css',false); -
shortcode-reference/branches/20120726_include_fix/shortcode_reference.php
r330871 r577868 10 10 if (version_compare(phpversion(),'5.0.0','gt')) { 11 11 require_once 'conf/include.php'; 12 13 wp_enqueue_style('shortcode-reference-style'); 14 wp_enqueue_script('shortcode-reference-js', SHORTCODE_REFERENCE_PLUGIN_DIR.'/js/shortcode-reference.js', null,null,true); 15 12 16 13 $dir = dirname(__FILE__).'/lib'; 17 14 shortcode_overview_util_require_files($dir); … … 19 16 * Add an extra meta-box 20 17 */ 18 add_action('admin_head-post.php', 'shortcode_reference_scripts'); 19 add_action('admin_head-post-new.php', 'shortcode_reference_scripts'); 20 21 21 add_action('add_meta_boxes','shortcode_reference_render_meta_box'); 22 22 add_action('wp_ajax_shortcode_reference_find_shortcode', 'shortcode_reference_get_reference');
Note: See TracChangeset
for help on using the changeset viewer.