• kleb123

    (@kleb123)


    Is it possible to add the user search field to a ranking displayed with a shortcode (so not just the main ranking page)>

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author AntoineH

    (@antoineh)

    I guess you’re referring to the extension I wrote to add a simple search to the user page?

    If yes, then you can change that script to use the html filter that the ranking shortcode has. It is this part:

    add_filter( 'footballpool_ranking_page_html', array( __CLASS__, 'add_search' ) );

    You’ll have to look up the exact value in the shortcode class file. The rest of the logic can stay the same as both page and shortcode use the same functions to get the ranking.

    If you want to have a search on both, then don’t change the line, but add a same one, but then with the filter from the shortcode.

    Thread Starter kleb123

    (@kleb123)

    Yes that’s what I meant, but I don’t completely understand it. I have the both PHP files (the one with shortcodes and the one with add user search). Where exactly do I need to add that part in the shortcode php? Or do I have to add something in the user search php?

    Plugin Author AntoineH

    (@antoineh)

    You have to add it to the user search extension. I looked it up for you, this is the correct filter:

    add_filter( 'footballpool_shortcode_html_fp-ranking', array( __CLASS__, 'add_search' ) );

    Thread Starter kleb123

    (@kleb123)

    Thanks again!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘User search’ is closed to new replies.