get_menu_hook( 'settings' ) !== $hook ) { return; } /* Enqueue scripts for the editor preview */ code_snippets_enqueue_codemirror(); /* Enqueue ALL themes */ $themes = code_snippets_get_available_themes(); foreach ( $themes as $theme ) { wp_enqueue_style( 'code-snippets-codemirror-theme-' . $theme, plugins_url( "css/min/cmthemes/$theme.css", CODE_SNIPPETS_FILE ), array( 'code-snippets-codemirror' ) ); } wp_enqueue_script( 'jquery' ); } add_action( 'admin_enqueue_scripts', 'code_snippets_editor_settings_preview_assets' ); /** * Render a theme select field */ function code_snippets_codemirror_theme_select_field( $atts ) { $saved_value = code_snippets_get_setting( $atts['section'], $atts['id'] ); echo ''; } /** * Render the editor preview setting */ function code_snippets_settings_editor_preview() { $example_content = " function example_custom_admin_footer_text( \$text ) { return 'Thank you for visiting ' . get_bloginfo( 'name' ) . '.'; } add_filter( 'admin_footer_text', 'example_custom_admin_footer_text' ); "; $atts = array( 'mode' => 'text/x-php', 'value' => $example_content, ); ?>