Guest User

Untitled

a guest
Dec 12th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. if ( ! defined( 'ABSPATH' ) )
  2. {
  3. exit;
  4. }
  5.  
  6. function sillyplugin_display_settings_page()
  7. {
  8. if ( ! current_user_can ( 'manage_options' ) ) return;
  9. }
  10. ?>
  11.  
  12. <div class="wrap">
  13. <h1><?php echo esc_html( get_admin_page_title() ); ?></h1>
  14. <form action="options.php" method="POST">
  15.  
  16. <?php
  17. settings_fields( 'sillyplugin_options' );
  18. do_settings_sections( 'sillyplugin' );
  19. submit_button();
  20. ?>
  21.  
  22. </form>
  23. </div>
  24.  
  25. <?php
  26. function sillyplugin_add_toplevel_menu()
  27. {
  28. // In order: page title, menu title, capability
  29. // slug, function, icon-url, position
  30.  
  31. add_menu_page(
  32. 'Silly Plugin Settings',
  33. 'Silly Plugin',
  34. 'manage_options',
  35. 'sillyplugin',
  36. 'sillyplugin_display_settings_page',
  37. 'dashicons-admin-generic',
  38. null
  39. );
  40.  
  41. add_action( 'admin_menu', 'sillyplugin_add_toplevel_menu' );
  42. }
  43.  
  44. Uncaught Error: Call to undefined function get_admin_page_title() in /var/www/html/silly/wp-content/plugins/silly-plugin/silly-plugin.php:28
  45. Stack trace:
  46. #0 /var/www/html/silly/wp-settings.php(305): include_once()
  47. #1 /var/www/html/silly/wp-config.php(94): require_once('/var/www/html/s...')
  48. #2 /var/www/html/silly/wp-load.php(37): require_once('/var/www/html/s...')
  49. #3 /var/www/html/silly/wp-admin/admin.php(31): require_once('/var/www/html/s...')
  50. #4 /var/www/html/silly/wp-admin/plugins.php(10): require_once('/var/www/html/s...')
  51. #5 {main}
  52. thrown in <b>/var/www/html/silly/wp-content/plugins/silly-plugin/silly-plugin.php</b> on line <b>28</b><br />
Add Comment
Please, Sign In to add comment