Advertisement
fauzanjeg

Fix Illegal string offset 'dashboard'

Aug 30th, 2021
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.39 KB | None | 0 0
  1. /** Fix Illegal string offset 'dashboard' */
  2. function fix_admin_slug( $admin_slug ) {
  3.     if ( ! isset( $admin_slug['dashboard'] ) ) {
  4.         $fix_admin_slug = array(
  5.             'dashboard' => 'jnews',
  6.         );
  7.  
  8.         $admin_slug = array_merge( (array) $admin_slug, $fix_admin_slug );
  9.     }
  10.  
  11.     return apply_filters( 'jnews_admin_slug', $admin_slug );
  12. }
  13. add_filter( 'jnews_get_admin_slug', 'fix_admin_slug', 99 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement