mirror of
https://github.com/10h30/trestle.git
synced 2026-06-05 15:09:35 +09:00
Switched from hardcoded uploads folder to wp_upload_dir().
This commit is contained in:
@@ -40,17 +40,16 @@ function trestle_header_actions() {
|
||||
|
||||
// Get WP uploads directory
|
||||
$upload_dir = wp_upload_dir();
|
||||
$upload_dir = $upload_dir['basedir'];
|
||||
$upload_dir = $upload_dir['path'];
|
||||
|
||||
// Custom CSS (if it exists)
|
||||
$custom_css_file = $upload_dir . '/trestle/custom.css';
|
||||
if ( is_readable( ABSPATH . $custom_css_file ) )
|
||||
if ( is_readable( $custom_css_file ) )
|
||||
wp_enqueue_style( 'trestle-custom-css', '/' . $custom_css_file );
|
||||
|
||||
// Custom jQuery (if it exists)
|
||||
$custom_js_file = $upload_dir . '/trestle/custom.js';
|
||||
echo $custom_js_file;
|
||||
if ( is_readable( ABSPATH . $custom_js_file ) )
|
||||
if ( is_readable( $custom_js_file ) )
|
||||
wp_enqueue_script( 'trestle-custom-jquery', '/' . $custom_js_file, array( 'jquery' ), CHILD_THEME_VERSION, true );
|
||||
|
||||
// Pass PHP variables to theme jQuery
|
||||
|
||||
Reference in New Issue
Block a user