NEXT craftinamerica.org. Base setup for headless wordpress https://www.craftinamerica.org
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

php-console-log-menu.php 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. // If this file is called directly, abort.
  3. if ( !defined( 'WPINC' ) ) {
  4. die;
  5. }
  6. /**
  7. * @func php_console_log_help_page()
  8. *
  9. * Create a menu link so PHP_CONSOLE_LOG_PLUGIN_PAGE_LINK_FILTER can add links
  10. * to plugin page. No menu link is actually displayed. This is just a
  11. * placeholder.
  12. *
  13. * @since 1.0.0
  14. */
  15. function php_console_log_help_page() {
  16. add_submenu_page(
  17. 'php-console-log-placeholder',
  18. __( 'PHP Console Log Help', 'php-console-log' ),
  19. __( 'PHP Console Log Help', 'php-console-log' ),
  20. 'manage_options',
  21. 'php-console-log-help',
  22. 'php_console_log_page_help'
  23. );
  24. }
  25. add_action( 'admin_menu', 'php_console_log_help_page' );
  26. /**
  27. * @func php_console_log_add_help_link()
  28. *
  29. * Adds a link to PHP Console Log help page on the plugins page in admin.
  30. *
  31. * @since 1.0.0
  32. *
  33. * @param array $links Array of links to show on the plugins page.
  34. * @return array The $links array with Console Log help page link appended to it.
  35. */
  36. function php_console_log_add_help_link( $links ) {
  37. $help_link = '<a href="admin.php?page=php-console-log-help">' . __( 'Help', 'php-console-log' ) . '</a>';
  38. array_push( $links, $help_link );
  39. return $links;
  40. }
  41. add_filter( PHP_CONSOLE_LOG_PLUGIN_PAGE_LINK_FILTER, 'php_console_log_add_help_link' );