WordPress.org

Forums

Stream
[resolved] Remove Html Tag / Stream Admin Menu Position (17 posts)

  1. mr_pa
    Member
    Posted 1 year ago #

    Hi there,

    first of all nice plugin, really well coded.
    As you can see from the subject of this post i was wondering:

    1) how to remove the html tag <!-- Stream WordPress user activity plugin v1.4.5 -->?

    2) how to move down to the last position the "stream" menu link in the admin section backend.

    I really appreciate hear from you a response.
    Thanks in advance!

    https://wordpress.org/plugins/stream/

  2. Jonathan Bardo
    Member
    Plugin Author

    Posted 1 year ago #

    Hey there mr_pa!

    Here are the steps to resolve your issues:

    1) To remove the html tag, you can implement this quick filter in your theme functions.php
    add_filter( 'wp_stream_frontend_indicator', '__return_empty_string' )

    2) To move stream down the menu link you can implement this other filter in your theme functions.php
    add_filter( 'wp_stream_menu_position', 'XX' ) (note replace XX with the position you want i.e a number)

    N.B You can also create a mu-plugins that implement those 2 filters instead of putting them in your theme. That way if you change theme, those filters will still be activated.

    Have a great day!

  3. mr_pa
    Member
    Posted 1 year ago #

    Thanks for your speedy support.

    Regarding to the second point, i already tried with the solution that you provided but i got this waring:

    Warning: call_user_func_array() expects parameter 1 to be a valid callback, function '99' not found or invalid function name in .....

    Note: i added the filter to the functions.php of my child theme.

    Any suggestion?

  4. Frankie Jarrett
    Member
    Plugin Author

    Posted 1 year ago #

    It's because 99 must be an integer, not a string. So just remove the quotes around it.

  5. mr_pa
    Member
    Posted 1 year ago #

    Unfortunately even without quotes the warning persists :-(

  6. Frankie Jarrett
    Member
    Plugin Author

    Posted 1 year ago #

    Oh, sorry I just looked at original code above, there needs to be a function called or an anonymous function that's doing the return value.

    I just tested these, and they work:

    add_filter( 'wp_stream_frontend_indicator', function() { return false; } );
    add_filter( 'wp_stream_menu_position', function() { return 99; } );
  7. mr_pa
    Member
    Posted 1 year ago #

    Ok i suppose to be solved with:

    add_filter( 'wp_stream_menu_position', function() { return 99; } );

    What do you think?

  8. Frankie Jarrett
    Member
    Plugin Author

    Posted 1 year ago #

    That's correct.

  9. mr_pa
    Member
    Posted 1 year ago #

    ;-)

  10. Jonathan Bardo
    Member
    Plugin Author

    Posted 1 year ago #

    I'm so sorry about that! My bad on that function call!

  11. Frankie Jarrett
    Member
    Plugin Author

    Posted 1 year ago #

    No worries JB!

  12. Brian Cruikshank
    Member
    Posted 1 year ago #

    Hello,

    I'm trying to get menu under Dashboard, but it doesn't seem to play nicely with the native wordpress hook to re-arrange menu order. The following doesn't work to change the order and adding 'admin.php?page=wp_stream' to the array also has no effect.

    function gs_custom_menu_order($menu_ord) {
    	return array(
    		'index.php',
    		'separator1',
    		'edit.php?post_type=page',
    		'edit.php',
    		'edit.php?post_type=mediahits',
    		'edit.php?post_type=author',
    		'edit.php?post_type=project',
    	);
    }
    add_filter('custom_menu_order', '__return_true');
    add_filter('menu_order', 'gs_custom_menu_order');
    add_filter( 'wp_stream_menu_position', function() { return 3; } );

    How can we get this to work with the native WordPress hook?

    Best,
    Brian

  13. Frankie Jarrett
    Member
    Plugin Author

    Posted 1 year ago #

    Brian,

    Are you saying that you want Stream to appear as a submenu of Dashboard? That is not supported since Stream has it's own set of submenus.

    Please clarify, thanks!

  14. Brian Cruikshank
    Member
    Posted 1 year ago #

    Nope. Just want it listed below the dashboard menu item, not a submenu.

  15. Frankie Jarrett
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks for clarifying, Brian.

    What you are describing is the default position of Stream: http://note.io/1qxuINI

    Also see: https://github.com/x-team/wp-stream/blob/40c928b0105452b2c5f9fd9bb5537e6bc0c705d9/includes/admin.php#L123

    I will need a little more insight into what you mean, specifically for your application.

  16. Brian Cruikshank
    Member
    Posted 1 year ago #

    Thanks. That helps me understand.

    I guess the problem is when I use this filter to change the menu order of other items it messes up the placement of the Stream menu item, putting it below my Project CPT ('edit.php?post_type=project').

    When I try to include Stream ('admin.php?page=wp_stream') and add it to the array it doesn't seem to be recognized. Not sure why.

    Best,
    Brian

  17. Brian Cruikshank
    Member
    Posted 1 year ago #

    I figured it out!

    Just add 'wp_stream' to the array where you want it.

    Thanks for looking into this.

    Best,
    Brian

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Stream
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.