Changeset 20805


Ignore:
Timestamp:
Feb 18, 2013, 1:31:56 PM (7 years ago)
Author:
mistic100
Message:

allow to pass an array to get_tag_ids()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/functions.php

    r20544 r20805  
    21302130}
    21312131
     2132/*
     2133 * get tags list from SQL query (ids are surrounded by ~~, for get_tag_ids())
     2134 * @param string: query
     2135 * @param boolean: only_user_language, if true, only local name is returned for multilingual tags
     2136 */
    21322137function get_taglist($query, $only_user_language=true)
    21332138{
     
    21702175}
    21712176
     2177/*
     2178 * get tags ids from a list of raw tags (existing tags or new tags)
     2179 * @param mixed: raw_tags, array or comma separated string
     2180 * @param boolean: allow_create
     2181 */
    21722182function get_tag_ids($raw_tags, $allow_create=true)
    21732183{
     
    21782188
    21792189  $tag_ids = array();
    2180   $raw_tags = explode(',',$raw_tags);
     2190  if (!is_array($raw_tags))
     2191  {
     2192    $raw_tags = explode(',',$raw_tags);
     2193  }
    21812194
    21822195  foreach ($raw_tags as $raw_tag)
Note: See TracChangeset for help on using the changeset viewer.