• Resolved magmomod

    (@magmomod)


    Hello, I need to find a league id based on a league name in the database, how can I find that using sql query?

Viewing 1 replies (of 1 total)
  • Plugin Contributor Savvas

    (@savvasha)

    Hi @magmomod ,

    It is not recommended to use directly sql queries to get info from WP database. To get the league id based on league name you can use the get_term_by() WordPress function.

    i.e. $league = get_term_by('name', 'League Name', 'sp_league');
    echo $league->term_id;

    Thanks,
    Savvas

Viewing 1 replies (of 1 total)
  • The topic ‘find by tag id’ is closed to new replies.