Show only content in page after action click in WordPress admin

to create a page with your own content, you can do like that : add_action(“admin_menu”, function () { $post_type = get_post_type_object(“property”); add_submenu_page( ” ” , “Page title” , “” , $post_type->cap->edit_posts , “property__validationForm” , function () { do_action(“property/validationForm”); } ); }); add_action(“property/validationForm”, function () { ?> <pre><?php var_dump($_GET);?></pre> form <?php }); to create a URL … Read more

How to hook into the subscriber /wp-admin/index.php page?

All of WP’s built-in roles have subscriber capabilities. You’re basically checking here, “if the current user has at least subscriber capabilities”. If you want to isolate only the subscribers, you can check for the absence of a higher capability. If you are just using built-in roles, the next higher role of Contributor has edit_posts and … Read more

How to get bulk actions handler to display simple “Hello World”?

The user is redirected away after the bulk action is performed, so any output will be on the page you’re quick redirected away from. For example, if you’re bulk eiditng pages, you’ll start on a URL like: http://example.com/wp-admin/edit.php?post_type=page&paged=1 Then you perform a bulk action. Once it’s done you’ll end up on: http://example.com/wp-admin/edit.php?post_type=page&paged=1 The same page, … Read more

Creating Admin Submenu Page via Class Method

the action admin_menu is called with one empty argument, then anonymous function can only be with 0 or 1 useless argument. and then if you want to pass variables to this function, you can try that : public function add_submenu_page( $title, $capability = ‘administrator’ ) { $post_type = self::uglify( $this->post_type_name ); $GLOBALS[“MyPlugin_menu”] = [ “post_type” … Read more