diff --git a/index.php b/index.php index b6a88de..31ed316 100644 --- a/index.php +++ b/index.php @@ -1,72 +1,76 @@ -)/i', $post->post_content, $matches); - }, false ); - if ( !$found_block ) { - return; - } - } - } - - $_min = WP_DEBUG === true?'':'.min'; - - wp_register_style( 'enlighterjs', IOTHEME_BLOCK_URL . '/assets/css/enlighterjs'.$_min.'.css', array(), IOTHEME_BLOCK_VERSION ); - wp_register_script( 'enlighterjs', IOTHEME_BLOCK_URL . '/assets/js/enlighterjs'.$_min.'.js', array('jquery'), IOTHEME_BLOCK_VERSION, true ); - - if(is_single()){ - wp_enqueue_style('enlighterjs'); - wp_enqueue_script('enlighterjs'); - - wp_localize_script('enlighterjs', 'io_code_settings', array( - 'pre_c' => '© '.get_bloginfo('name'), - )); - } -} -add_action('wp_enqueue_scripts', 'io_code_add_enlighter_assets' ); - -/** - * 为编辑器添加全局变量 - * @return void - */ -function io_code_plugin_mce_config(){ - echo ''; -} -add_action('admin_print_scripts', 'io_code_plugin_mce_config');//wp_enqueue_editor | wp_head +)/i', $post->post_content, $matches); + }, false ); + if ( !$found_block ) { + return; + } + } else { + return; + } + } + } + + $_min = WP_DEBUG === true?'':'.min'; + + wp_register_style( 'enlighterjs', IOTHEME_BLOCK_URL . '/assets/css/enlighterjs'.$_min.'.css', array(), IOTHEME_BLOCK_VERSION ); + wp_register_script( 'enlighterjs', IOTHEME_BLOCK_URL . '/assets/js/enlighterjs'.$_min.'.js', array('jquery'), IOTHEME_BLOCK_VERSION, true ); + + if(is_single()){ + wp_enqueue_style('enlighterjs'); + wp_enqueue_script('enlighterjs'); + + wp_localize_script('enlighterjs', 'io_code_settings', array( + 'pre_c' => '© '.get_bloginfo('name'), + )); + } +} +add_action('wp_enqueue_scripts', 'io_code_add_enlighter_assets' ); + +/** + * 为编辑器添加全局变量 + * @return void + */ +function io_code_plugin_mce_config(){ + echo ''; +} +add_action('admin_print_scripts', 'io_code_plugin_mce_config');//wp_enqueue_editor | wp_head