コード例 #1
0
ファイル: plugin.php プロジェクト: Tymvie/advanced_ads_mod
 /**
  * shortcode to display content of an ad placement in frontend
  *
  * @since 1.1.0
  * @param arr $atts
  */
 public function shortcode_display_ad_placement($atts)
 {
     $id = isset($atts['id']) ? (string) $atts['id'] : '';
     // use the public available function here
     return get_ad_placement($id);
 }
コード例 #2
0
 /**
  * return content of an in a widget
  *
  * @since 1.2
  * @param string $id slug of the display
  */
 static function output($id = '')
 {
     // get placement data for the slug
     if (empty($id)) {
         return;
     }
     $item = explode('_', $id, 2);
     if (isset($item[1])) {
         $item_id = $item[1];
     } elseif (empty($item_id)) {
         return;
     }
     // return either ad or group content
     if ($item[0] == 'ad') {
         return get_ad(absint($item_id));
     } elseif ($item[0] == 'group') {
         return get_ad_group(absint($item_id));
     } elseif ($item[0] == 'placement') {
         return get_ad_placement($item_id);
     }
     return;
 }
コード例 #3
0
/**
 * return content of an ad placement
 *
 * @since 1.1.0
 * @param string $id slug of the ad placement
 */
function the_ad_placement($id = '')
{
    echo get_ad_placement($id);
}