Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find a way to show the "Submission" status of the CF7 Submissions submenu by default (instead of "All") #2281

Open
chrisblakley opened this issue Mar 27, 2024 · 0 comments
Labels
Backend (Server) Related to the server-side (includes PHP, HTML, etc). Low Priority Not of great importance, and certainly not urgent. Plugin / Library / API For third-party resources such as WordPress plugins, external APIs, and other libraries. WP Admin / Shortcode / Widget Related to the WordPress admin-side (like the Dashboard), or shortcodes/widgets.
Milestone

Comments

@chrisblakley
Copy link
Owner

I want to find a way to make this the default when viewing CF7 form submissions:

Screenshot 2024-03-26 at 9 08 57 PM

This code works to modify the submenu slug to link to the Submissions status:

add_action('admin_menu', function(){
  global $submenu;
  if ( isset($submenu) && !empty($submenu) ){ //Check if $submenu is set and not empty
	  foreach ( $submenu as $parent_slug => &$submenus ){ //Loop through each top-level menu item by reference
		  if ( is_array($submenus) && !empty($submenus) ){ //Check if there are submenus for the current top-level menu item
			  foreach ($submenus as &$submenu_item){ //Loop through each submenu item by reference
				  if ( $submenu_item[2] == 'edit.php?post_type=nebula_cf7_submits' ){
					  $submenu_item[2] = 'edit.php?post_status=submission&post_type=nebula_cf7_submits'; //Modify the reference to it updates globally
				  }
			  }
		  }
	  }
  }
});

However, the Contact Form 7 parent menu does not stay open when this is modified this way and I can't find a way to keep it open...

JavaScript is not an acceptable solution to this.

If I find a way to do that, I would then modify the custom post statuses of "Invalid" and "Spam" to allow them to appear in the "All" list (via /libs/Functions.php).

@chrisblakley chrisblakley added Low Priority Not of great importance, and certainly not urgent. WP Admin / Shortcode / Widget Related to the WordPress admin-side (like the Dashboard), or shortcodes/widgets. Plugin / Library / API For third-party resources such as WordPress plugins, external APIs, and other libraries. Backend (Server) Related to the server-side (includes PHP, HTML, etc). labels Mar 27, 2024
@chrisblakley chrisblakley added this to the 12.0 Flame milestone Apr 3, 2024
@chrisblakley chrisblakley modified the milestones: 12.0 Flame, 13.0 Bubble May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend (Server) Related to the server-side (includes PHP, HTML, etc). Low Priority Not of great importance, and certainly not urgent. Plugin / Library / API For third-party resources such as WordPress plugins, external APIs, and other libraries. WP Admin / Shortcode / Widget Related to the WordPress admin-side (like the Dashboard), or shortcodes/widgets.
Projects
None yet
Development

No branches or pull requests

1 participant