Browse Source

output forms

windhamdavid 4 months ago
parent
commit
fea9899849
1 changed files with 42 additions and 5 deletions
  1. 42 5
      functions.php

+ 42 - 5
functions.php

@@ -62,6 +62,11 @@ function lps24_wplogin_filter( $url, $path, $orig_scheme ) {
 
 
 add_filter( 'show_admin_bar', '__return_false' );
 add_filter( 'show_admin_bar', '__return_false' );
 
 
+add_action( 'admin_enqueue_scripts', 'lps24_admin_styles' );
+function lps24_admin_styles() {
+  wp_enqueue_style( 'style-editor', get_template_directory_uri().'/style-editor.css' );
+}
+
 add_action( 'admin_bar_menu', 'lps24_remove_adminbar', 999 );
 add_action( 'admin_bar_menu', 'lps24_remove_adminbar', 999 );
 function lps24_remove_adminbar( $wp_admin_bar ) {
 function lps24_remove_adminbar( $wp_admin_bar ) {
 	$wp_admin_bar->remove_node('wp-logo');
 	$wp_admin_bar->remove_node('wp-logo');
@@ -109,10 +114,10 @@ function lps24_remove_admin_pages() {
     remove_menu_page('gutenberg');
     remove_menu_page('gutenberg');
     remove_menu_page('users.php');
     remove_menu_page('users.php');
     remove_submenu_page('themes.php', 'themes-editor.php');
     remove_submenu_page('themes.php', 'themes-editor.php');
-    remove_submenu_page( 'themes.php', 'customize.php?return=' . urlencode($_SERVER['SCRIPT_NAME']));
-    remove_submenu_page( 'themes.php', 'themes.php' );
-    remove_submenu_page( 'themes.php', 'theme-editor.php' );
-    remove_submenu_page( 'themes.php', 'theme_options' );
+    remove_submenu_page('themes.php', 'customize.php?return=');
+    remove_submenu_page('themes.php', 'themes.php');
+    remove_submenu_page('themes.php', 'theme-editor.php');
+    remove_submenu_page('themes.php', 'theme_options');
     remove_submenu_page('gf_edit_forms', 'gf_new_form');
     remove_submenu_page('gf_edit_forms', 'gf_new_form');
     remove_submenu_page('gf_edit_forms', 'gf_export');
     remove_submenu_page('gf_edit_forms', 'gf_export');
     remove_submenu_page('gf_edit_forms', 'gf_addons');
     remove_submenu_page('gf_edit_forms', 'gf_addons');
@@ -303,4 +308,36 @@ add_filter(
   10
   10
 );
 );
 
 
-remove_action( 'enqueue_block_editor_assets', 'wp_enqueue_editor_block_directory_assets' );
+remove_action( 'enqueue_block_editor_assets', 'wp_enqueue_editor_block_directory_assets' );
+
+
+/***********************************************************
+######################## Output ############################
+************************************************************/
+
+add_action( 'init', 'lps24_clean_output' );
+function lps24_clean_output() {
+  remove_action( 'wp_head', 'feed_links', 2 );
+  remove_action( 'wp_head', 'feed_links_extra', 3 );
+  remove_action( 'wp_head', 'rsd_link' );
+  remove_action( 'wp_head', 'wp_generator' );
+  remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
+  remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
+  remove_action( 'wp_print_styles', 'print_emoji_styles' );
+  remove_action( 'admin_print_styles', 'print_emoji_styles' );
+  remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
+  remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
+  remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
+}
+
+
+
+/***********************************************************
+######################## Forms #############################
+************************************************************/
+
+function lps24_add_gf_capabilities(){
+  $role = get_role( 'editor' );
+  $role->add_cap( 'gform_full_access' );
+}
+add_action( 'admin_init', 'lps24_add_gf_capabilities' );